Package org.springframework.roo.classpath.scanner

Examples of org.springframework.roo.classpath.scanner.MemberDetailsBuilder


    private final Map<String, String> pluralMap = new HashMap<String, String>();
    private final Map<String, Matcher<? extends CustomDataAccessor>> taggerMap = new HashMap<String, Matcher<? extends CustomDataAccessor>>();

    public MemberDetails decorate(final String requestingClass,
            final MemberDetails memberDetails) {
        final MemberDetailsBuilder memberDetailsBuilder = new MemberDetailsBuilder(
                memberDetails);

        for (final MemberHoldingTypeDetails memberHoldingTypeDetails : memberDetails
                .getDetails()) {
            if (memberHoldingTypeDetails instanceof ClassOrInterfaceTypeDetails) {
                if (!pluralMap.containsKey(memberHoldingTypeDetails
                        .getDeclaredByMetadataId())) {
                    pluralMap.put(
                            memberHoldingTypeDetails.getDeclaredByMetadataId(),
                            getInflectorPlural(memberHoldingTypeDetails
                                    .getName().getSimpleTypeName(),
                                    Locale.ENGLISH));
                }
            }
        }

        // Locate any requests that we add custom data to identifiable java
        // structures
        for (final FieldMatcher fieldTagger : getFieldTaggers()) {
            for (final FieldMetadata field : fieldTagger.matches(memberDetails
                    .getDetails())) {
                memberDetailsBuilder.tag(field, fieldTagger.getCustomDataKey(),
                        fieldTagger.getTagValue(field));
            }
        }

        for (final MethodMatcher methodTagger : getMethodTaggers()) {
            for (final MethodMetadata method : methodTagger.matches(
                    memberDetails.getDetails(), pluralMap)) {
                memberDetailsBuilder.tag(method,
                        methodTagger.getCustomDataKey(),
                        methodTagger.getTagValue(method));
            }
        }

        for (final ConstructorMatcher constructorTagger : getConstructorTaggers()) {
            for (final ConstructorMetadata constructor : constructorTagger
                    .matches(memberDetails.getDetails())) {
                memberDetailsBuilder.tag(constructor,
                        constructorTagger.getCustomDataKey(),
                        constructorTagger.getTagValue(constructor));
            }
        }

        for (final TypeMatcher typeTagger : getTypeTaggers()) {
            for (final MemberHoldingTypeDetails typeDetails : typeTagger
                    .matches(memberDetails.getDetails())) {
                memberDetailsBuilder.tag(typeDetails,
                        typeTagger.getCustomDataKey(),
                        typeTagger.getTagValue(typeDetails));
            }
        }

        return memberDetailsBuilder.build();
    }
View Full Code Here


        return memberDetailsBuilder.build();
    }

    public MemberDetails decorateTypes(final String requestingClass,
            final MemberDetails memberDetails) {
        final MemberDetailsBuilder memberDetailsBuilder = new MemberDetailsBuilder(
                memberDetails);
        for (final TypeMatcher typeTagger : getTypeTaggers()) {
            for (final MemberHoldingTypeDetails typeDetails : typeTagger
                    .matches(memberDetails.getDetails())) {
                memberDetailsBuilder.tag(typeDetails,
                        typeTagger.getCustomDataKey(),
                        typeTagger.getTagValue(typeDetails));
            }
        }
        return memberDetailsBuilder.build();
    }
View Full Code Here

                    metadataDependencyRegistry.registerDependency(
                            possibleSuperclass, result.getId());
                }
            }
        }
        MemberDetails memberDetails = new MemberDetailsBuilder(
                Arrays.asList(details)).build();
        // Loop until such time as we complete a full loop where no changes are
        // made to the result
        boolean additionalLoopRequired = true;
        while (additionalLoopRequired) {
View Full Code Here

TOP

Related Classes of org.springframework.roo.classpath.scanner.MemberDetailsBuilder

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.