org.exolab.javasource

Class JAnnotationTypeElement

Implemented Interfaces:
JMember

public final class JAnnotationTypeElement
extends java.lang.Object
implements JMember

Holds information about a given annotation type element.
Author:
Andrew Fawcett

Constructor Summary

JAnnotationTypeElement(String name, JType type)
Constructs a JAnnotationTypeElement with a given name and type.

Method Summary

JDocComment
getComment()
Returns the JavaDoc comment describing this member.
String
getDefaultString()
Returns the initialization string for this JAnnotationTypeElement.
JModifiers
getModifiers()
Returns the modifiers for this JAnnotationTypeElement.
String
getName()
Returns the name of this JAnnotationTypeElement.
JType
getType()
Returns the JType representing the type of this JAnnotationTypeElement.
static void
main(String[] args)
Test.
void
print(JSourceWriter jsw)
Outputs the annotation type element to the provided JSourceWriter.
void
setComment(String comment)
Sets the JavaDoc comment describing this member.
void
setComment(JDocComment comment)
Sets the JavaDoc comment describing this member.
void
setDefaultString(String defaultString)
Sets the initialization string for this JAnnotationTypeElement.
void
setName(String name)
Sets the name of this JAnnotationTypeElement.

Constructor Details

JAnnotationTypeElement

public JAnnotationTypeElement(String name,
                              JType type)
Constructs a JAnnotationTypeElement with a given name and type.
Parameters:
name - name of this new JAnnotatedTypeElement
type - type of this new JAnnotatedTypeElement

Method Details

getComment

public JDocComment getComment()
Returns the JavaDoc comment describing this member.
Returns:
the comment describing this member, or null if no comment has been set.

getDefaultString

public String getDefaultString()
Returns the initialization string for this JAnnotationTypeElement.
Returns:
the initialization string for this JAnnotationTypeElement.

getModifiers

public JModifiers getModifiers()
Returns the modifiers for this JAnnotationTypeElement.
Specified by:
getModifiers in interface JMember
Returns:
the modifiers for this JAnnotationTypeElement.

getName

public String getName()
Returns the name of this JAnnotationTypeElement.
Specified by:
getName in interface JMember
Returns:
the name of this JAnnotationTypeElement.

getType

public JType getType()
Returns the JType representing the type of this JAnnotationTypeElement.
Returns:
the JType representing the type of this JAnnotationTypeElement.

main

public static void main(String[] args)
Test.
Parameters:
args - command-line arguments

print

public void print(JSourceWriter jsw)
Outputs the annotation type element to the provided JSourceWriter.
Parameters:
jsw - the JSourceWriter to print this element to

setComment

public void setComment(String comment)
Sets the JavaDoc comment describing this member.
Parameters:
comment - the JDocComment for this member.

setComment

public void setComment(JDocComment comment)
Sets the JavaDoc comment describing this member.
Parameters:
comment - the JDocComment for this member.

setDefaultString

public void setDefaultString(String defaultString)
Sets the initialization string for this JAnnotationTypeElement. This method allows some flexibility in declaring default values.
Parameters:
defaultString - the default string for this member

setName

public void setName(String name)
Sets the name of this JAnnotationTypeElement.
Parameters:
name - the name of this JAnnotationTypeElement.

Intalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com