CachingDeclaredType(DeclaredType delegate) { this.delegate = delegate; this.kind = delegate.getKind(); this.element = new CachingTypeElement((TypeElement) delegate.asElement()); }
@Override public TypeKind getKind() { return this.originalType.getKind(); }
@Override public TypeKind getKind() { return this.originalType.getKind(); }
@Override public TypeKind getKind() { return this.originalType.getKind(); }
@Override public TypeKind getKind() { return this.originalType.getKind(); }
@Override public TypeKind getKind() { return this.originalType.getKind(); }
@Override public TypeKind getKind() { return this.originalType.getKind(); }
public static Stream<AnnotationMirrorWrapper> wrapAll(ProcessingEnvironmentWrapper processingEnv, Element element) { return element.getAnnotationMirrors() .stream() .map(annotation -> { DeclaredType type = annotation.getAnnotationType(); if (TypeKind.ERROR.equals(type.getKind())) { throw new CodeGenerationIncompleteException(); } return annotation; }) .map(mirror -> AnnotationMirrorWrapper.wrapperOf(processingEnv, mirror)); }
public static Stream<AnnotationMirrorWrapper> wrapAll(ProcessingEnvironmentWrapper processingEnv, Element element) { return element.getAnnotationMirrors() .stream() .map(annotation -> { DeclaredType type = annotation.getAnnotationType(); if (TypeKind.ERROR.equals(type.getKind())) { throw new CodeGenerationIncompleteException(); } return annotation; }) .map(mirror -> AnnotationMirrorWrapper.wrapperOf(processingEnv, mirror)); }
public static Stream<AnnotationMirrorWrapper> wrapAll(ProcessingEnvironmentWrapper processingEnv, Element element) { return element.getAnnotationMirrors() .stream() .map(annotation -> { DeclaredType type = annotation.getAnnotationType(); if (TypeKind.ERROR.equals(type.getKind())) { throw new CodeGenerationIncompleteException(); } return annotation; }) .map(mirror -> AnnotationMirrorWrapper.wrapperOf(processingEnv, mirror)); }
@Override protected SimpleTypeInfo compute() { DeclaredType type = annotation.getAnnotationType(); if (TypeKind.ERROR.equals(type.getKind())) { throw new CodeGenerationIncompleteException(); } return SimpleTypeInfoTypeMirror.wrap(processingEnv, type); } }
@Override protected SimpleTypeInfo compute() { DeclaredType type = annotation.getAnnotationType(); if (TypeKind.ERROR.equals(type.getKind())) { throw new CodeGenerationIncompleteException(); } return SimpleTypeInfoTypeMirror.wrap(processingEnv, type); } }
/** * Finds the interface type that declares that the specified declaration implements XmlAdapter. * * @param declaredType The declaration. * @return The interface type, or null if none found. */ private static DeclaredType findXmlAdapterType(DeclaredType declaredType, TypeVariableContext variableContext, DecoratedProcessingEnvironment env) { TypeElement element = (TypeElement) declaredType.asElement(); if (element == null) { return null; } else if (Object.class.getName().equals(element.getQualifiedName().toString())) { return null; } else if (XmlAdapter.class.getName().equals(element.getQualifiedName().toString())) { return (DeclaredType) variableContext.resolveTypeVariables(declaredType, env); } else { DeclaredType superclass = (DeclaredType) element.getSuperclass(); if (superclass == null || superclass.getKind() == TypeKind.NONE) { return null; } else { return findXmlAdapterType(superclass, variableContext.push(element.getTypeParameters(), declaredType.getTypeArguments()), env); } } }
/** * Finds the interface type that declares that the specified declaration implements XmlAdapter. * * @param declaredType The declaration. * @return The interface type, or null if none found. */ private static DeclaredType findXmlAdapterType(DeclaredType declaredType, TypeVariableContext variableContext, DecoratedProcessingEnvironment env) { TypeElement element = (TypeElement) declaredType.asElement(); if (element == null) { return null; } else if (Object.class.getName().equals(element.getQualifiedName().toString())) { return null; } else if (XmlAdapter.class.getName().equals(element.getQualifiedName().toString())) { return (DeclaredType) variableContext.resolveTypeVariables(declaredType, env); } else { DeclaredType superclass = (DeclaredType) element.getSuperclass(); if (superclass == null || superclass.getKind() == TypeKind.NONE) { return null; } else { return findXmlAdapterType(superclass, variableContext.push(element.getTypeParameters(), declaredType.getTypeArguments()), env); } } }
/** * Finds the interface type that declares that the specified declaration implements XmlAdapter. * * @param declaredType The declaration. * @return The interface type, or null if none found. */ private static DeclaredType findXmlAdapterType(DeclaredType declaredType, TypeVariableContext variableContext, DecoratedProcessingEnvironment env) { TypeElement element = (TypeElement) declaredType.asElement(); if (element == null) { return null; } else if (Object.class.getName().equals(element.getQualifiedName().toString())) { return null; } else if (XmlAdapter.class.getName().equals(element.getQualifiedName().toString())) { return (DeclaredType) variableContext.resolveTypeVariables(declaredType, env); } else { DeclaredType superclass = (DeclaredType) element.getSuperclass(); if (superclass == null || superclass.getKind() == TypeKind.NONE) { return null; } else { return findXmlAdapterType(superclass, variableContext.push(element.getTypeParameters(), declaredType.getTypeArguments()), env); } } }
/** * Finds the interface type that declares that the specified declaration implements XmlAdapter. * * @param declaredType The declaration. * @return The interface type, or null if none found. */ private static DeclaredType findXmlAdapterType(DeclaredType declaredType, TypeVariableContext variableContext, DecoratedProcessingEnvironment env) { TypeElement element = (TypeElement) declaredType.asElement(); if (element == null) { return null; } else if (Object.class.getName().equals(element.getQualifiedName().toString())) { return null; } else if (XmlAdapter.class.getName().equals(element.getQualifiedName().toString())) { return (DeclaredType) variableContext.resolveTypeVariables(declaredType, env); } else { DeclaredType superclass = (DeclaredType) element.getSuperclass(); if (superclass == null || superclass.getKind() == TypeKind.NONE) { return null; } else { return findXmlAdapterType(superclass, variableContext.push(element.getTypeParameters(), declaredType.getTypeArguments()), env); } } }
/** * Finds the interface type that declares that the specified declaration implements XmlAdapter. * * @param declaredType The declaration. * @return The interface type, or null if none found. */ private static DeclaredType findXmlAdapterType(DeclaredType declaredType, TypeVariableContext variableContext, DecoratedProcessingEnvironment env) { TypeElement element = (TypeElement) declaredType.asElement(); if (element == null) { return null; } else if (Object.class.getName().equals(element.getQualifiedName().toString())) { return null; } else if (XmlAdapter.class.getName().equals(element.getQualifiedName().toString())) { return (DeclaredType) variableContext.resolveTypeVariables(declaredType, env); } else { DeclaredType superclass = (DeclaredType) element.getSuperclass(); if (superclass == null || superclass.getKind() == TypeKind.NONE) { return null; } else { return findXmlAdapterType(superclass, variableContext.push(element.getTypeParameters(), declaredType.getTypeArguments()), env); } } }
@Override protected SimpleTypeInfo compute() { DeclaredType type = annotation.getAnnotationType(); if (TypeKind.ERROR.equals(type.getKind())) { throw new CodeGenerationIncompleteException(); } return SimpleTypeInfoTypeMirror.wrap(processingEnv, type); } }
/** * Finds the interface type that declares that the specified declaration implements XmlAdapter. * * @param declaredType The declaration. * @return The interface type, or null if none found. */ private static DeclaredType findXmlAdapterType(DeclaredType declaredType, TypeVariableContext variableContext, DecoratedProcessingEnvironment env) { TypeElement element = (TypeElement) declaredType.asElement(); if (element == null) { return null; } else if (Object.class.getName().equals(element.getQualifiedName().toString())) { return null; } else if (XmlAdapter.class.getName().equals(element.getQualifiedName().toString())) { return (DeclaredType) variableContext.resolveTypeVariables(declaredType, env); } else { DeclaredType superclass = (DeclaredType) element.getSuperclass(); if (superclass == null || superclass.getKind() == TypeKind.NONE) { return null; } else { return findXmlAdapterType(superclass, variableContext.push(element.getTypeParameters(), declaredType.getTypeArguments()), env); } } }
static void findQualifiers(Element element , AnnotationModelHelper helper , boolean event , AnnotationHandleStrategy strategy ) { List<? extends AnnotationMirror> allAnnotationMirrors = helper.getCompilationController().getElements(). getAllAnnotationMirrors( element ); for (AnnotationMirror annotationMirror : allAnnotationMirrors) { DeclaredType annotationType = annotationMirror .getAnnotationType(); if ( annotationType == null || annotationType.getKind() == TypeKind.ERROR){ continue; } TypeElement annotationElement = (TypeElement) annotationType .asElement(); if (annotationElement!= null && isQualifier(annotationElement, helper , event )) { strategy.handleAnnotation(annotationMirror , annotationElement ); } } }