|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ClassInfo
Interface to hold metadata about a Java class. This class can be use by the builders to generate a Java class source file. Then the ClassInfo can be written out as a Java source file.
Field Summary | |
---|---|
static int |
ACTION_CLASS
|
static int |
BEAN_CLASS
|
static java.lang.String |
GENERATED_BODY_BEGIN_PREFIX
|
static java.lang.String |
GENERATED_BODY_BEGIN_SUFFIX
|
static java.lang.String |
GENERATED_BODY_END
|
static java.lang.String |
GENERATED_PLACEHOLDER_PREFIX
|
static java.lang.String |
GENERATED_PLACEHOLDER_SUFFIX
|
Fields inherited from interface com.bowstreet.webapp.WebAppObject |
---|
ALWAYS_VISIBLE, INFORMATION_PROPERTY, NEVER_VISIBLE, SOMETIMES_VISIBLE |
Method Summary | |
---|---|
Method |
addConstructor(java.lang.String name)
Adds a constructor method (Method) to the class. |
void |
addImplements(java.lang.String implementsName)
Adds a name to the names that this class implements. |
void |
addImport(java.lang.String name)
Adds a java import statement to this class. |
Initializer |
addInitializer()
Adds a initializer (Initializer) to the class. |
ClassInfo |
addInnerClass(java.lang.String name)
Constructs a ClassInfo and adds it as an inner class. |
Member |
addMember(java.lang.String name,
java.lang.String type,
java.lang.String modifier)
Adds a data member to this class with no default value. |
Member |
addMember(java.lang.String name,
java.lang.String type,
java.lang.String modifier,
java.lang.String defaultValue)
Adds a data member to this class with a specified default value. |
Method |
addMethod(java.lang.String name)
Adds a method (MethodInfo) to the class. |
java.lang.String |
getClassName()
Gets the java class name including its package. |
int |
getClassType()
Gets the type of this class. |
java.lang.String |
getDescription()
Gets the comment at top of file (i.e. above the package declaration). |
java.lang.String |
getExtends()
Gets the name that the class extends. |
java.util.Iterator |
getImplements()
Gets an Iterator of interface names this class implements. |
java.util.Iterator |
getImports()
Gets an iterator of the imports of this class. |
java.util.Iterator |
getInitializers()
Gets an Iterator of all the initializers on the class. |
ClassInfo |
getInnerClass(java.lang.String name)
Gets the specified inner class(ClassInfo) on this class. |
java.util.Iterator |
getInnerClasses()
Gets an iterator of the inner classes. |
java.util.Iterator |
getMembers()
Gets an Iterator of all the data members of the class. |
Method |
getMethod(java.lang.String name)
Gets the specified method(Method) on this class. |
java.util.Iterator |
getMethods()
Gets an Iterator of all the methods on the class. |
java.lang.String |
getModifier()
Returns the modifier. |
java.lang.String |
getPackage()
Returns the packageName. |
boolean |
isInterface()
Gets if this ClassInfo describes an interface. |
void |
setClassName(java.lang.String className)
Sets the java class name including its package. |
void |
setClassType(int classType)
Sets the type of this class. |
void |
setDescription(java.lang.String description)
Sets the comment at top of file (i.e. above the package declaration). |
void |
setExtends(java.lang.String extendsName)
Sets the name that the class extends. |
void |
setInterface(boolean isInterface)
Sets if this ClassInfo describes an interface. |
void |
setModifier(java.lang.String modifier)
Sets the modifier. |
java.lang.String |
toString()
Gets a String of the entire class source. |
void |
write(java.io.Writer writer)
Writes the entire class source to the specified Writer. |
Methods inherited from interface com.bowstreet.webapp.WebAppObject |
---|
clone, getBuilderCall, getName, getProperties, getProperty, getVisibility, isHidden, putProperty, setBuilderCall, setHidden, setName, setVisibility |
Methods inherited from interface com.bowstreet.util.IExemplar |
---|
newInstance |
Methods inherited from interface com.bowstreet.webapp.ClassItem |
---|
getComment, isGenerated, setComment, setGenerated, write |
Field Detail |
---|
static final int ACTION_CLASS
static final int BEAN_CLASS
static final java.lang.String GENERATED_BODY_BEGIN_PREFIX
static final java.lang.String GENERATED_BODY_BEGIN_SUFFIX
static final java.lang.String GENERATED_BODY_END
static final java.lang.String GENERATED_PLACEHOLDER_PREFIX
static final java.lang.String GENERATED_PLACEHOLDER_SUFFIX
Method Detail |
---|
Method addConstructor(java.lang.String name)
name
- The name of the method to add.
void addImplements(java.lang.String implementsName)
implementsName
- The interface name to add.void addImport(java.lang.String name)
name
- The name of the import (e.g. "java.util.*").Initializer addInitializer()
ClassInfo addInnerClass(java.lang.String name)
name
- The name of the ClassInfo to add, which is used to reference it in a collection of inner ClassInfo objects. This name does not necessarily need to match the actual class name.Member addMember(java.lang.String name, java.lang.String type, java.lang.String modifier)
name
- The name of the member.type
- The java data type (e.g. String, File).modifier
- A java modifier (e.g. private).
Member addMember(java.lang.String name, java.lang.String type, java.lang.String modifier, java.lang.String defaultValue)
name
- The name of the member.type
- The java data type (e.g. String, File).modifier
- A java modifier (e.g. private).defaultValue
- A default value to set the member to.
Method addMethod(java.lang.String name)
name
- The name of the method to add.
java.lang.String getClassName()
int getClassType()
java.lang.String getDescription()
java.lang.String getExtends()
java.util.Iterator getImplements()
java.util.Iterator getImports()
java.util.Iterator getInitializers()
ClassInfo getInnerClass(java.lang.String name)
name
- The inner class to get.
java.util.Iterator getInnerClasses()
java.util.Iterator getMembers()
Method getMethod(java.lang.String name)
name
- The Method to get.
java.util.Iterator getMethods()
java.lang.String getModifier()
getModifier
in interface ClassItem
java.lang.String getPackage()
boolean isInterface()
void setClassName(java.lang.String className)
className
- The java class name including its package (e.g. com.bowstreet.MyClass).void setClassType(int classType)
classType
- The type of this class.void setDescription(java.lang.String description)
description
- The comment at top of file.void setExtends(java.lang.String extendsName)
extendsName
- The name that the class extends.void setInterface(boolean isInterface)
isInterface
- true if this is an interface, else false.void setModifier(java.lang.String modifier)
modifier
- The modifier to setjava.lang.String toString()
toString
in class java.lang.Object
void write(java.io.Writer writer) throws java.io.IOException
java.io.IOException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |