|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.tools.apt.mirror.declaration.DeclarationImpl
public abstract class DeclarationImpl
Implementation of Declaration
| Field Summary | |
|---|---|
protected AptEnv |
env
|
protected static DeclarationFilter |
identityFilter
|
private java.util.Collection<Symbol> |
members
|
private java.util.EnumSet<Modifier> |
modifiers
|
Symbol |
sym
|
| Constructor Summary | |
|---|---|
protected |
DeclarationImpl(AptEnv env,
Symbol sym)
"sym" should be completed before this constructor is called. |
| Method Summary | ||
|---|---|---|
void |
accept(DeclarationVisitor v)
Applies a visitor to this declaration. |
|
boolean |
equals(java.lang.Object obj)
Tests whether an object represents the same declaration as this. |
|
|
getAnnotation(java.lang.Class<A> annoType)
Returns the annotation of this declaration having the specified type. Overridden by ClassDeclarationImpl to handle @Inherited. |
|
protected
|
getAnnotation(java.lang.Class<A> annoType,
Symbol annotated)
|
|
java.util.Collection<AnnotationMirror> |
getAnnotationMirrors()
Returns the annotations that are directly present on this declaration. |
|
java.lang.String |
getDocComment()
Returns the text of the documentation ("javadoc") comment of this declaration. |
|
private Env<AttrContext> |
getEnterEnv()
Returns this declaration's enter environment, or null if it has none. |
|
protected java.util.Collection<Symbol> |
getMembers(boolean cache)
Returns the symbols of type or package members (and constructors) that are not synthetic or otherwise unwanted. |
|
java.util.Collection<Modifier> |
getModifiers()
Returns the modifiers of this declaration, excluding annotations. |
|
SourcePosition |
getPosition()
Returns the source position of the beginning of this declaration. |
|
java.lang.String |
getSimpleName()
Returns the simple (unqualified) name of this declaration. Overridden in some subclasses. |
|
int |
hashCode()
|
|
private static boolean |
unwanted(Symbol s)
Tests whether this is a symbol that should never be seen by clients, such as a synthetic class. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final AptEnv env
public final Symbol sym
protected static DeclarationFilter identityFilter
private java.util.EnumSet<Modifier> modifiers
private java.util.Collection<Symbol> members
| Constructor Detail |
|---|
protected DeclarationImpl(AptEnv env,
Symbol sym)
| Method Detail |
|---|
public boolean equals(java.lang.Object obj)
ParameterDeclarationImpl overrides this implementation.
equals in interface Declarationequals in class java.lang.Objectobj - the object to be compared with this declaration
public int hashCode()
ParameterDeclarationImpl overrides this implementation.
hashCode in class java.lang.Objectpublic java.lang.String getDocComment()
getDocComment in interface Declarationpublic java.util.Collection<AnnotationMirror> getAnnotationMirrors()
getAnnotationMirrors in interface Declarationpublic <A extends java.lang.annotation.Annotation> A getAnnotation(java.lang.Class<A> annoType)
The annotation returned by this method could contain an element
whose value is of type Class.
This value cannot be returned directly: information necessary to
locate and load a class (such as the class loader to use) is
not available, and the class might not be loadable at all.
Attempting to read a Class object by invoking the relevant
method on the returned annotation
will result in a MirroredTypeException,
from which the corresponding TypeMirror may be extracted.
Similarly, attempting to read a Class[]-valued element
will result in a MirroredTypesException.
Note: This method is unlike others in this and related interfaces. It operates on run-time reflective information -- representations of annotation types currently loaded into the VM -- rather than on the mirrored representations defined by and used throughout these interfaces. It is intended for callers that are written to operate on a known, fixed set of annotation types.Overridden by ClassDeclarationImpl to handle @Inherited.
getAnnotation in interface DeclarationA - the annotation typeannoType - the Class object corresponding to
the annotation type
Declaration.getAnnotationMirrors()
protected <A extends java.lang.annotation.Annotation> A getAnnotation(java.lang.Class<A> annoType,
Symbol annotated)
public java.util.Collection<Modifier> getModifiers()
getModifiers in interface Declarationpublic java.lang.String getSimpleName()
java.util.Set<E> is "Set".
If this declaration represents the empty package, an empty
string is returned.
If it represents a constructor, the simple name of its
declaring class is returned.
Overridden in some subclasses.
getSimpleName in interface Declarationpublic SourcePosition getPosition()
This source position is intended for use in providing diagnostics, and indicates only approximately where a declaration begins.
getPosition in interface Declarationpublic void accept(DeclarationVisitor v)
accept in interface Declarationv - the visitor operating on this declarationprotected java.util.Collection<Symbol> getMembers(boolean cache)
private static boolean unwanted(Symbol s)
private Env<AttrContext> getEnterEnv()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||