Factories.java revision 608:7e06bf1dcb09
1/*
2 * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.  Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25/*
26 * COMPONENT_NAME: idl.toJava
27 *
28 * ORIGINS: 27
29 *
30 * Licensed Materials - Property of IBM
31 * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999
32 * RMI-IIOP v1.0
33 *
34 */
35
36package com.sun.tools.corba.se.idl.toJavaPortable;
37
38// NOTES:
39// -D62023<klr> Add corbaLevel=2.4
40
41/**
42 *
43 **/
44public class Factories extends com.sun.tools.corba.se.idl.Factories
45{
46  public com.sun.tools.corba.se.idl.GenFactory genFactory ()
47  {
48    return new GenFactory ();
49  } // genFactory
50
51  public com.sun.tools.corba.se.idl.Arguments arguments ()
52  {
53    return new Arguments ();
54  } // arguments
55
56  public String[] languageKeywords ()
57  {
58  // These are Java keywords that are not also IDL keywords.
59    return keywords;
60  } // languageKeywords
61
62  static String[] keywords =
63    {"abstract",   "break",     "byte",
64     "catch",      "class",     "continue",
65     "do",         "else",      "extends",
66     "false",      "final",     "finally",
67     "for",        "goto",      "if",
68     "implements", "import",    "instanceof",
69     "int",        "interface", "native",
70     "new",        "null",      "operator",
71     "outer",      "package",   "private",
72     "protected",  "public",    "return",
73     "static",     "super",     "synchronized",
74     "this",       "throw",     "throws",
75     "transient",  "true",      "try",
76     "volatile",   "while",
77// Special reserved suffixes:
78     "+Helper",    "+Holder",   "+Package",
79// These following are not strictly keywords.  They
80// are methods on java.lang.Object and, as such, must
81// not have conflicts with methods defined on IDL
82// interfaces.  Treat them the same as keywords.
83     "clone",      "equals",       "finalize",
84     "getClass",   "hashCode",     "notify",
85     "notifyAll",  "toString",     "wait"};
86
87  ///////////////
88  // toJava-specific factory methods
89
90  private Helper _helper = null;        // <62023>
91  public Helper helper ()
92  {
93    if (_helper == null)
94      if (Util.corbaLevel (2.4f, 99.0f)) // <d60023>
95         _helper = new Helper24 ();     // <d60023>
96      else
97         _helper = new Helper ();
98    return _helper;
99  } // helper
100
101  private ValueFactory _valueFactory = null;        // <62023>
102  public ValueFactory valueFactory ()
103  {
104    if (_valueFactory == null)
105      if (Util.corbaLevel (2.4f, 99.0f)) // <d60023>
106         _valueFactory = new ValueFactory ();     // <d60023>
107      // else return null since shouldn't be used
108    return _valueFactory;
109  } // valueFactory
110
111  private DefaultFactory _defaultFactory = null;        // <62023>
112  public DefaultFactory defaultFactory ()
113  {
114    if (_defaultFactory == null)
115      if (Util.corbaLevel (2.4f, 99.0f)) // <d60023>
116         _defaultFactory = new DefaultFactory ();     // <d60023>
117      // else return null since shouldn't be used
118    return _defaultFactory;
119  } // defaultFactory
120
121  private Holder _holder = new Holder ();
122  public Holder holder ()
123  {
124    return _holder;
125  } // holder
126
127  private Skeleton _skeleton = new Skeleton ();
128  public Skeleton skeleton ()
129  {
130    return _skeleton;
131  } // skeleton
132
133  private Stub _stub = new Stub ();
134  public Stub stub ()
135  {
136    return _stub;
137  } // stub
138
139  // toJava-specific factory methods
140  ///////////////
141} // class Factories
142