Package org.springframework.roo.classpath.details

Examples of org.springframework.roo.classpath.details.DefaultPhysicalTypeMetadata


                .getTypeAtLocation(canonicalPath, metadataIdentificationString,
                        javaType);
        if (typeDetails == null) {
            return null;
        }
        final PhysicalTypeMetadata result = new DefaultPhysicalTypeMetadata(
                metadataIdentificationString, canonicalPath, typeDetails);
        final ClassOrInterfaceTypeDetails details = result
                .getMemberHoldingTypeDetails();
        if (details != null
                && details.getPhysicalTypeCategory() == PhysicalTypeCategory.CLASS
                && details.getExtendsTypes().size() == 1) {
            // This is a class, and it extends another class
            if (details.getSuperclass() != null) {
                // We have a dependency on the superclass, and there is metadata
                // available for the superclass
                // We won't implement the full MetadataNotificationListener
                // here, but rely on MetadataService's fallback
                // (which is to evict from cache and call get again given
                // JavaParserMetadataProvider doesn't implement
                // MetadataNotificationListener, then notify everyone we've
                // changed)
                final String superclassId = details.getSuperclass()
                        .getDeclaredByMetadataId();
                metadataDependencyRegistry.registerDependency(superclassId,
                        result.getId());
            }
            else {
                // We have a dependency on the superclass, but no metadata is
                // available
                // We're left with no choice but to register for every physical
                // type change, in the hope we discover our parent someday
                for (final LogicalPath sourcePath : projectOperations
                        .getPathResolver().getSourcePaths()) {
                    final String possibleSuperclass = PhysicalTypeIdentifier
                            .createIdentifier(details.getExtendsTypes().get(0),
                                    sourcePath);
                    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) {
            additionalLoopRequired = false;
            for (final MemberDetailsDecorator decorator : decorators) {
                final MemberDetails newResult = decorator.decorateTypes(
                        DefaultPhysicalTypeMetadataProvider.class.getName(),
                        memberDetails);
                Validate.isTrue(newResult != null,
                        "Decorator '%s' returned an illegal result", decorator
                                .getClass().getName());
                if (!newResult.equals(memberDetails)) {
                    additionalLoopRequired = true;
                    memberDetails = newResult;
                }
            }
        }

        return new DefaultPhysicalTypeMetadata(metadataIdentificationString,
                canonicalPath, (ClassOrInterfaceTypeDetails) memberDetails
                        .getDetails().get(0));
    }
View Full Code Here


        final Set<ClassOrInterfaceTypeDetails> located = typeLocationService
                .findClassesOrInterfaceDetailsWithAnnotation(RooJavaType.ROO_SERVICE);
        final Map<String, ClassOrInterfaceTypeDetails> toReturn = new HashMap<String, ClassOrInterfaceTypeDetails>();
        for (final ClassOrInterfaceTypeDetails cid : located) {
            final ServiceAnnotationValues annotationValues = new ServiceAnnotationValues(
                    new DefaultPhysicalTypeMetadata(
                            cid.getDeclaredByMetadataId(),
                            typeLocationService
                                    .getPhysicalTypeCanonicalPath(cid
                                            .getDeclaredByMetadataId()), cid));
            Validate.notNull(
View Full Code Here

            return existing;
        }
        final Map<String, ClassOrInterfaceTypeDetails> toReturn = new HashMap<String, ClassOrInterfaceTypeDetails>();
        for (final ClassOrInterfaceTypeDetails cid : located) {
            final RepositoryJpaAnnotationValues annotationValues = new RepositoryJpaAnnotationValues(
                    new DefaultPhysicalTypeMetadata(
                            cid.getDeclaredByMetadataId(),
                            typeLocationService
                                    .getPhysicalTypeCanonicalPath(cid
                                            .getDeclaredByMetadataId()), cid));
            if (annotationValues.getDomainType() != null
View Full Code Here

            return existing;
        }
        final Map<String, ClassOrInterfaceTypeDetails> toReturn = new HashMap<String, ClassOrInterfaceTypeDetails>();
        for (final ClassOrInterfaceTypeDetails cid : located) {
            final RepositoryMongoAnnotationValues annotationValues = new RepositoryMongoAnnotationValues(
                    new DefaultPhysicalTypeMetadata(
                            cid.getDeclaredByMetadataId(),
                            typeLocationService
                                    .getPhysicalTypeCanonicalPath(cid
                                            .getDeclaredByMetadataId()), cid));
            if (annotationValues.getDomainType() != null
View Full Code Here

TOP

Related Classes of org.springframework.roo.classpath.details.DefaultPhysicalTypeMetadata

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.