void | addExtends(Class pExtends)- Sets the class or interface extended by this class or interface.
|
void | addExtends(JavaQName pExtends)- Sets the class or interface extended by this class or interface.
|
void | addImplements(Class s)- Adds an interface to the list of interfaces being implemented by
this class or interface.
|
void | addImplements(JavaQName s)- Adds an interface to the list of interfaces being implemented by
this class or interface.
|
void | addImport(Class s)- Adds a package or class to the list of packages and classes being imported.
|
void | addImport(JavaQName s)- Adds a package or class to the list of packages and classes being imported.
|
void | addInnerClass(JavaInnerClass pClass)- Adds an inner class.
|
void | addRawJavaSource(String pSource)- Adds a piece of raw Java source to the class.
|
String | asString(JavaQName pQName, boolean pAddIfPossible)- Returns whether the given JavaQName is a local class.
|
void | clearExtends()- Clears the list of extended classes or interfaces.
|
void | clearImplements()- Clears the list of implemented interfaces.
|
void | clearImports()- Clears the list of imports.
|
void | clearInnerClasses()- Clears the list of inner classes.
|
void | clearRawJavaSources()- Clears the list of raw Java sources.
|
JavaClassInitializer[] | getClassInitializers()- Returns the static class initializers.
|
String | getClassName()- Returns the class or interface name.
|
JavaComment | getComment()- Returns the comment describing this class or interface.
|
JavaConstructor | getConstructor(JavaQName[] pParams)- Returns the constructor with the given signature or null, if there
is no such constructor.
|
Iterator | getConstructorIterator()- Returns an iterator the the classes constructors.
|
JavaConstructor[] | getConstructors()- Returns the list of constructors that this class has.
|
JavaQName[] | getExtends()- Returns the class or interface extended by this class or interface.
|
JavaSourceFactory | getFactory()- Returns the
JavaSourceFactory that created this instance of
JavaSource.
|
JavaField | getField(String pName)- Returns the field with the given name or null, if no such field exists.
|
JavaField[] | getFields()- Returns the list of fields that this class has.
|
JavaQName[] | getImplements()- Returns the list of interfaces being implented by this class or
interface.
|
JavaQName[] | getImports()- Returns the list of packages and classes being imported.
|
JavaInnerClass | getInnerClass(String pName)- Returns the inner class named
pName, or
null, if no such class exists.
|
JavaInnerClass[] | getInnerClasses()- Returns the array of inner classes.
|
JavaMethod | getMethod(String pMethodName, JavaQName[] pParams)- Returns the method with the given signature or null, if there
is no such method.
|
Iterator | getMethodIterator()- Returns an iterator to the classes methods.
|
JavaMethod[] | getMethods()- Returns the list of methods that this class has.
|
String | getPackageName()- Returns the package name.
|
JavaSource.Protection | getProtection()- Returns the protection.
|
JavaQName | getQName()- Returns the JavaSource's JavaQName.
|
static String | getQuoted(String s)- Returns a quoted string constant suitable for embedding
into Java source.
|
static String | getQuotedNoQuotes(String s)- Returns a quoted string constant suitable for embedding
into Java source, but without quotes.
|
String[] | getRawJavaSources()- Returns an array with the pieces of raw Java sources.
|
protected boolean | getStatic()- Returns whether this JavaSource is static (for inner classes).
|
JavaSource.Type | getType()- Returns the JavaSource type.
|
boolean | hasDynamicImports()- Returns, whether the class is automatically adding imports.
|
boolean | isAbstract()- Returns whether class is abstract.
|
boolean | isExtending(Class pClass)- Returns whether the class is extending the given super class or interface.
|
boolean | isExtending(JavaQName pClass)- Returns whether the class is extending the given super class or interface.
|
boolean | isForcingFullyQualifiedName()- Returns, whether class references are always using the
fully qualified class name.
|
boolean | isImplementing(Class pClass)- Returns whether the class is implementing the given interface.
|
boolean | isImplementing(JavaQName pClass)- Returns whether the class is implementing the given interface.
|
boolean | isInnerClass()- Returns, whether this is an inner class.
|
boolean | isInterface()- Returns whether this is an interface or not.
|
void | newBeanProperty(Class pClass, String pName)- Shortcut for
newBeanProperty(JavaQNameImpl.getInstance(pClass), pName).
|
void | newBeanProperty(Class pClass, String pFieldName, String pGetMethodName, String pSetMethodName)- Shortcut for
newBeanProperty(JavaQNameImpl.getInstance(pClass),
pFieldName, pGetMethodName, pSetMethodName).
|
void | newBeanProperty(JavaQName pType, String pName)- Creates a new Java property with the given type and name.
|
void | newBeanProperty(JavaQName pType, String pFieldName, String pGetMethodName, String pSetMethodName)- Shortcut for
newJavaField(pFieldName, pType, JavaSource.PRIVATE);
JavaMethod getMethod = newJavaMethod(pGetMethodName, pType, JavaSource.PUBLIC);
getMethod.addLine("return this.", pFieldName, ";");
JavaMethod setMethod = newJavaMethod(pSetMethodName, JavaQNameImpl.VOID, JavaSource.PUBLIC);
setMethod.addParam(pType, pFieldName);
setMethod.addLine("this.", pFieldName, " = ", pFieldName, ";");
|
JavaComment | newComment()- Creates a new Javadoc comment describing this class or interface.
|
JavaClassInitializer | newJavaClassInitializer()- Creates a new instance of JavaClassInitializer.
|
JavaConstructor | newJavaConstructor()- Creates a new JavaConstructor with default protection.
|
JavaConstructor | newJavaConstructor(Constructor pConstructor)- Creates a new JavaConstructor with the signature of the
given constructor.
|
JavaConstructor | newJavaConstructor(String pProtection)- Creates a new JavaConstructor with the given protection.
|
JavaConstructor | newJavaConstructor(JavaConstructor pConstructor)- Creates a new JavaConstructor with the same parameters,
protection and exceptions than the given.
|
JavaConstructor | newJavaConstructor(JavaConstructor pConstructor, boolean pSuper)- Creates a new JavaConstructor with the same signature
than the given constructors.
|
JavaConstructor | newJavaConstructor(JavaSource.Protection pProtection)- Creates a new JavaConstructor with the given protection.
|
JavaField | newJavaField(Field pField)- Creates a new JavaField with the given fields signature.
|
JavaField | newJavaField(String pName, Class pType)- Creates a new JavaField with the given name, type and
default protection.
|
JavaField | newJavaField(String pName, Class pType, String pProtection)- Creates a new JavaField with the given name, type and
protection.
|
JavaField | newJavaField(String pName, Class pType, JavaSource.Protection pProtection)- Creates a new JavaField with the given name, type and
protection.
|
JavaField | newJavaField(String pName, String pType)- Creates a new JavaField with the given name, type and
default protection.
|
JavaField | newJavaField(String pName, String pType, String pProtection)- Creates a new JavaField with the given name, type and
protection.
|
JavaField | newJavaField(String pName, String pType, JavaSource.Protection pProtection)- Creates a new JavaField with the given name, type and
protection.
|
JavaField | newJavaField(String pName, JavaQName pType)- Creates a new JavaField with the given name, type and
default protection.
|
JavaField | newJavaField(String pName, JavaQName pType, String pProtection)- Creates a new JavaField with the given name, type and
protection.
|
JavaField | newJavaField(String pName, JavaQName pType, JavaSource.Protection pProtection)- Creates a new JavaField with the given name, type and
protection.
|
JavaInnerClass | newJavaInnerClass(String pName)- Creates a new JavaInnerClass with the given name and
default protection.
|
JavaInnerClass | newJavaInnerClass(String pName, String pProtection)- Creates a new JavaInnerClass with the given name and
protection.
|
JavaInnerClass | newJavaInnerClass(String pName, JavaSource.Protection pProtection)- Creates a new JavaInnerClass with the given name and
protection.
|
JavaMethod | newJavaMethod(Method pMethod)- Creates a new JavaMethod with the signature of the given method
pMethod.
|
JavaMethod | newJavaMethod(String pName, Class pType)- Creates a new JavaMethod with the given name, return
type and default protection.
|
JavaMethod | newJavaMethod(String pName, Class pType, String pProtection)- Creates a new JavaMethod with the given name, return
type and protection.
|
JavaMethod | newJavaMethod(String pName, Class pType, JavaSource.Protection pProtection)- Creates a new JavaMethod with the given name, return
type and protection.
|
JavaMethod | newJavaMethod(String pName, String pType)- Creates a new JavaMethod with the given name, return
type and default protection.
|
JavaMethod | newJavaMethod(String pName, String pType, String pProtection)- Creates a new JavaMethod with the given name, return
type and protection.
|
JavaMethod | newJavaMethod(String pName, String pType, JavaSource.Protection pProtection)- Creates a new JavaMethod with the given name, return
type and protection.
|
JavaMethod | newJavaMethod(String pName, JavaQName pType)- Creates a new JavaMethod with the given name, return
type and default protection.
|
JavaMethod | newJavaMethod(String pName, JavaQName pType, String pProtection)- Creates a new JavaMethod with the given name, return
type and protection.
|
JavaMethod | newJavaMethod(String pName, JavaQName pType, JavaSource.Protection pProtection)- Creates a new JavaMethod with the given name, return
type and protection.
|
JavaMethod | newJavaMethod(JavaMethod pMethod)- Creates a new JavaMethod with the given methods name and signature.
|
void | setAbstract(boolean isAbstract)- Sets whether this class is abstract.
|
void | setDynamicImports(boolean pDynamicImports)- Sets, whether the class is automatically adding imports.
|
void | setForcingFullyQualifiedName(boolean pForcingFullyQualifiedName)- Sets, whether class references are always using the
fully qualified class name.
|
void | setProtection(JavaSource.Protection protection)- Sets the protection; use null for default protection.
|
void | setQName(JavaQName pQName)- Sets the JavaSource's JavaQName.
|
void | setStatic(boolean pStatic)- Sets whether this JavaSource is static (for inner classes).
|
void | setType(JavaSource.Type pType)- Sets the JavaSource type.
|
String | toString()- Returns a string representation of this JavaSource file.
|
void | write(Writer pTarget)- Writes the JavaSource contents into the given Writer.
|
void | write(IndentationTarget pTarget)
|