Element
.@Deprecated public interface Declaration
Declarations should be compared using the equals(Object)
method. There is no guarantee that any particular declaration will
always be represented by the same object.
Declarations
,
TypeMirror
Modifier and Type | Method and Description |
---|---|
void |
accept(DeclarationVisitor v)
Deprecated.
Applies a visitor to this declaration.
|
boolean |
equals(Object obj)
Deprecated.
Tests whether an object represents the same declaration as this.
|
<A extends Annotation> |
getAnnotation(Class<A> annotationType)
Deprecated.
Returns the annotation of this declaration having the specified
type.
|
Collection<AnnotationMirror> |
getAnnotationMirrors()
Deprecated.
Returns the annotations that are directly present on this declaration.
|
String |
getDocComment()
Deprecated.
Returns the text of the documentation ("javadoc") comment of
this declaration.
|
Collection<Modifier> |
getModifiers()
Deprecated.
Returns the modifiers of this declaration, excluding annotations.
|
SourcePosition |
getPosition()
Deprecated.
Returns the source position of the beginning of this declaration.
|
String |
getSimpleName()
Deprecated.
Returns the simple (unqualified) name of this declaration.
|
boolean equals(Object obj)
equals
in class Object
obj
- the object to be compared with this declarationObject.hashCode()
,
HashMap
String getDocComment()
Collection<AnnotationMirror> getAnnotationMirrors()
<A extends Annotation> A getAnnotation(Class<A> annotationType)
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.
A
- the annotation typeannotationType
- the Class object corresponding to
the annotation typegetAnnotationMirrors()
Collection<Modifier> getModifiers()
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.SourcePosition getPosition()
This source position is intended for use in providing diagnostics, and indicates only approximately where a declaration begins.
void accept(DeclarationVisitor v)
v
- the visitor operating on this declaration
Copyright © 2004, 2015, Oracle and/or its affiliates. All rights reserved.