@Override public Element asElement() { // The JDT compiler does not distinguish between type elements and declared types return _env.getFactory().newElement((ReferenceBinding)_binding, _elementKindHint); }
@Override public Element newElement(Binding binding, ElementKind kindHint) { observeType(binding); return super.newElement(binding, kindHint); }
@Override public Element asElement() { // The JDT compiler does not distinguish between type elements and declared types return _env.getFactory().newElement((ReferenceBinding)_binding, _elementKindHint); }
@Override public Element getEnclosingElement() { MethodBinding binding = (MethodBinding)_binding; if (null == binding.declaringClass) { return null; } return _env.getFactory().newElement(binding.declaringClass); }
@Override public Element getEnclosingElement() { MethodBinding binding = (MethodBinding)_binding; if (null == binding.declaringClass) { return null; } return _env.getFactory().newElement(binding.declaringClass); }
@Override public Element getEnclosingElement() { if (_binding instanceof FieldBinding) { return _env.getFactory().newElement(((FieldBinding)_binding).declaringClass); } else if (_binding instanceof AptSourceLocalVariableBinding){ return _env.getFactory().newElement(((AptSourceLocalVariableBinding) _binding).methodBinding); } else if (_binding instanceof AptBinaryLocalVariableBinding) { return _env.getFactory().newElement(((AptBinaryLocalVariableBinding) _binding).methodBinding); } return null; }
@Override public Element getEnclosingElement() { if (_binding instanceof FieldBinding) { return _env.getFactory().newElement(((FieldBinding)_binding).declaringClass); } else if (_binding instanceof AptSourceLocalVariableBinding){ return _env.getFactory().newElement(((AptSourceLocalVariableBinding) _binding).methodBinding); } else if (_binding instanceof AptBinaryLocalVariableBinding) { return _env.getFactory().newElement(((AptBinaryLocalVariableBinding) _binding).methodBinding); } return null; }
@Override public Element getEnclosingElement() { if (_binding instanceof FieldBinding) { return _env.getFactory().newElement(((FieldBinding)_binding).declaringClass); } else if (_binding instanceof AptSourceLocalVariableBinding){ return _env.getFactory().newElement(((AptSourceLocalVariableBinding) _binding).methodBinding); } else if (_binding instanceof AptBinaryLocalVariableBinding) { return _env.getFactory().newElement(((AptBinaryLocalVariableBinding) _binding).methodBinding); } return null; }
@Override public Element getEnclosingElement() { MethodBinding binding = (MethodBinding)_binding; if (null == binding.declaringClass) { return null; } return _env.getFactory().newElement(binding.declaringClass); }
@Override public Element asElement() { TypeBinding prototype = null; if (_binding instanceof TypeBinding) { prototype = ((TypeBinding) _binding).prototype(); } if (prototype != null) { return _env.getFactory().newElement(prototype, _elementKindHint); } // The JDT compiler does not distinguish between type elements and declared types return _env.getFactory().newElement((ReferenceBinding)_binding, _elementKindHint); }
@Override public Element asElement(TypeMirror t) { switch(t.getKind()) { case DECLARED : case TYPEVAR : return _env.getFactory().newElement(((TypeMirrorImpl)t).binding()); default: break; } return null; }
@Override public TypeElement boxedClass(PrimitiveType p) { PrimitiveTypeImpl primitiveTypeImpl = (PrimitiveTypeImpl) p; BaseTypeBinding baseTypeBinding = (BaseTypeBinding)primitiveTypeImpl._binding; TypeBinding boxed = _env.getLookupEnvironment().computeBoxingType(baseTypeBinding); return (TypeElement) _env.getFactory().newElement(boxed); }
@Override public TypeElement boxedClass(PrimitiveType p) { PrimitiveTypeImpl primitiveTypeImpl = (PrimitiveTypeImpl) p; BaseTypeBinding baseTypeBinding = (BaseTypeBinding)primitiveTypeImpl._binding; TypeBinding boxed = _env.getLookupEnvironment().computeBoxingType(baseTypeBinding); return (TypeElement) _env.getFactory().newElement(boxed); }
@Override public TypeElement boxedClass(PrimitiveType p) { PrimitiveTypeImpl primitiveTypeImpl = (PrimitiveTypeImpl) p; BaseTypeBinding baseTypeBinding = (BaseTypeBinding)primitiveTypeImpl._binding; TypeBinding boxed = _env.getLookupEnvironment().computeBoxingType(baseTypeBinding); return (TypeElement) _env.getFactory().newElement(boxed); }
@Override public <A extends Annotation> A getAnnotation(Class<A> annotationClass) { A annotation = _env.getFactory().getAnnotation(getPackedAnnotationBindings(), annotationClass); if (annotation != null || this.getKind() != ElementKind.CLASS || annotationClass.getAnnotation(Inherited.class) == null) return annotation; ElementImpl superClass = (ElementImpl) _env.getFactory().newElement(((ReferenceBinding) this._binding).superclass()); return superClass == null ? null : superClass.getAnnotation(annotationClass); }
@Override public Element getEnclosingElement() { ReferenceBinding binding = (ReferenceBinding)_binding; ReferenceBinding enclosingType = binding.enclosingType(); if (null == enclosingType) { // this is a top level type; get its package return _env.getFactory().newPackageElement(binding.fPackage); } else { return _env.getFactory().newElement(binding.enclosingType()); } }
@Override public Element getEnclosingElement() { ReferenceBinding binding = (ReferenceBinding)_binding; ReferenceBinding enclosingType = binding.enclosingType(); if (null == enclosingType) { // this is a top level type; get its package return _env.getFactory().newPackageElement(binding.fPackage); } else { return _env.getFactory().newElement(binding.enclosingType()); } }
@Override public Element getEnclosingElement() { ReferenceBinding binding = (ReferenceBinding)_binding; ReferenceBinding enclosingType = binding.enclosingType(); if (null == enclosingType) { // this is a top level type; get its package return _env.getFactory().newPackageElement(binding.fPackage); } else { return _env.getFactory().newElement(binding.enclosingType()); } }
public <A extends Annotation> A[] getAnnotationsByType(Class<A> annotationType) { A [] annotations = _env.getFactory().getAnnotationsByType(Factory.getUnpackedAnnotationBindings(getPackedAnnotationBindings()), annotationType); if (annotations.length != 0 || this.getKind() != ElementKind.CLASS || annotationType.getAnnotation(Inherited.class) == null) return annotations; ElementImpl superClass = (ElementImpl) _env.getFactory().newElement(((ReferenceBinding) this._binding).superclass()); return superClass == null ? annotations : superClass.getAnnotationsByType(annotationType); }
public <A extends Annotation> A[] getAnnotationsByType(Class<A> annotationType) { A [] annotations = _env.getFactory().getAnnotationsByType(Factory.getUnpackedAnnotationBindings(getPackedAnnotationBindings()), annotationType); if (annotations.length != 0 || this.getKind() != ElementKind.CLASS || annotationType.getAnnotation(Inherited.class) == null) return annotations; ElementImpl superClass = (ElementImpl) _env.getFactory().newElement(((ReferenceBinding) this._binding).superclass()); return superClass == null ? annotations : superClass.getAnnotationsByType(annotationType); }