|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.ispsoft.jaxme.generator.javasource.JavaSource
A class representing a Java source file.
Constructor Summary | |
JavaSource(java.lang.String pPackage,
java.lang.String pName)
Creates a new instance of JavaSource with default protection. |
|
JavaSource(java.lang.String pPackage,
java.lang.String pName,
java.lang.String pProtection)
Creates a new instance of JavaSource with the given protection. |
Method Summary | |
void |
addConstructor(JavaConstructor c)
Adds a constructor to this classes list of constructors. |
void |
addField(JavaField f)
Adds a field to this classes list of fields. |
void |
addImplements(java.lang.String s)
Adds an interface to the list of interfaces being implemented by this class or interface. |
void |
addImport(java.lang.String s)
Adds a package or class to the list of packages and classes being imported. |
void |
addInnerClass(JavaInnerClass pClass)
Adds an inner class. |
void |
addMethod(JavaMethod m)
Adds a method to this classes list of methods. |
void |
addRawJavaSource(java.lang.String pSource)
Adds a piece of raw Java source to the class. |
void |
clearInnerClasses()
Clears the list of inner classes. |
void |
clearRawJavaSources()
Clears the list of raw Java sources. |
JavaComment |
getComment()
Returns the comment describing this class or interface. |
java.util.ArrayList |
getConstructors()
Returns the list of constructors that this class has. |
java.lang.String |
getExtends()
Returns the class or interface extended by this class or interface. |
java.util.ArrayList |
getFields()
Returns the list of fields that this class has. |
java.util.ArrayList |
getImplements()
Returns the list of interfaces being implented by this class or interface. |
java.util.ArrayList |
getImport()
Returns the list of packages and classes being imported. |
JavaInnerClass[] |
getInnerClasses()
Returns the array of inner classes. |
java.util.ArrayList |
getMethods()
Returns the list of methods that this class has. |
java.lang.String |
getName()
Returns the class or interface name. |
java.lang.String |
getPackage()
Returns the package name; null indicates the root package. |
java.lang.String |
getProtection()
Returns the protection; null for default protection. |
java.lang.String |
getQName()
Returns the qualified class name, including the package name. |
static java.lang.String |
getQuoted(java.lang.String s)
Returns a quoted string constant suitable for embedding into Java source. |
static java.lang.String |
getQuotedNoQuotes(java.lang.String s)
Returns a quoted string constant suitable for embedding into Java source, but without quotes. |
java.lang.String[] |
getRawJavaSources()
Returns an array with the pieces of raw Java sources. |
protected boolean |
getStatic()
Returns whether this JavaSource is static (for inner classes). |
java.lang.String |
getType()
Returns the JavaSource type. |
boolean |
isAbstract()
Returns whether class is abstract. |
void |
setAbstract(boolean isAbstract)
Sets whether this class is abstract, |
void |
setComment(JavaComment comment)
Sets the comment describing this class or interface. |
void |
setExtends(java.lang.String pExtends)
Sets the class or interface extended by this class or interface. |
void |
setName(java.lang.String name)
Sets the class or interface name. |
void |
setPackage(java.lang.String pPackage)
Sets the package name; null or empty string indicate the root package. |
void |
setProtection(java.lang.String protection)
Sets the protection; use null for default protection. |
void |
setStatic(boolean pStatic)
Sets whether this JavaSource is static (for inner classes). |
void |
setType(java.lang.String type)
Sets the JavaSource type. |
java.lang.String |
toString()
Returns a string representation of this JavaSource file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public JavaSource(java.lang.String pPackage, java.lang.String pName)
pPackage
- The package name; null or empty string indicates
the root packagepName
- The class or interface namepublic JavaSource(java.lang.String pPackage, java.lang.String pName, java.lang.String pProtection)
Creates a new instance of JavaSource with the given protection.
pPackage
- The package name; null or empty string indicates
the root packagepName
- The class or interface namepProtection
- null, "public", "protected" or "private"Method Detail |
public java.lang.String getName()
Returns the class or interface name.
setName(java.lang.String)
public void setName(java.lang.String name)
Sets the class or interface name.
getName()
public java.lang.String getProtection()
Returns the protection; null for default protection.
setProtection(java.lang.String)
public void setProtection(java.lang.String protection)
Sets the protection; use null for default protection.
getProtection()
public java.lang.String getPackage()
Returns the package name; null indicates the root package.
setPackage(java.lang.String)
public void setPackage(java.lang.String pPackage)
Sets the package name; null or empty string indicate the root package.
getPackage()
public java.lang.String getQName()
Returns the qualified class name, including the package name.
public java.lang.String getType()
Returns the JavaSource type.
setType(java.lang.String)
public void setType(java.lang.String type)
Sets the JavaSource type.
type
- "class" or "interface"getType()
public JavaComment getComment()
Returns the comment describing this class or interface.
setComment(de.ispsoft.jaxme.generator.javasource.JavaComment)
public void setComment(JavaComment comment)
Sets the comment describing this class or interface.
getComment()
public java.lang.String getExtends()
Returns the class or interface extended by this class or interface.
setExtends(java.lang.String)
public void setExtends(java.lang.String pExtends)
Sets the class or interface extended by this class or interface. Null or the empty string disable the "extends" clause.
getExtends()
public java.util.ArrayList getImport()
Returns the list of packages and classes being imported.
addImport(java.lang.String)
public void addImport(java.lang.String s)
Adds a package or class to the list of packages and classes being imported.
addImport(java.lang.String)
public java.util.ArrayList getImplements()
Returns the list of interfaces being implented by this class or interface.
addImplements(java.lang.String)
public void addImplements(java.lang.String s)
Adds an interface to the list of interfaces being implemented by this class or interface.
getImplements()
public java.util.ArrayList getFields()
Returns the list of fields that this class has.
addField(de.ispsoft.jaxme.generator.javasource.JavaField)
public void addField(JavaField f)
Adds a field to this classes list of fields.
getFields()
public java.util.ArrayList getConstructors()
Returns the list of constructors that this class has.
addConstructor(de.ispsoft.jaxme.generator.javasource.JavaConstructor)
public void addConstructor(JavaConstructor c)
Adds a constructor to this classes list of constructors.
getConstructors()
public java.util.ArrayList getMethods()
Returns the list of methods that this class has.
addMethod(de.ispsoft.jaxme.generator.javasource.JavaMethod)
public void addMethod(JavaMethod m)
Adds a method to this classes list of methods.
getMethods()
public java.lang.String toString()
Returns a string representation of this JavaSource file.
public static java.lang.String getQuotedNoQuotes(java.lang.String s)
Returns a quoted string constant suitable for embedding into Java source, but without quotes.
public static java.lang.String getQuoted(java.lang.String s)
Returns a quoted string constant suitable for embedding into Java source.
public void addInnerClass(JavaInnerClass pClass)
Adds an inner class.
public void clearInnerClasses()
Clears the list of inner classes.
public JavaInnerClass[] getInnerClasses()
Returns the array of inner classes.
protected boolean getStatic()
Returns whether this JavaSource is static (for inner classes).
public void setStatic(boolean pStatic)
Sets whether this JavaSource is static (for inner classes).
public void addRawJavaSource(java.lang.String pSource)
Adds a piece of raw Java source to the class.
public void clearRawJavaSources()
Clears the list of raw Java sources.
public java.lang.String[] getRawJavaSources()
Returns an array with the pieces of raw Java sources.
public boolean isAbstract()
Returns whether class is abstract.
public void setAbstract(boolean isAbstract)
Sets whether this class is abstract,
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |