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: * @(#)AttributeGen24.java 1.18 07/05/05
035: */
036:
037: package com.sun.tools.corba.se.idl.toJavaPortable;
038:
039: // NOTES:
040: // -D62023 <klr> New file to implement CORBA 2.4 RTF
041: // REVISIT: These changes should be folded into AttributeGen.
042:
043: import java.io.PrintWriter;
044:
045: import java.util.Enumeration;
046: import java.util.Vector;
047: import java.util.Hashtable;
048:
049: import com.sun.tools.corba.se.idl.InterfaceEntry;
050: import com.sun.tools.corba.se.idl.MethodEntry;
051: import com.sun.tools.corba.se.idl.ParameterEntry;
052: import com.sun.tools.corba.se.idl.SymtabEntry;
053: import com.sun.tools.corba.se.idl.AttributeEntry;
054:
055: /**
056: *
057: **/
058: public class AttributeGen24 extends MethodGenClone24 {
059: /**
060: * Public zero-argument constructor.
061: **/
062: public AttributeGen24() {
063: } // ctor
064:
065: /**
066: * <d62023-klr> Added for 2.4 RTF
067: **/
068: protected void abstractMethod(Hashtable symbolTable, MethodEntry m,
069: PrintWriter stream) {
070: AttributeEntry a = (AttributeEntry) m;
071:
072: // Generate for the get method
073: super .abstractMethod(symbolTable, a, stream);
074:
075: // Generate for the set method if the attribute is not readonly
076: if (!a.readOnly()) {
077: setupForSetMethod();
078: super .abstractMethod(symbolTable, a, stream);
079: clear();
080: }
081: } // abstractMethod
082:
083: /**
084: * <d62023-klr> Added for 2.4 RTF
085: **/
086: protected void interfaceMethod(Hashtable symbolTable,
087: MethodEntry m, PrintWriter stream) {
088: AttributeEntry a = (AttributeEntry) m;
089:
090: // Generate for the get method
091: super .interfaceMethod(symbolTable, a, stream);
092:
093: // Generate for the set method if the attribute is not readonly
094: if (!a.readOnly()) {
095: setupForSetMethod();
096: super .interfaceMethod(symbolTable, a, stream);
097: clear();
098: }
099: } // interfaceMethod
100:
101: } // class AttributeGen24
|