org.eclipse.jdt.internal.compiler.apt.model
Class ExecutableElementImpl
java.lang.Object
org.eclipse.jdt.internal.compiler.apt.model.ElementImpl
org.eclipse.jdt.internal.compiler.apt.model.ExecutableElementImpl
- All Implemented Interfaces:
- Element, ExecutableElement, IElementInfo
public class ExecutableElementImpl
- extends ElementImpl
- implements ExecutableElement
accept
public <R,P> R accept(ElementVisitor<R,P> v,
P p)
- Specified by:
accept
in interface Element
getAnnotationBindings
protected AnnotationBinding[] getAnnotationBindings()
- Specified by:
getAnnotationBindings
in class ElementImpl
- Returns:
- the set of compiler annotation bindings on this element
getDefaultValue
public AnnotationValue getDefaultValue()
- Specified by:
getDefaultValue
in interface ExecutableElement
getEnclosedElements
public List<? extends Element> getEnclosedElements()
- Specified by:
getEnclosedElements
in interface Element
getEnclosingElement
public Element getEnclosingElement()
- Specified by:
getEnclosingElement
in interface Element
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
- Overrides:
getFileName
in class ElementImpl
- Returns:
- the project-relative path, or null.
getKind
public ElementKind getKind()
- Specified by:
getKind
in interface Element
getModifiers
public Set<Modifier> getModifiers()
- Specified by:
getModifiers
in interface Element
- Overrides:
getModifiers
in class ElementImpl
getParameters
public List<? extends VariableElement> getParameters()
- Specified by:
getParameters
in interface ExecutableElement
getReturnType
public TypeMirror getReturnType()
- Specified by:
getReturnType
in interface ExecutableElement
getSimpleName
public Name getSimpleName()
- Specified by:
getSimpleName
in interface Element
- Overrides:
getSimpleName
in class ElementImpl
getThrownTypes
public List<? extends TypeMirror> getThrownTypes()
- Specified by:
getThrownTypes
in interface ExecutableElement
getTypeParameters
public List<? extends TypeParameterElement> getTypeParameters()
- Specified by:
getTypeParameters
in interface ExecutableElement
hides
public boolean hides(Element hidden)
- Description copied from class:
ElementImpl
- Subclassed by VariableElementImpl, TypeElementImpl, and ExecutableElementImpl.
This base implementation suffices for other types.
- Overrides:
hides
in class ElementImpl
- Returns:
- true if this element hides
hidden
- See Also:
Elements#hides()
isVarArgs
public boolean isVarArgs()
- Specified by:
isVarArgs
in interface ExecutableElement
overrides
public boolean overrides(ExecutableElement overridden,
TypeElement type)
- Return true if this method overrides
overridden
in the context of type
. For
instance, consider
interface A { void f(); }
class B { void f() {} }
class C extends B implements I { }
In the context of B, B.f() does not override A.f(); they are unrelated. But in the context of
C, B.f() does override A.f(). That is, the copy of B.f() that C inherits overrides A.f().
This is equivalent to considering two questions: first, does C inherit B.f(); if so, does
the inherited C.f() override A.f(). If B.f() were private, for instance, then in the context
of C it would still not override A.f().
- See Also:
Elements.overrides(ExecutableElement, ExecutableElement, TypeElement)
Copyright © 2012. All Rights Reserved.