public boolean isInstanceOf(String className) { if (getDeclaration() == null) { //special case: if we can't find the declaration, there's some compile error. return false; } else if (super.isInstanceOf(className)) { return true; } DecoratedClassType type = (DecoratedClassType) getSuperclass(); return (type != null) && (type.isInstanceOf(className)); }
/** * Decorates <code>typeMirror</code> and sets it as the {@link #getDecoratedTypeMirror() decorated type mirror}. * * @param typeMirror The declaration to decorate. */ public void visitClassType(ClassType typeMirror) { if (typeMirror instanceof DecoratedClassType) { this.decoratedTypeMirror = typeMirror; } else { this.decoratedTypeMirror = new DecoratedClassType(typeMirror); } }
String qualifiedName = decorated.getDeclaration().getQualifiedName(); if (decorated.getDeclaration() != null && Object.class.getName().equals(qualifiedName)) { if (!decorated.isCollection() && !decorated.isInstanceOf(JAXBElement.class.getName())) { ClassDeclaration declaration = classType.getDeclaration(); if (declaration != null) {
public void visitClassType(ClassType classType) { DecoratedClassType decorated = (DecoratedClassType) TypeMirrorDecorator.decorate(classType); if (decorated.getDeclaration() != null && Object.class.getName().equals(decorated.getDeclaration().getQualifiedName())) { //skip base object; not a type definition. return; } String qualifiedName = decorated.getDeclaration().getQualifiedName(); if (referenceStack.contains(qualifiedName)) { //we're already visiting this class... return; } referenceStack.addFirst(qualifiedName); try { if (!decorated.isCollection()) { ClassDeclaration declaration = classType.getDeclaration(); if (declaration != null) { addJsonType(JsonTypeDefinition.createTypeDefinition(declaration)); } } Collection<TypeMirror> typeArgs = classType.getActualTypeArguments(); if (typeArgs != null) { for (TypeMirror typeArg : typeArgs) { typeArg.accept(this); } } } finally { referenceStack.removeFirst(); //pop the stack. } }
if (!jresponse.getActualTypeArguments().isEmpty()) { DecoratedTypeMirror responseType = (DecoratedTypeMirror) TypeMirrorDecorator.decorate(jresponse.getActualTypeArguments().iterator().next()); if (responseType.isDeclared()) { responseType.setDocComment(returnTypeMirror.getDocComment());