Package org.springframework.roo.classpath.details.annotations

Examples of org.springframework.roo.classpath.details.annotations.AnnotationMetadata


            if (!processed
                    && cid.getAnnotation(RooJavaType.ROO_GWT_PROXY) == null) {
                boolean found = false;
                for (final ClassOrInterfaceTypeDetails proxyCid : typeLocationService
                        .findClassesOrInterfaceDetailsWithAnnotation(RooJavaType.ROO_GWT_PROXY)) {
                    final AnnotationMetadata annotationMetadata = GwtUtils
                            .getFirstAnnotation(proxyCid,
                                    GwtUtils.ROO_PROXY_REQUEST_ANNOTATIONS);
                    if (annotationMetadata != null) {
                        final AnnotationAttributeValue<?> attributeValue = annotationMetadata
                                .getAttribute("value");
                        if (attributeValue != null) {
                            final String mirrorName = GwtUtils
                                    .getStringValue(attributeValue);
                            if (mirrorName != null
View Full Code Here


    }

    private String getDownstreamOfGwtEntity(final JavaType upstreamType) {
        for (final ClassOrInterfaceTypeDetails request : typeLocationService
                .findClassesOrInterfaceDetailsWithAnnotation(ROO_GWT_REQUEST)) {
            final AnnotationMetadata gwtRequestAnnotation = request
                    .getAnnotation(ROO_GWT_REQUEST);
            if (gwtRequestAnnotation != null) {
                final AnnotationAttributeValue<?> attributeValue = gwtRequestAnnotation
                        .getAttribute("value");
                Validate.validState(attributeValue != null,
                        "The x annotation should have a '%s' attribute",
                        "value");
                final String entityClass = GwtUtils
View Full Code Here

    public static List<String> getAnnotationValues(
            final ClassOrInterfaceTypeDetails target,
            final JavaType annotationType, final String attributeName) {
        final List<String> values = new ArrayList<String>();
        final AnnotationMetadata annotation = MemberFindingUtils
                .getAnnotationOfType(target.getAnnotations(), annotationType);
        if (annotation == null) {
            return values;
        }
        final AnnotationAttributeValue<?> attributeValue = annotation
                .getAttribute(attributeName);
        if (attributeValue != null
                && attributeValue instanceof ArrayAttributeValue) {
            @SuppressWarnings("unchecked")
            final ArrayAttributeValue<StringAttributeValue> arrayAttributeValue = (ArrayAttributeValue<StringAttributeValue>) attributeValue;
View Full Code Here

    public static boolean getBooleanAnnotationValue(
            final ClassOrInterfaceTypeDetails target,
            final JavaType annotationType, final String attributeName,
            final boolean valueIfNull) {
        final AnnotationMetadata annotation = MemberFindingUtils
                .getAnnotationOfType(target.getAnnotations(), annotationType);
        if (annotation == null) {
            return valueIfNull;
        }
        final AnnotationAttributeValue<?> attributeValue = annotation
                .getAttribute(attributeName);
        if (attributeValue != null
                && attributeValue instanceof BooleanAttributeValue) {
            final BooleanAttributeValue booleanAttributeValue = (BooleanAttributeValue) attributeValue;
            return booleanAttributeValue.getValue();
View Full Code Here

    public static AnnotationMetadata getFirstAnnotation(
            final ClassOrInterfaceTypeDetails cid,
            final JavaType... annotationTypes) {
        for (final JavaType annotationType : annotationTypes) {
            final AnnotationMetadata annotationMetadata = MemberFindingUtils
                    .getAnnotationOfType(cid.getAnnotations(), annotationType);
            if (annotationMetadata != null) {
                return annotationMetadata;
            }
        }
View Full Code Here

    private static JavaType lookupTargetType(
            final ClassOrInterfaceTypeDetails annotatedType,
            final JavaType classBasedAnnotationType,
            final JavaType stringBasedAnnotationType) {
        final AnnotationMetadata stringBasedAnnotation = annotatedType
                .getAnnotation(stringBasedAnnotationType);
        if (stringBasedAnnotation != null) {
            final AnnotationAttributeValue<String> targetTypeAttributeValue = stringBasedAnnotation
                    .getAttribute("value");
            if (targetTypeAttributeValue != null) {
                return new JavaType(targetTypeAttributeValue.getValue());
            }
        }

        final AnnotationMetadata classBasedAnnotation = annotatedType
                .getAnnotation(classBasedAnnotationType);
        if (classBasedAnnotation != null) {
            final AnnotationAttributeValue<JavaType> targetTypeAttributeValue = classBasedAnnotation
                    .getAttribute("value");
            if (targetTypeAttributeValue != null) {
                return targetTypeAttributeValue.getValue();
            }
        }
View Full Code Here

        final ClassOrInterfaceTypeDetails requestInterface = getGovernor(requestMetadataId);
        if (requestInterface == null) {
            return null;
        }

        final AnnotationMetadata gwtRequestAnnotation = requestInterface
                .getAnnotation(ROO_GWT_REQUEST);
        if (gwtRequestAnnotation == null) {
            return null;
        }

        final JavaType entityType = new JavaType((String) gwtRequestAnnotation
                .getAttribute("value").getValue());

        // Get the methods to be invoked and the type(s) that provide them
        // (should only be one such type, or null)
        final Map<MethodMetadata, FieldMetadata> requestMethods = getRequestMethodsAndInvokedTypes(
View Full Code Here

TOP

Related Classes of org.springframework.roo.classpath.details.annotations.AnnotationMetadata

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.