325N/A * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 325N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 325N/A * This code is free software; you can redistribute it and/or modify it 325N/A * under the terms of the GNU General Public License version 2 only, as 325N/A * published by the Free Software Foundation. Oracle designates this 325N/A * particular file as subject to the "Classpath" exception as provided 325N/A * by Oracle in the LICENSE file that accompanied this code. 325N/A * This code is distributed in the hope that it will be useful, but WITHOUT 325N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 325N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 325N/A * version 2 for more details (a copy is included in the LICENSE file that 325N/A * accompanied this code). 325N/A * You should have received a copy of the GNU General Public License version 325N/A * 2 along with this work; if not, write to the Free Software Foundation, 325N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 325N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 325N/A * or visit www.oracle.com if you need additional information or have any 325N/A * This class models a declaration, and since a declaration can be always 325N/A * used as a reference, it inherits {@link JClass}. 325N/A * <h2>Where to go from here?</h2> 325N/A * You'd want to generate fields and methods on a class. 325N/A * See {@link #method(int, JType, String)} and {@link #field(int, JType, String)}. 325N/A /** Name of this class. Null if anonymous. */ 325N/A /** Modifiers for the class declaration */ 325N/A /** Name of the super class of this class. */ 325N/A /** List of interfaces that this class implements */ 325N/A /** Fields keyed by their names. */ 325N/A /** Static initializer, if this class has one */ 325N/A /** Set of constructors for this class, if any */ 325N/A /** Set of methods that are members of this class */ 325N/A * Nested classes as a map from name to JDefinedClass. 325N/A * The name is all capitalized in a case sensitive file system 325N/A * ({@link JCodeModel#isCaseSensitiveFileSystem}) to avoid conflicts. 325N/A * Lazily created to save footprint. 325N/A * Flag that controls whether this class should be really generated or not. 325N/A * Sometimes it is useful to generate code that refers to class X, 325N/A * without actually generating the code of X. 325N/A * This flag is used to surpress X.java file in the output. 325N/A * Client-app spcific metadata associated with this user-created class. 325N/A * String that will be put directly inside the generated code. 325N/A * If this is a package-member class, this is {@link JPackage}. 325N/A * If this is a nested class, this is {@link JDefinedClass}. 325N/A * If this is an anonymous class, this constructor shouldn't be used. 325N/A /** Default value is class or interface 325N/A * or annotationTypeDeclaration 325N/A /** List containing the enum value declarations 325N/A// private List enumValues = new ArrayList(); 325N/A * Set of enum constants that are keyed by names. 325N/A * In Java, enum constant order is actually significant, 325N/A * because of order ID they get. So let's preserve the order. 325N/A * Annotations on this variable. Lazily created. 325N/A * Helper class to implement {@link JGenerifiable}. 325N/A * Constructor for creating anonymous inner class. 325N/A * Modifiers for this class declaration 325N/A +
" contains illegal character" 325N/A +
" for beginning of identifier: " 325N/A +
" contains illegal character " 325N/A * Returns true if this is an anonymous class. 325N/A * This class extends the specifed class. 325N/A * Superclass for this class 325N/A " Outer class " +
this.
name +
" may not subclass from inner class: " + o.
name());
325N/A * Returns the class extended by this class. 325N/A * This class implements the specifed interface. 325N/A * Interface that this class implements 325N/A * Returns an iterator that walks the nested classes defined in this 325N/A * JClass name accessor. 325N/A * For example, for <code>java.util.List</code>, this method 325N/A * returns <code>"List"</code>" 325N/A * @return Name of this class 325N/A * If the named enum already exists, the reference to it is returned. 325N/A * Otherwise this method generates a new enum reference with the given 325N/A * The name of the constant. 325N/A * The generated type-safe enum constant. 325N/A * Gets the fully qualified name of this class. 325N/A * Adds a field to the list of field members of this JDefinedClass. 325N/A * Modifiers for this field 325N/A * @return Newly generated field 325N/A * Adds a field to the list of field members of this JDefinedClass. 325N/A * Modifiers for this field. 325N/A * Initial value of this field. 325N/A * @return Newly generated field 325N/A /** This method indicates if the interface 325N/A * is an annotationTypeDeclaration 325N/A * Add an annotationType Declaration to this package 325N/A * Name of the annotation Type declaration to be added to this package 325N/A * newly created Annotation Type Declaration 325N/A * @exception JClassAlreadyExistsException 325N/A * Add a public enum to this package 325N/A * Name of the enum to be added to this package 325N/A * @exception JClassAlreadyExistsException 325N/A * Add a public enum to this package 325N/A * Name of the enum to be added to this package 325N/A * Modifiers for this enum declaration 325N/A * @exception JClassAlreadyExistsException 325N/A * Returns all the fields declred in this class. 325N/A * The returned {@link Map} is a read-only live view. 325N/A * @return always non-null. 325N/A * Removes a {@link JFieldVar} from this class. 325N/A * @throws IllegalArgumentException 325N/A * if the given field is not a field on this class. 325N/A * Creates, if necessary, and returns the static initializer 325N/A * @return JBlock containing initialization statements for this class 325N/A * Adds a constructor to this class. 325N/A * Modifiers for this constructor 325N/A * Returns an iterator that walks the constructors defined in this class. 325N/A * Looks for a method that has the specified method signature 325N/A * Add a method to the list of method members of this JDefinedClass instance. 325N/A * Modifiers for this method 325N/A * Return type for this method 325N/A * @return Newly generated JMethod 325N/A // XXX problems caught in M constructor 325N/A * Returns the set of methods defined in this class. 325N/A * Looks for a method that has the specified method signature 325N/A * Add a new nested class to this class. 325N/A * Modifiers for this class declaration 325N/A * Name of class to be added to this package 325N/A * @return Newly generated class 325N/A // XXX problems caught in the NC constructor 325N/A * Add a new public nested class to this class. 325N/A * Add an interface to this package. 325N/A * Modifiers for this interface declaration 325N/A * Name of interface to be added to this package 325N/A * @return Newly generated interface 325N/A * Adds a public interface to this package. 325N/A * Creates, if necessary, and returns the class javadoc for this 325N/A * @return JDocComment containing javadocs for this class 325N/A * Mark this file as hidden, so that this file won't be 325N/A * This feature could be used to generate code that refers 325N/A * Returns an iterator that walks the nested classes defined in this 325N/A * Returns all the nested classes defined in this class. 325N/A * prints the body of a class. 325N/A * Places the given string directly inside the generated class. 325N/A * generated by CodeModel. 325N/A * This method should be used only as the last resort. 325N/A /** Adding ability to annotate a class 325N/A * The annotation class to annotate the class with 325N/A /** Adding ability to annotate a class 325N/A * The annotation class to annotate the class with 325N/A * {@link JAnnotatable#annotations()} 325N/A * the current modifiers of this class. 325N/A * Always return non-null valid object.