@Override public String convert(TypeDeclaration declaration) throws TemplateModelException { AdapterType adapterType = AdapterUtil.findAdapterType(declaration); if (adapterType != null) { return convert(adapterType.getAdaptingType()); } if (declaration instanceof ClassDeclaration) { DecoratedTypeMirror superType = (DecoratedTypeMirror) TypeMirrorDecorator.decorate(((ClassDeclaration) declaration).getSuperclass()); if (superType != null && superType.isInstanceOf(JAXBElement.class.getName())) { //for client conversions, we're going to generalize subclasses of JAXBElement to JAXBElement return convert(superType); } } String convertedPackage = convertPackage(declaration.getPackage()); ClientName specifiedName = isUseClientNameConversions() ? declaration.getAnnotation(ClientName.class) : null; String simpleName = specifiedName == null ? declaration.getSimpleName() : specifiedName.value(); return convertedPackage + getPackageSeparator() + simpleName; } }