@Override public boolean isBaseObject() { TypeMirror superclass = getSuperclass(); if (superclass == null || superclass.getKind() == TypeKind.NONE) { return true; } TypeElement superDeclaration = (TypeElement) this.env.getTypeUtils().asElement(superclass); return superDeclaration == null || Object.class.getName().equals(superDeclaration.getQualifiedName().toString()) || this.context.isCollapseTypeHierarchy() || this.context.isIgnored(superDeclaration); }
public JsonType getSupertype() { TypeMirror superclass = getSuperclass(); if (superclass == null || superclass.getKind() == TypeKind.NONE) { return null; } else if (superclass instanceof DeclaredType && (((TypeElement)((DeclaredType)superclass).asElement()).getQualifiedName().toString().equals(Object.class.getName()) || context.isIgnored((((DeclaredType)superclass).asElement())) || context.isCollapseTypeHierarchy())) { return null; } else { return JsonTypeFactory.getJsonType(superclass, this.context); } }
@Override public boolean isBaseObject() { TypeMirror superclass = getSuperclass(); if (superclass == null || superclass.getKind() == TypeKind.NONE) { return true; } TypeElement superDeclaration = (TypeElement) this.env.getTypeUtils().asElement(superclass); return superDeclaration == null || Object.class.getName().equals(superDeclaration.getQualifiedName().toString()) || this.context.isCollapseTypeHierarchy() || this.context.isIgnored(superDeclaration); }
public JsonType getSupertype() { TypeMirror superclass = getSuperclass(); if (superclass == null || superclass.getKind() == TypeKind.NONE) { return null; } else if (superclass instanceof DeclaredType && (((TypeElement)((DeclaredType)superclass).asElement()).getQualifiedName().toString().equals(Object.class.getName()) || context.isIgnored((((DeclaredType)superclass).asElement())) || context.isCollapseTypeHierarchy())) { return null; } else { return JsonTypeFactory.getJsonType(superclass, this.context); } }
/** * Whether the given method declaration overrides any method. * * @param method The method declaration. * @param filter The filter to use for the candidates * @return Whether the given method declaration overrides any method. */ private boolean overridesAnother(DecoratedExecutableElement method, AccessorFilter filter) { if (method == null) { return false; } if (this.context.isCollapseTypeHierarchy()) { return false; //if we're collapsing type hierarchy, ignore supertypes. } final TypeElement declaringType = (TypeElement) method.getEnclosingElement(); TypeElement superType = (TypeElement) this.env.getTypeUtils().asElement(declaringType.getSuperclass()); if (superType != null && !this.context.isIgnored(superType)) { while (superType != null && !Object.class.getName().equals(superType.getQualifiedName().toString())) { List<ExecutableElement> methods = ElementFilter.methodsIn(superType.getEnclosedElements()); for (ExecutableElement candidate : methods) { if (this.env.getElementUtils().overrides(method, candidate, declaringType)) { return filter.accept((DecoratedElement) candidate); } } superType = (TypeElement) this.env.getTypeUtils().asElement(superType.getSuperclass()); } } return false; }
/** * Whether the given method declaration overrides any method. * * @param method The method declaration. * @param filter The filter to use for the candidates * @return Whether the given method declaration overrides any method. */ private boolean overridesAnother(DecoratedExecutableElement method, AccessorFilter filter) { if (method == null) { return false; } if (this.context.isCollapseTypeHierarchy()) { return false; //if we're collapsing type hierarchy, ignore supertypes. } final TypeElement declaringType = (TypeElement) method.getEnclosingElement(); TypeElement superType = (TypeElement) this.env.getTypeUtils().asElement(declaringType.getSuperclass()); if (superType != null && !this.context.isIgnored(superType)) { while (superType != null && !Object.class.getName().equals(superType.getQualifiedName().toString())) { List<ExecutableElement> methods = ElementFilter.methodsIn(superType.getEnclosedElements()); for (ExecutableElement candidate : methods) { if (this.env.getElementUtils().overrides(method, candidate, declaringType)) { return filter.accept((DecoratedElement) candidate); } } superType = (TypeElement) this.env.getTypeUtils().asElement(superType.getSuperclass()); } } return false; }
/** * Load the potential accessors for this type definition. * * @param filter The filter. * @return the potential accessors for this type definition. */ protected AccessorBag loadPotentialAccessors(AccessorFilter filter) { if (getKind() == ElementKind.ENUM) { return new AccessorBag(); // ignore properties if enum } AccessorBag bag = new AccessorBag(); aggregatePotentialAccessors(bag, this, filter, this.context.isCollapseTypeHierarchy()); return bag; }
/** * Load the potential accessors for this type definition. * * @param filter The filter. * @return the potential accessors for this type definition. */ protected AccessorBag loadPotentialAccessors(AccessorFilter filter) { if (getKind() == ElementKind.ENUM) { return new AccessorBag(); // ignore properties if enum } AccessorBag bag = new AccessorBag(); aggregatePotentialAccessors(bag, this, filter, this.context.isCollapseTypeHierarchy()); return bag; }
if (!typeDef.isBaseObject() && superclass != null && superclass.getKind() != TypeKind.NONE && !isCollapseTypeHierarchy()) { addReferencedTypeDefinitions(superclass, stack);
if (!typeDef.isBaseObject() && superclass != null && superclass.getKind() != TypeKind.NONE && !isCollapseTypeHierarchy()) { addReferencedTypeDefinitions(superclass, stack);