public class ElementsExtensions extends Object
| Modifier and Type | Field and Description |
|---|---|
String |
ORDER_ANNOTATION_NAME |
String |
PARAM_NAMES_ANNOTATION_NAME |
static Set<Modifier> |
VISIBILITY_MODIFIERS |
| Constructor and Description |
|---|
ElementsExtensions() |
public final String ORDER_ANNOTATION_NAME
public final String PARAM_NAMES_ANNOTATION_NAME
public boolean hasType(Element e, TypeMirror type)
protected TypeMirror _srcType(VariableElement e)
protected TypeMirror _srcType(ExecutableElement e)
protected TypeMirror _srcType(Element e)
protected TypeMirror _srcType(TypeMirror t)
protected TypeMirror _srcType(Object o)
public List<VariableElement> declaredFields(TypeElement type)
public List<ExecutableElement> declaredMethods(TypeElement type)
public List<ExecutableElement> declaredConstructors(TypeElement type)
public List<TypeElement> declaredTypes(TypeElement type)
public List<? extends Element> enclosedElementsOrdered(TypeElement type)
public List<VariableElement> allFields(TypeElement type)
public List<ExecutableElement> allMethods(TypeElement type)
public boolean notDeclaredBy(Element e, CharSequence name)
public boolean notDeclaredBy(Element e, TypeElement type)
public List<ExecutableElement> allMethods(TypeElement type, String stopSuperclass)
TODO: Check, if private methods of superclass are included and fix it.
public List<? extends VariableElement> parametersWithSrcNames(ExecutableElement e)
public boolean overrides(ExecutableElement m1, ExecutableElement m2)
public boolean isSubSignature(ExecutableElement m1, ExecutableElement m2)
public boolean isOverrideEquivalent(ExecutableElement m1, ExecutableElement m2)
public Iterable<TypeElement> typeElements(Iterable<? extends Element> elements)
public <T> T findFirstInTypeAndSuperclasses(TypeElement typeElement, String stopSuperclass, org.eclipse.xtext.xbase.lib.Functions.Function1<? super TypeElement,? extends T> query)
public <T> List<T> collectInTypeAndSuperclasses(TypeElement typeElement, String stopSuperclass, org.eclipse.xtext.xbase.lib.Functions.Function2<? super T,? super T,? extends Boolean> isDuplicate, org.eclipse.xtext.xbase.lib.Functions.Function1<? super TypeElement,? extends List<T>> query)
public AnnotationMirror annotationMirror(Element annotatedElement, CharSequence annotationFqn)
type - the annotated elementannotationFqn - the qualified name of the annotation classpublic AnnotationMirror annotationMirror(Element annotatedElement, Class<? extends Annotation> annotationClass)
type - the annotated elementannotationClass - the annotation classpublic List<AnnotationMirror> annotationMirrors(Element annotatedElement, Class<? extends Annotation> annotationClass)
public List<AnnotationMirror> annotationMirrors(Element annotatedElement, CharSequence annotationFqn)
public boolean hasMetaAnnotation(AnnotationMirror am, CharSequence metaAnnotationFqn)
public List<? extends AnnotationMirror> metaAnnotations(AnnotationMirror annotationMirror)
public AnnotationMirror metaAnnotation(AnnotationMirror annotationMirror, CharSequence metaAnnotationFqn)
public List<AnnotationMirror> metaAnnotations(AnnotationMirror annotationMirror, CharSequence metaAnnotationFqn)
public AnnotationMirror metaAnnotation(AnnotationMirror annotationMirror, Class<? extends Annotation> annotationClass)
public List<AnnotationMirror> metaAnnotations(AnnotationMirror annotationMirror, Class<? extends Annotation> annotationClass)
public String fqn(AnnotationMirror annotationMirror)
public TypeElement annotationAsTypeElement(AnnotationMirror annotationMirror)
public boolean hasFqn(AnnotationMirror annotationMirror, CharSequence annotationFqn)
public boolean hasFqn(QualifiedNameable element, CharSequence fqn)
public void clearCaches()
public ExecutableElement getAVMethod(AnnotationMirror annotationMirror, String name)
public Object getValueWithErrorHandling(AnnotationValue av)
public Set<Name> annotationValueNames(AnnotationMirror annotationMirror)
public <T> T value(AnnotationMirror annotationMirror, Element annotatedElement, CharSequence name, Class<T> avType, boolean isRequired)
public boolean isNullOrEmptyAV(Object value)
protected boolean _isEmptyAV(String s)
protected boolean _isEmptyAV(Object o)
public CharSequence getPrefixedAvName(AnnotationMirror metaAnnotation, CharSequence name)
public <T> T value(AnnotationMirror annotationMirror, Element annotatedElement, CharSequence name, Class<T> avType)
public <T> T value(AnnotationMirror annotationMirror, CharSequence name, Class<T> avType)
public <T> T requiredValue(AnnotationMirror annotationMirror, Element annotatedElement, CharSequence name, Class<T> avType)
public org.eclipse.xtext.xbase.lib.Functions.Function1<String,org.eclipse.xtext.xbase.lib.Functions.Function1<CharSequence,Object>> annotationsByName(Element e, String packageForShortNames)
public Map<String,Object> annotationValuesByNameUnwrappedAsMap(AnnotationMirror am)
public org.eclipse.xtext.xbase.lib.Functions.Function1<CharSequence,Object> annotationValuesByNameUnwrapped(AnnotationMirror am)
protected Class<?> _toAnnotationValueClass(PrimitiveType type)
protected Class<?> _toAnnotationValueClass(DeclaredType type)
protected Object _toAnnotationValue(PrimitiveType type, String s)
public Object coerceAnnotationValue(Object value, TypeMirror avType)
protected Object _coerceSingleValue(Iterable<?> value, TypeMirror avType)
protected Object _coerceSingleValue(Object value, TypeMirror avType)
protected Object _coerceSingleValue(Void value, TypeMirror avType)
protected Object _toAnnotationValue(DeclaredType avType, Object o)
protected Object _toAnnotationValue(PrimitiveType type, Object o)
protected Object _toAnnotationValue(TypeMirror type, Object o)
public static RuleException unsupportedAVType(TypeMirror type, Object o)
public boolean isAbstract(Element e)
public boolean isAbstractOrInInterface(Element e)
public boolean isStatic(Element e)
public boolean isPublic(Element e)
public boolean isProtected(Element e)
public boolean isPrivate(Element e)
public boolean isDefaultAccess(Element e)
protected PackageElement _getPackage(Element e)
protected PackageElement _getPackage(PackageElement e)
protected PackageElement _getPackage(Void e)
public List<String> getParamNamesFromRuntimeMetadata(Element element)
public org.eclipse.xtext.xbase.lib.Functions.Function1<? super Element,? extends Integer> getOrderFromRuntimeMetadata(Element someParent)
public boolean loadRuntimeMetadata(Element element)
public void loadCommentsAndParamNames(TypeElement runtimeMetadataTypeElement)
protected TypeElement _getTopLevelEnclosingTypeElement(TypeElement e)
protected TypeElement _getTopLevelEnclosingTypeElement(Element e)
public List<? extends AnnotationMirror> getAllAnnotationMirrors(Element e)
public List<? extends Element> getAllMembers(TypeElement type)
public Name getBinaryName(TypeElement type)
protected Map<? extends ExecutableElement,? extends AnnotationValue> _getElementValuesWithDefaults(AnnotationWithDefaultAnnotation a)
protected Map<? extends ExecutableElement,? extends AnnotationValue> _getElementValuesWithDefaults(GenAnnotationMirror am)
protected Map<? extends ExecutableElement,? extends AnnotationValue> _getElementValuesWithDefaults(AnnotationWrapper annotationWrapper)
protected Map<? extends ExecutableElement,? extends AnnotationValue> _getElementValuesWithDefaults(AnnotationMirror a)
public Name getName(CharSequence cs)
public PackageElement getPackageElement(CharSequence name)
public PackageElement getPackageOf(Element type)
public TypeElement getTypeElement(CharSequence name)
public boolean isDeprecated(Element e)
public boolean overrides(ExecutableElement overrider, ExecutableElement overridden, TypeElement type)
protected CharSequence _uniqueSimpleName(ExecutableElement e)
protected CharSequence _uniqueSimpleName(Element e)
protected String _uniqueName(QualifiedNameable e)
public String uniqueNameWithin(Element e, TypeElement enclosing)
public String uniqueNameWithinTopLevelEnclosingTypeElement(Element element)
public Iterable<? extends Element> elementAndAllEnclosedElements(Element e)
public Iterable<? extends Element> elementAndAllEnclosedElements(Element e, boolean withMethodParams)
protected boolean _isEmptyVar(String string)
protected boolean _isEmptyVar(CharSequence cs)
protected boolean _isEmptyVar(Collection<?> c)
protected boolean _isEmptyVar(Map<?,?> m)
protected boolean _isEmptyVar(Iterable<?> i)
protected boolean _isEmptyVar(Object object)
public TypeMirror srcType(Object e)
public boolean isEmptyAV(Object s)
public Class<?> toAnnotationValueClass(TypeMirror type)
public Object toAnnotationValue(TypeMirror avType, Object o)
public Object coerceSingleValue(Object value, TypeMirror avType)
public PackageElement getPackage(Element e)
public TypeElement getTopLevelEnclosingTypeElement(Element e)
public Map<? extends ExecutableElement,? extends AnnotationValue> getElementValuesWithDefaults(AnnotationMirror a)
public CharSequence uniqueSimpleName(Element e)
public boolean isEmptyVar(Object string)
Copyright © 2018. All rights reserved.