@Override public Optional<ResolvedReferenceTypeDeclaration> containerType() { return reflectionClassAdapter.containerType(); }
@Override public List<ResolvedFieldDeclaration> getAllFields() { return reflectionClassAdapter.getAllFields(); }
@Override public List<ResolvedReferenceType> getAncestors(boolean acceptIncompleteList) { // we do not attempt to perform any symbol solving when analyzing ancestors in the reflection model, so we can // simply ignore the boolean parameter here; an UnsolvedSymbolException cannot occur return reflectionClassAdapter.getAncestors(); }
public List<ResolvedReferenceType> getAncestors() { List<ResolvedReferenceType> ancestors = new LinkedList<>(); if (getSuperClass() != null) { ReferenceTypeImpl superClass = getSuperClass(); ancestors.add(superClass); } else { ReferenceTypeImpl object = new ReferenceTypeImpl(new ReflectionClassDeclaration(Object.class, typeSolver), typeSolver); ancestors.add(object); } ancestors.addAll(getInterfaces()); for (int i = 0; i < ancestors.size(); i++) { ResolvedReferenceType ancestor = ancestors.get(i); if (ancestor.hasName() && ancestor.getQualifiedName().equals(Object.class.getCanonicalName())) { ancestors.remove(i); i--; } } return ancestors; }
public ReflectionAnnotationDeclaration(Class<?> clazz, TypeSolver typeSolver) { if (!clazz.isAnnotation()) { throw new IllegalArgumentException("The given type is not an annotation."); } this.clazz = clazz; this.typeSolver = typeSolver; this.reflectionClassAdapter = new ReflectionClassAdapter(clazz, typeSolver, this); }
@Override public List<ResolvedTypeParameterDeclaration> getTypeParameters() { return reflectionClassAdapter.getTypeParameters(); }
@Override public Set<ResolvedMethodDeclaration> getDeclaredMethods() { return reflectionClassAdapter.getDeclaredMethods(); }
@Override public ResolvedFieldDeclaration getField(String name) { return reflectionClassAdapter.getField(name); }
@Override public ReferenceTypeImpl getSuperClass() { return reflectionClassAdapter.getSuperClass(); }
@Override public List<ResolvedConstructorDeclaration> getConstructors() { return reflectionClassAdapter.getConstructors(); } }
@Override public List<ResolvedReferenceType> getInterfaces() { return reflectionClassAdapter.getInterfaces(); }
public List<ResolvedReferenceType> getAncestors() { List<ResolvedReferenceType> ancestors = new LinkedList<>(); if (getSuperClass() != null) { ReferenceTypeImpl superClass = getSuperClass(); ancestors.add(superClass); } else { ReferenceTypeImpl object = new ReferenceTypeImpl(new ReflectionClassDeclaration(Object.class, typeSolver), typeSolver); ancestors.add(object); } ancestors.addAll(getInterfaces()); for (int i = 0; i < ancestors.size(); i++) { ResolvedReferenceType ancestor = ancestors.get(i); if (ancestor.hasName() && ancestor.getQualifiedName().equals(Object.class.getCanonicalName())) { ancestors.remove(i); i--; } } return ancestors; }
public ReflectionInterfaceDeclaration(Class<?> clazz, TypeSolver typeSolver) { if (!clazz.isInterface()) { throw new IllegalArgumentException(); } this.clazz = clazz; this.typeSolver = typeSolver; this.reflectionClassAdapter = new ReflectionClassAdapter(clazz, typeSolver, this); }
@Override public List<ResolvedTypeParameterDeclaration> getTypeParameters() { return reflectionClassAdapter.getTypeParameters(); }
@Override public Set<ResolvedMethodDeclaration> getDeclaredMethods() { return reflectionClassAdapter.getDeclaredMethods(); }
@Override public ResolvedFieldDeclaration getField(String name) { return reflectionClassAdapter.getField(name); }
@Override public ReferenceTypeImpl getSuperClass() { return reflectionClassAdapter.getSuperClass(); }
@Override public List<ResolvedConstructorDeclaration> getConstructors() { return reflectionClassAdapter.getConstructors(); }
@Override public List<ResolvedReferenceType> getInterfaces() { return reflectionClassAdapter.getInterfaces(); }
public List<ResolvedReferenceType> getAncestors() { List<ResolvedReferenceType> ancestors = new LinkedList<>(); if (getSuperClass() != null) { ReferenceTypeImpl superClass = getSuperClass(); ancestors.add(superClass); } else { ReferenceTypeImpl object = new ReferenceTypeImpl(new ReflectionClassDeclaration(Object.class, typeSolver), typeSolver); ancestors.add(object); } ancestors.addAll(getInterfaces()); for (int i = 0; i < ancestors.size(); i++) { ResolvedReferenceType ancestor = ancestors.get(i); if (ancestor.hasName() && ancestor.getQualifiedName().equals(Object.class.getCanonicalName())) { ancestors.remove(i); i--; } } return ancestors; }