org.exolab.javasource
Class JAnnotatedElementHelper

java.lang.Object
  extended by org.exolab.javasource.JAnnotatedElementHelper
All Implemented Interfaces:
JAnnotatedElement
Direct Known Subclasses:
JConstructor, JEnumConstant, JField, JMethodSignature, JParameter

public class JAnnotatedElementHelper
extends java.lang.Object
implements JAnnotatedElement

Class implements JAnnotatedElement interface on behalf of other classes in this package that implement this interface.

Author:
Andrew Fawcett

Constructor Summary
JAnnotatedElementHelper()
          Creates a JAnnodatedElementHelper
 
Method Summary
 void addAnnotation(JAnnotation annotation)
          Adds a JAnnotation to this source element.
 JAnnotation getAnnotation(JAnnotationType annotationType)
          Retrieves a JAnnotation for the given JAnnotationType, returns null if no annotation has been set.
 JAnnotation[] getAnnotations()
          Returns a list of JAnnotation's already set on this source element
 boolean hasAnnotations()
          Returns true if annotations have been added to this source element
 boolean isAnnotationPresent(JAnnotationType annotationType)
          Returns true if a JAnnotation exists for the given JAnnotationType
static void main(java.lang.String[] args)
          Test
 boolean printAnnotations(JSourceWriter jsw)
          Outputs the list of annotations maintained by this object
 JAnnotation removeAnnotation(JAnnotationType annotationType)
          Removes the JAnnotation from this source element for the given JAnnotationType, throws a IllegalArgumentException if no JAnnotation has been added.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JAnnotatedElementHelper

public JAnnotatedElementHelper()
Creates a JAnnodatedElementHelper

Method Detail

getAnnotation

public JAnnotation getAnnotation(JAnnotationType annotationType)
Description copied from interface: JAnnotatedElement
Retrieves a JAnnotation for the given JAnnotationType, returns null if no annotation has been set.

Specified by:
getAnnotation in interface JAnnotatedElement
Returns:
A JAnnotation for the given JAnnotationType

getAnnotations

public JAnnotation[] getAnnotations()
Description copied from interface: JAnnotatedElement
Returns a list of JAnnotation's already set on this source element

Specified by:
getAnnotations in interface JAnnotatedElement
Returns:
A list of all JAnnotations associated with this source element

isAnnotationPresent

public boolean isAnnotationPresent(JAnnotationType annotationType)
Description copied from interface: JAnnotatedElement
Returns true if a JAnnotation exists for the given JAnnotationType

Specified by:
isAnnotationPresent in interface JAnnotatedElement
Returns:
True if a JAnnotation has been added for the given JAnnotationType

addAnnotation

public void addAnnotation(JAnnotation annotation)
Description copied from interface: JAnnotatedElement
Adds a JAnnotation to this source element. An IllegalArgumentException is thrown if one already exists for the associated JAnnotationType.

Specified by:
addAnnotation in interface JAnnotatedElement

removeAnnotation

public JAnnotation removeAnnotation(JAnnotationType annotationType)
Description copied from interface: JAnnotatedElement
Removes the JAnnotation from this source element for the given JAnnotationType, throws a IllegalArgumentException if no JAnnotation has been added.

Specified by:
removeAnnotation in interface JAnnotatedElement
Returns:
The JAnnotation that was associated with this source element

hasAnnotations

public boolean hasAnnotations()
Description copied from interface: JAnnotatedElement
Returns true if annotations have been added to this source element

Specified by:
hasAnnotations in interface JAnnotatedElement
Returns:
Returns true if annotations have been added to this source element

printAnnotations

public boolean printAnnotations(JSourceWriter jsw)
Outputs the list of annotations maintained by this object

Parameters:
jsw -

main

public static void main(java.lang.String[] args)
Test

Parameters:
args -


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