org.aspectj.org.eclipse.jdt.internal.compiler.apt.model
Class ElementImpl

java.lang.Object
  extended by org.aspectj.org.eclipse.jdt.internal.compiler.apt.model.ElementImpl
All Implemented Interfaces:
javax.lang.model.element.Element, IElementInfo
Direct Known Subclasses:
ExecutableElementImpl, PackageElementImpl, TypeElementImpl, TypeParameterElementImpl, VariableElementImpl

public abstract class ElementImpl
extends java.lang.Object
implements javax.lang.model.element.Element, IElementInfo

Element represents any defined Java language element - a package, a method, a class or interface. Contrast with DeclaredType.


Field Summary
 Binding _binding
           
 BaseProcessingEnvImpl _env
           
 
Constructor Summary
protected ElementImpl(BaseProcessingEnvImpl env, Binding binding)
           
 
Method Summary
 javax.lang.model.type.TypeMirror asType()
           
 boolean equals(java.lang.Object obj)
           
<A extends java.lang.annotation.Annotation>
A
getAnnotation(java.lang.Class<A> annotationClass)
           
protected abstract  AnnotationBinding[] getAnnotationBindings()
           
 java.util.List<? extends javax.lang.model.element.AnnotationMirror> getAnnotationMirrors()
           
<A extends java.lang.annotation.Annotation>
A[]
getAnnotationsByType(java.lang.Class<A> annotationType)
           
 java.lang.String getFileName()
          Get the project-relative path to the source file that contains this element.
 java.util.Set<javax.lang.model.element.Modifier> getModifiers()
           
 AnnotationBinding[] getPackedAnnotationBindings()
           
 javax.lang.model.element.Name getSimpleName()
           
 int hashCode()
           
 boolean hides(javax.lang.model.element.Element hidden)
          Subclassed by VariableElementImpl, TypeElementImpl, and ExecutableElementImpl.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.lang.model.element.Element
accept, getEnclosedElements, getEnclosingElement, getKind
 

Field Detail

_env

public final BaseProcessingEnvImpl _env

_binding

public final Binding _binding
Constructor Detail

ElementImpl

protected ElementImpl(BaseProcessingEnvImpl env,
                      Binding binding)
Method Detail

asType

public javax.lang.model.type.TypeMirror asType()
Specified by:
asType in interface javax.lang.model.element.Element

getAnnotationBindings

protected abstract AnnotationBinding[] getAnnotationBindings()
Returns:
the set of compiler annotation bindings on this element

getPackedAnnotationBindings

public final AnnotationBinding[] getPackedAnnotationBindings()

getAnnotation

public <A extends java.lang.annotation.Annotation> A getAnnotation(java.lang.Class<A> annotationClass)
Specified by:
getAnnotation in interface javax.lang.model.element.Element

getAnnotationMirrors

public java.util.List<? extends javax.lang.model.element.AnnotationMirror> getAnnotationMirrors()
Specified by:
getAnnotationMirrors in interface javax.lang.model.element.Element

getAnnotationsByType

public <A extends java.lang.annotation.Annotation> A[] getAnnotationsByType(java.lang.Class<A> annotationType)

getModifiers

public java.util.Set<javax.lang.model.element.Modifier> getModifiers()
Specified by:
getModifiers in interface javax.lang.model.element.Element

getSimpleName

public javax.lang.model.element.Name getSimpleName()
Specified by:
getSimpleName in interface javax.lang.model.element.Element

hashCode

public int hashCode()
Specified by:
hashCode in interface javax.lang.model.element.Element
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Specified by:
equals in interface javax.lang.model.element.Element
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getFileName

public java.lang.String getFileName()
Description copied from interface: IElementInfo
Get the project-relative path to the source file that contains this element. If the element is a PackageElement, the "source file" is package-info.java. If the element is not recognized or does not exist in the project for some reason, returns null.

Specified by:
getFileName in interface IElementInfo
Returns:
the project-relative path, or null.

hides

public boolean hides(javax.lang.model.element.Element hidden)
Subclassed by VariableElementImpl, TypeElementImpl, and ExecutableElementImpl. This base implementation suffices for other types.

Returns:
true if this element hides hidden
See Also:
Elements.hides(javax.lang.model.element.Element, javax.lang.model.element.Element)