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

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

public abstract class ElementImpl
extends Object
implements 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
 TypeMirror asType()
           
 boolean equals(Object obj)
           
<A extends Annotation>
A
getAnnotation(Class<A> annotationClass)
           
protected abstract  AnnotationBinding[] getAnnotationBindings()
           
 List<? extends AnnotationMirror> getAnnotationMirrors()
           
 String getFileName()
          Get the project-relative path to the source file that contains this element.
 Set<Modifier> getModifiers()
           
 Name getSimpleName()
           
 int hashCode()
           
 boolean hides(Element hidden)
          Subclassed by VariableElementImpl, TypeElementImpl, and ExecutableElementImpl.
 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 TypeMirror asType()
Specified by:
asType in interface Element

getAnnotation

public <A extends Annotation> A getAnnotation(Class<A> annotationClass)
Specified by:
getAnnotation in interface Element

getAnnotationBindings

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

getAnnotationMirrors

public List<? extends AnnotationMirror> getAnnotationMirrors()
Specified by:
getAnnotationMirrors in interface Element

getModifiers

public Set<Modifier> getModifiers()
Specified by:
getModifiers in interface Element

getSimpleName

public Name getSimpleName()
Specified by:
getSimpleName in interface Element

hashCode

public int hashCode()
Specified by:
hashCode in interface Element
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Specified by:
equals in interface Element
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

getFileName

public 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(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()


Copyright © 2012. All Rights Reserved.