org.exolab.javasource

Class JAnnotationTypeElement

public class JAnnotationTypeElement extends Object implements JMember

A class that 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
JDocCommentgetComment()
Returns the comment describing this member.
StringgetDefaultString()
Gets the initialization string for this JAnnotationTypeElement
JModifiersgetModifiers()
Returns the modifiers for this JAnnotationTypeElement
StringgetName()
Returns the name of this JAnnotationTypeElement
JTypegetType()
Returns the JType represting the type of this JAnnotationTypeElement
static voidmain(String[] args)
Test
voidprint(JSourceWriter jsw)
Outputs the annotation type element
voidsetComment(JDocComment comment)
Sets the comment describing this member.
voidsetComment(String comment)
Sets the comment describing this member.
voidsetDefaultString(String defaultString)
Sets the initialization string for this JAnnotationTypeElement; Allows some flexibility in declaring default values.
voidsetName(String name)
Sets the name of this JAnnotationTypeElement

Constructor Detail

JAnnotationTypeElement

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

Parameters: name type

Method Detail

getComment

public JDocComment getComment()
Returns the comment describing this member.

Returns: the comment describing this member, or null if no comment has been set.

getDefaultString

public String getDefaultString()
Gets the initialization string for this JAnnotationTypeElement

Returns: Gets the initialization string for this JAnnotationTypeElement

getModifiers

public JModifiers getModifiers()
Returns the modifiers for this JAnnotationTypeElement

Returns: the modifiers for this JAnnotationTypeElement

getName

public String getName()
Returns the name of this JAnnotationTypeElement

Returns: the name of this JAnnotationTypeElement

getType

public JType getType()
Returns the JType represting the type of this JAnnotationTypeElement

Returns: the JClass represting the type of this JAnnotationTypeElement

main

public static void main(String[] args)
Test

Parameters: args

print

public void print(JSourceWriter jsw)
Outputs the annotation type element

Parameters: jsw

setComment

public void setComment(JDocComment comment)
Sets the comment describing this member.

Parameters: comment the JDocComment for this member

setComment

public void setComment(String comment)
Sets the comment describing this member.

Parameters: comment the JDocComment for this member

setDefaultString

public void setDefaultString(String defaultString)
Sets the initialization string for this JAnnotationTypeElement; 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

Throws: IllegalArgumentException when the name is not a valid Java member name

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