org.exolab.javasource
Class JAnnotationType
- JAnnotatedElement
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]";
}
$Revision: 6673 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $
addAnnotation , addField , addImport , addImport , addImport , addImportInternal , addInterface , addMember , getAnnotatedElementHelper , getAnnotation , getAnnotations , getField , getFields , getFilename , getHeader , getImportCount , getImports , getInterfaceCount , getInterfaces , getJDocComment , getModifiers , getPackageName , hasAnnotations , hasImport , isAnnotationPresent , print , print , printHeader , printImportDeclarations , printPackageDeclaration , removeAnnotation , removeImport , setHeader , toString |
JAnnotationType
public JAnnotationType(String name)
Creates a JAnnotationType of the given name.
addElement
public void addElement(JAnnotationTypeElement jElement)
Adds the given JAnnotationTypeElement to this JAnnotationType.
jElement
- The element to add.
addField
public void addField(JField jField)
Not implemented. Always throws a RuntimeException.
- addField in interface JStructure
addMember
public void addMember(JMember jMember)
Adds the given JMember to this JAnnotationType.
- addMember in interface JStructure
jMember
- The JMember to add.
getElement
public JAnnotationTypeElement getElement(String name)
Returns the member with the given name, or null if no member was found
with the given name.
name
- The name of the member to return.
- The member with the given name, or null if no member was found
with the given name.
getElements
public JAnnotationTypeElement[] getElements()
Returns an Array containing all our JAnnotationTypeElements.
- An Array containing all our JAnnotationTypeElements.
getField
public JField getField(String name)
Not implemented. Always throws a RuntimeException.
- getField in interface JStructure
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com