Package org.springframework.roo.project

Examples of org.springframework.roo.project.LogicalPath


        ClassOrInterfaceTypeDetails serviceInterface = null;
        for (final JavaType implementedType : serviceClass.getImplementsTypes()) {
            final ClassOrInterfaceTypeDetails potentialServiceInterfaceTypeDetails = typeLocationService
                    .getTypeDetails(implementedType);
            if (potentialServiceInterfaceTypeDetails != null) {
                final LogicalPath path = PhysicalTypeIdentifier
                        .getPath(potentialServiceInterfaceTypeDetails
                                .getDeclaredByMetadataId());
                final String implementedTypeId = ServiceInterfaceMetadata
                        .createIdentifier(implementedType, path);
                if ((serviceInterfaceMetadata = (ServiceInterfaceMetadata) metadataService
                        .get(implementedTypeId)) != null) {
                    // Found the metadata for the service interface
                    serviceInterface = potentialServiceInterfaceTypeDetails;
                    break;
                }
            }
        }
        if (serviceInterface == null || serviceInterfaceMetadata == null
                || !serviceInterfaceMetadata.isValid()) {
            return null;
        }

        // Register this provider for changes to the service interface // TODO
        // move this down in case we return null early below?
        metadataDependencyRegistry.registerDependency(
                serviceInterfaceMetadata.getId(), metadataIdentificationString);

        final ServiceAnnotationValues serviceAnnotationValues = serviceInterfaceMetadata
                .getServiceAnnotationValues();
        final JavaType[] domainTypes = serviceAnnotationValues.getDomainTypes();
        if (domainTypes == null) {
            return null;
        }

        /*
         * For each domain type, collect (1) the plural and (2) the additions to
         * make to the service class for calling a lower layer when implementing
         * each service layer method. We use LinkedHashMaps for the latter
         * nested map to ensure repeatable order of code generation.
         */
        final Map<JavaType, String> domainTypePlurals = new HashMap<JavaType, String>();
        final Map<JavaType, JavaType> domainTypeToIdTypeMap = new HashMap<JavaType, JavaType>();
        // Collect the additions for each method for each supported domain type
        final Map<JavaType, Map<ServiceLayerMethod, MemberTypeAdditions>> allCrudAdditions = new LinkedHashMap<JavaType, Map<ServiceLayerMethod, MemberTypeAdditions>>();
        for (final JavaType domainType : domainTypes) {

            final JavaType idType = persistenceMemberLocator
                    .getIdentifierType(domainType);
            if (idType == null) {
                return null;
            }
            domainTypeToIdTypeMap.put(domainType, idType);
            // Collect the plural for this domain type

            final ClassOrInterfaceTypeDetails domainTypeDetails = typeLocationService
                    .getTypeDetails(domainType);
            if (domainTypeDetails == null) {
                return null;
            }
            final LogicalPath path = PhysicalTypeIdentifier
                    .getPath(domainTypeDetails.getDeclaredByMetadataId());
            final String pluralId = PluralMetadata.createIdentifier(domainType,
                    path);
            final PluralMetadata pluralMetadata = (PluralMetadata) metadataService
                    .get(pluralId);
View Full Code Here


    @Override
    protected String getGovernorPhysicalTypeIdentifier(
            final String metadataIdentificationString) {
        final JavaType javaType = EqualsMetadata
                .getJavaType(metadataIdentificationString);
        final LogicalPath path = EqualsMetadata
                .getPath(metadataIdentificationString);
        return PhysicalTypeIdentifier.createIdentifier(javaType, path);
    }
View Full Code Here

    public String getName() {
        return FeatureNames.JPA;
    }

    public boolean isInstalledInModule(final String moduleName) {
        final LogicalPath resourcesPath = LogicalPath.getInstance(
                Path.SRC_MAIN_RESOURCES, moduleName);
        return projectOperations.isFocusedProjectAvailable()
                && fileManager.exists(projectOperations.getPathResolver()
                        .getIdentifier(resourcesPath,
                                "META-INF/persistence.xml"));
View Full Code Here

    @Override
    protected String getGovernorPhysicalTypeIdentifier(
            final String metadataIdentificationString) {
        final JavaType javaType = RepositoryJpaMetadata
                .getJavaType(metadataIdentificationString);
        final LogicalPath path = RepositoryJpaMetadata
                .getPath(metadataIdentificationString);
        return PhysicalTypeIdentifier.createIdentifier(javaType, path);
    }
View Full Code Here

    @Override
    protected String getGovernorPhysicalTypeIdentifier(
            final String metadataIdentificationString) {
        final JavaType javaType = ServiceInterfaceMetadata
                .getJavaType(metadataIdentificationString);
        final LogicalPath path = ServiceInterfaceMetadata
                .getPath(metadataIdentificationString);
        return PhysicalTypeIdentifier.createIdentifier(javaType, path);
    }
View Full Code Here

            final String domainTypeId = typeLocationService
                    .getPhysicalTypeIdentifier(type);
            if (domainTypeId == null) {
                return null;
            }
            final LogicalPath path = PhysicalTypeIdentifier
                    .getPath(domainTypeId);
            final String pluralId = PluralMetadata.createIdentifier(type, path);
            final PluralMetadata pluralMetadata = (PluralMetadata) metadataService
                    .get(pluralId);
            if (pluralMetadata == null) {
                return null;
            }
            // Maintain a list of entities that are being handled by this layer
            managedEntityTypes.put(type, metadataIdentificationString);
            metadataDependencyRegistry.registerDependency(pluralId,
                    metadataIdentificationString);
            domainTypePlurals.put(type, pluralMetadata.getPlural());
        }

        PermissionEvaluatorMetadata permissionEvaluatorMetadata = null;
        for (final ClassOrInterfaceTypeDetails permissionEvaluator : typeLocationService
                .findClassesOrInterfaceDetailsWithAnnotation(ROO_PERMISSION_EVALUATOR)) {
            if (permissionEvaluator != null) {
                final LogicalPath path = PhysicalTypeIdentifier
                        .getPath(permissionEvaluator.getDeclaredByMetadataId());
                final String permissionEvaluatorId = PermissionEvaluatorMetadata
                        .createIdentifier(permissionEvaluator.getName(), path);
                permissionEvaluatorMetadata = (PermissionEvaluatorMetadata) metadataService
                        .get(permissionEvaluatorId);
View Full Code Here

        for (final Path path : expectedPaths) {
            final PhysicalPath modulePath = pom.getPhysicalPath(path);
            assertEquals(new File(PROJECT_ROOT, path.getDefaultLocation()),
                    modulePath.getLocation());
            assertEquals(path.isJavaSource(), modulePath.isSource());
            final LogicalPath moduelPathId = modulePath.getLogicalPath();
            assertEquals(path, moduelPathId.getPath());
            assertEquals(ROOT_MODULE, moduelPathId.getModule());
        }
    }
View Full Code Here

    @Override
    protected String getGovernorPhysicalTypeIdentifier(
            final String metadataIdentificationString) {
        final JavaType javaType = EditorMetadata
                .getJavaType(metadataIdentificationString);
        final LogicalPath path = EditorMetadata
                .getPath(metadataIdentificationString);
        return PhysicalTypeIdentifier.createIdentifier(javaType, path);
    }
View Full Code Here

        final JavaType javaType = annotationValues.getEditedType();
        if (!typeLocationService.isInProject(javaType)) {
            return null;
        }

        final LogicalPath path = EditorMetadata
                .getPath(metadataIdentificationString);
        final String jpaActiveRecordMetadataKey = JpaActiveRecordMetadata
                .createIdentifier(javaType, path);

        // We need to lookup the metadata we depend on
View Full Code Here

    @Override
    protected String getGovernorPhysicalTypeIdentifier(
            final String metadataIdentificationString) {
        final JavaType javaType = RepositoryMongoMetadata
                .getJavaType(metadataIdentificationString);
        final LogicalPath path = RepositoryMongoMetadata
                .getPath(metadataIdentificationString);
        return PhysicalTypeIdentifier.createIdentifier(javaType, path);
    }
View Full Code Here

TOP

Related Classes of org.springframework.roo.project.LogicalPath

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.