- 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.
| Fields inherited from interface javax.ide.model.java.source.tree.Tree |
EMPTY_ARRAY |
| 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 |
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).