001: /*
002: * Copyright 1999 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025: /*
026: * COMPONENT_NAME: idl.toJava
027: *
028: * ORIGINS: 27
029: *
030: * Licensed Materials - Property of IBM
031: * 5639-D57 (C) COPYRIGHT International Business Machines Corp. 1997, 1999
032: * RMI-IIOP v1.0
033: *
034: * @(#)Factories.java 1.20 07/05/05
035: */
036:
037: package com.sun.tools.corba.se.idl.toJavaPortable;
038:
039: // NOTES:
040: // -D62023<klr> Add corbaLevel=2.4
041:
042: /**
043: *
044: **/
045: public class Factories extends com.sun.tools.corba.se.idl.Factories {
046: public com.sun.tools.corba.se.idl.GenFactory genFactory() {
047: return new GenFactory();
048: } // genFactory
049:
050: public com.sun.tools.corba.se.idl.Arguments arguments() {
051: return new Arguments();
052: } // arguments
053:
054: public String[] languageKeywords() {
055: // These are Java keywords that are not also IDL keywords.
056: return keywords;
057: } // languageKeywords
058:
059: static String[] keywords = { "abstract", "break", "byte", "catch",
060: "class", "continue", "do", "else", "extends", "false",
061: "final", "finally", "for", "goto", "if", "implements",
062: "import", "instanceof", "int", "interface", "native",
063: "new", "null", "operator", "outer", "package", "private",
064: "protected", "public", "return", "static", "super",
065: "synchronized", "this", "throw", "throws", "transient",
066: "true", "try", "volatile",
067: "while",
068: // Special reserved suffixes:
069: "+Helper",
070: "+Holder",
071: "+Package",
072: // These following are not strictly keywords. They
073: // are methods on java.lang.Object and, as such, must
074: // not have conflicts with methods defined on IDL
075: // interfaces. Treat them the same as keywords.
076: "clone", "equals", "finalize", "getClass", "hashCode",
077: "notify", "notifyAll", "toString", "wait" };
078:
079: ///////////////
080: // toJava-specific factory methods
081:
082: private Helper _helper = null; // <62023>
083:
084: public Helper helper() {
085: if (_helper == null)
086: if (Util.corbaLevel(2.4f, 99.0f)) // <d60023>
087: _helper = new Helper24(); // <d60023>
088: else
089: _helper = new Helper();
090: return _helper;
091: } // helper
092:
093: private ValueFactory _valueFactory = null; // <62023>
094:
095: public ValueFactory valueFactory() {
096: if (_valueFactory == null)
097: if (Util.corbaLevel(2.4f, 99.0f)) // <d60023>
098: _valueFactory = new ValueFactory(); // <d60023>
099: // else return null since shouldn't be used
100: return _valueFactory;
101: } // valueFactory
102:
103: private DefaultFactory _defaultFactory = null; // <62023>
104:
105: public DefaultFactory defaultFactory() {
106: if (_defaultFactory == null)
107: if (Util.corbaLevel(2.4f, 99.0f)) // <d60023>
108: _defaultFactory = new DefaultFactory(); // <d60023>
109: // else return null since shouldn't be used
110: return _defaultFactory;
111: } // defaultFactory
112:
113: private Holder _holder = new Holder();
114:
115: public Holder holder() {
116: return _holder;
117: } // holder
118:
119: private Skeleton _skeleton = new Skeleton();
120:
121: public Skeleton skeleton() {
122: return _skeleton;
123: } // skeleton
124:
125: private Stub _stub = new Stub();
126:
127: public Stub stub() {
128: return _stub;
129: } // stub
130:
131: // toJava-specific factory methods
132: ///////////////
133: } // class Factories
|