public class PreAnnotation extends Declaration
Annotatable interface instead.| Modifier and Type | Field and Description |
|---|---|
static java.lang.reflect.Method |
print_as_comment_method
Useful for passing to setPrintMethod or setClassPrintMethod.
|
static java.lang.reflect.Method |
print_as_pragma_method
Useful for passing to setPrintMethod or setClassPrintMethod.
|
static java.lang.reflect.Method |
print_raw_method
Useful for passing to setPrintMethod or setClassPrintMethod.
|
| Constructor and Description |
|---|
PreAnnotation()
Creates an empty annotation.
|
PreAnnotation(java.lang.String text)
Creates a text annotation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(java.lang.Object key,
java.lang.Object value) |
static void |
defaultPrint(PreAnnotation a,
java.io.PrintWriter o)
Prints an annotation to a stream.
|
boolean |
equals(java.lang.Object o)
Checks if the declaration is equal to the given object.
|
java.util.List<IDExpression> |
getDeclaredIDs()
Returns a list of name ID introduced by this declaration.
|
java.util.Map |
getMap()
Provides access to the annotation map.
|
java.lang.String |
getText() |
int |
hashCode()
Returns the hash code of the declaration.
|
static void |
printAsComment(PreAnnotation a,
java.io.PrintWriter o)
Prints an annotation as a multi-line comment.
|
static void |
printAsPragma(PreAnnotation a,
java.io.PrintWriter o)
Prints an annotation as a single-line pragma.
|
static void |
printRaw(PreAnnotation a,
java.io.PrintWriter o)
Prints an annotation's contents without enclosing them in comments.
|
void |
setChild(int index,
Traversable t)
Unsupported - this object has no children.
|
static void |
setClassPrintMethod(java.lang.reflect.Method m)
Overrides the class print method, so that all subsequently
created objects will use the supplied method.
|
void |
setText(java.lang.String text)
Sets the text of the annotation.
|
annotate, annotateAfter, annotateBefore, clone, containsAnnotation, detach, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getChildren, getParent, print, removeAnnotations, removeAnnotations, removeChild, setParent, setPrintMethod, setSemiColon, toString, verifypublic static final java.lang.reflect.Method print_as_comment_method
public static final java.lang.reflect.Method print_as_pragma_method
public static final java.lang.reflect.Method print_raw_method
public PreAnnotation()
public PreAnnotation(java.lang.String text)
text - The text to be used as a comment or pragma.public void add(java.lang.Object key,
java.lang.Object value)
public static void defaultPrint(PreAnnotation a, java.io.PrintWriter o)
a - The annotation to print.o - The writer on which to print the annotation.public boolean equals(java.lang.Object o)
Declarationequals in class Declarationo - the object to be compared.o == this.public java.util.List<IDExpression> getDeclaredIDs()
DeclarationgetDeclaredIDs in class Declarationpublic java.util.Map getMap()
public java.lang.String getText()
public int hashCode()
DeclarationhashCode in class Declarationpublic static void printAsComment(PreAnnotation a, java.io.PrintWriter o)
a - The annotation to print.o - The writer on which to print the annotation.public static void printAsPragma(PreAnnotation a, java.io.PrintWriter o)
a - The annotation to print.o - The writer on which to print the annotation.public static void printRaw(PreAnnotation a, java.io.PrintWriter o)
a - The annotation to print.o - The writer on which to print the annotation.public void setChild(int index,
Traversable t)
setChild in interface TraversablesetChild in class Declarationpublic static void setClassPrintMethod(java.lang.reflect.Method m)
m - The new print method.public void setText(java.lang.String text)
text - The text to be used as a comment or pragma.