View Javadoc
1   /*
2    * Copyright (c) 2000, 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  package com.sun.tools.corba.se.idl;
27  
28  // NOTES:
29  
30  import java.io.PrintWriter;
31  import java.util.Hashtable;
32  
33  /**
34   * This is the symbol table entry for constants.
35   **/
36  public class NativeEntry extends SymtabEntry
37  {
38    protected NativeEntry ()
39    {
40      super ();
41      repositoryID (Util.emptyID);
42    } // ctor
43  
44    protected NativeEntry (SymtabEntry that, IDLID clone)
45    {
46      super (that, clone);
47      if (module ().equals (""))
48        module (name ());
49      else if (!name ().equals (""))
50        module (module () + "/" + name ());
51    } // ctor
52  
53    protected NativeEntry (NativeEntry that)
54    {
55      super (that);
56    } // ctor
57  
58    /** This is a shallow copy clone. */
59    public Object clone ()
60    {
61      return new NativeEntry (this);
62    } // clone
63  
64    /** Invoke the constant generator.
65        @param symbolTable the symbol table is a hash table whose key is
66         a fully qualified type name and whose value is a SymtabEntry or
67         a subclass of SymtabEntry.
68        @param stream the stream to which the generator should sent its output.
69        @see SymtabEntry */
70    public void generate (Hashtable symbolTable, PrintWriter stream)
71    {
72      nativeGen.generate(symbolTable, this, stream);
73    } // generate
74  
75    /** Access the constant generator.
76        @returns an object which implements the ConstGen interface.
77        @see ConstGen */
78    public Generator generator ()
79    {
80      return nativeGen;
81    } // generator
82  
83    static NativeGen nativeGen;
84  } // class NativeEntry