|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.javasource.JType
org.exolab.javasource.JStructure
org.exolab.javasource.JAnnotationType
public final class JAnnotationType
Describes the definition of a annotation type class.
JAnnotationType type = new JAnnotationType("RequestForEnhancement"); type.addElement(new JAnnotationTypeElement("id", JType.Int)); type.addElement(new JAnnotationTypeElement("synopsis", new JType("String"))); JAnnotationTypeElement engineer; engineer = new JAnnotationTypeElement("engineer", new JType("String")); engineer.setDefaultString("\"[unassigned]\""); type.addElement(engineer); JAnnotationTypeElement date; date = new JAnnotationTypeElement("date", new JType("String")); date.setDefaultString("\"[unimplemented]\""); type.addElement(date);outputs
public @interface RequestForEnhancement { int id(); String synopsis(); String engineer() default "[unassigned]"; String date() default "[unimplemented]"; }
Field Summary |
---|
Fields inherited from class org.exolab.javasource.JType |
---|
BOOLEAN, BYTE, CHAR, DOUBLE, FLOAT, INT, LONG, SHORT |
Constructor Summary | |
---|---|
JAnnotationType(java.lang.String name)
Creates a JAnnotationType of the given name. |
Method Summary | |
---|---|
void |
addElement(JAnnotationTypeElement jElement)
Adds the given JAnnotationTypeElement to this JAnnotationType. |
void |
addField(JField jField)
Not implemented. |
void |
addImport(java.lang.String className)
Adds the given import to this JStructure. |
void |
addMember(JMember jMember)
Adds the given JMember to this JAnnotationType. |
JAnnotationTypeElement |
getElement(java.lang.String name)
Returns the member with the given name, or null if no member was found with the given name. |
JAnnotationTypeElement[] |
getElements()
Returns an Array containing all our JAnnotationTypeElements. |
JField |
getField(java.lang.String name)
Not implemented. |
JField[] |
getFields()
Not implemented. |
void |
print(JSourceWriter jsw)
Deprecated. Please use the Velocity-template based approach instead. |
Methods inherited from class org.exolab.javasource.JStructure |
---|
addAnnotation, addImport, addImport, addImportInternal, addInterface, getAnnotatedElementHelper, getAnnotation, getAnnotations, getFilename, getHeader, getImportCount, getImports, getInterfaceCount, getInterfaces, getJDocComment, getModifiers, getPackageName, hasAnnotations, hasImport, isAnnotationPresent, print, printHeader, printImportDeclarations, printPackageDeclaration, removeAnnotation, removeImport, setHeader, toString |
Methods inherited from class org.exolab.javasource.JType |
---|
getLocalName, getName, isArray, isPrimitive, setName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JAnnotationType(java.lang.String name)
name
- Annotation name.Method Detail |
---|
public void addImport(java.lang.String className)
addImport
in class JStructure
className
- Name of the class to import.public void addMember(JMember jMember)
addMember
in class JStructure
jMember
- The JMember to add.public JAnnotationTypeElement[] getElements()
public JAnnotationTypeElement getElement(java.lang.String name)
name
- The name of the member to return.
public void addElement(JAnnotationTypeElement jElement)
jElement
- The element to add.public JField[] getFields()
getFields
in class JStructure
public JField getField(java.lang.String name)
getField
in class JStructure
name
- The name of the field to return.
public void addField(JField jField)
addField
in class JStructure
jField
- The JField to add.public void print(JSourceWriter jsw)
print
in class JStructure
jsw
- The JSourceWriter to print to.SourceGenerator.setJClassPrinterType(String)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |