Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javax.ide.model.java.source.tree
Interface AnnotationT  view AnnotationT download AnnotationT.java

All Superinterfaces:
HasNameT, Tree

public interface AnnotationT
extends Tree, HasNameT

An annotation (not to be confused with annotation type). Any declaration may be annotated, in particular, that means any T that extends HasModifiersT.

For more information, please refer to the JLS 3rd ed, section 9.7.

The first annotation variant is called a "normal" annotation. Consider:

   // Normal annotation
   RequestForEnhancement(
     id = 2868724,
     synopsis = "Provide time-travel functionality",
     engineer = "Mr. Peabody",
     date = "4/1/2004"
   )
   public static void travelThroughTime(Date destination) { ... }
 
getArguments() will return a list of four elements, each one will be an AssignmentExpressionT. The first argument will have a lhs for "id" and a rhs for "2868724".

The second annotation variant is called a "marker" annotation. Consider:

   Deprecated
   class MyClass { }
 
getArguments() will return an empty list. In particular, getArgumentList() will return a synthetic ListExpressionT.

The third annotation variant is called a "single-element" annotation. Consider:

   // Single-element annotation
   Copyright("2002 Yoyodyne Propulsion Systems, Inc., ...")
   public class OscillationOverthruster { ... } * 
getArguments() will return a list of one element. The single argument will be an expression for "2002 Yoydyne..." etc. Note: This single argument will NOT be an AssignmentExpressionT.


Field Summary
 
Fields inherited from interface javax.ide.model.java.source.tree.Tree
EMPTY_ARRAY
 
Method Summary
 ExpressionT getArgumentAt(int i)
          Gets the indicated argument.
 int getArgumentCount()
          Gets the number of arguments.
 ListExpressionT getArgumentList()
          Gets the argument list as a tree.
 java.util.List getArguments()
          Gets the arguments as a list.
 
Methods inherited from interface javax.ide.model.java.source.tree.Tree
accept, accept, addSelf, addSelf, addSelfAfter, addSelfBefore, clearProperty, cloneSelf, getChildren, getOwningFile, getParent, getPosition, getProperty, getSiblingAfter, getSiblingBefore, getSiblings, getTreeKind, isSynthetic, removeSelf, replaceSelf, setProperty
 
Methods inherited from interface javax.ide.model.java.source.tree.HasNameT
getName, getNameElement, setName, setNameElement
 

Method Detail

getArgumentList

public ListExpressionT getArgumentList()
Gets the argument list as a tree.


getArguments

public java.util.List getArguments()
Gets the arguments as a list.


getArgumentCount

public int getArgumentCount()
Gets the number of arguments. Equivalent to calling getArgumentList().getOperandCount() or getArguments().size().


getArgumentAt

public ExpressionT getArgumentAt(int i)
Gets the indicated argument. Equivalent to calling getArgumentList().getOperandAt(i) or getArguments().get(i).