Package org.springframework.roo.classpath.scanner

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


                governorPhysicalTypeMetadata);
        if (!annotationValues.isAnnotationFound()) {
            return null;
        }

        final MemberDetails memberDetails = getMemberDetails(governorPhysicalTypeMetadata);
        if (memberDetails == null || memberDetails.getFields().isEmpty()) {
            return null;
        }

        return new ToStringMetadata(metadataIdentificationString, aspectName,
                governorPhysicalTypeMetadata, annotationValues);
View Full Code Here


        final PhysicalTypeDetails targetPtd = targetTypeMetadata
                .getMemberHoldingTypeDetails();
        Validate.isInstanceOf(MemberHoldingTypeDetails.class, targetPtd);

        final ClassOrInterfaceTypeDetails targetTypeCid = (ClassOrInterfaceTypeDetails) targetPtd;
        final MemberDetails memberDetails = memberDetailsScanner
                .getMemberDetails(this.getClass().getName(), targetTypeCid);
        Validate.isTrue(
                memberDetails.getAnnotation(ENTITY) != null
                        || memberDetails.getAnnotation(PERSISTENT) != null,
                "The field embedded command is only applicable to JPA @Entity or Spring Data @Persistent target types.");

        final EmbeddedField fieldDetails = new EmbeddedField(
                physicalTypeIdentifier, fieldType, fieldName);
View Full Code Here

        Validate.notNull(
                cid,
                "The specified target '--type' does not exist or can not be found. Please create this type first.");

        // Check if the requested entity is a JPA @Entity
        final MemberDetails memberDetails = memberDetailsScanner
                .getMemberDetails(this.getClass().getName(), cid);
        final AnnotationMetadata entityAnnotation = memberDetails
                .getAnnotation(ENTITY);
        final AnnotationMetadata persistentAnnotation = memberDetails
                .getAnnotation(PERSISTENT);
        Validate.isTrue(
                entityAnnotation != null || persistentAnnotation != null,
                "The field reference command is only applicable to JPA @Entity or Spring Data @Persistent target types.");
View Full Code Here

        Validate.notNull(
                cid,
                "The specified target '--type' does not exist or can not be found. Please create this type first.");

        // Check if the requested entity is a JPA @Entity
        final MemberDetails memberDetails = memberDetailsScanner
                .getMemberDetails(this.getClass().getName(), cid);
        final AnnotationMetadata entityAnnotation = memberDetails
                .getAnnotation(ENTITY);
        final AnnotationMetadata persistentAnnotation = memberDetails
                .getAnnotation(PERSISTENT);

        if (entityAnnotation != null) {
            Validate.isTrue(cardinality == Cardinality.ONE_TO_MANY
                    || cardinality == Cardinality.MANY_TO_MANY,
View Full Code Here

        Validate.notNull(
                cid,
                "The specified target '--type' does not exist or can not be found. Please create this type first.");

        // Check if the requested entity is a JPA @Entity
        final MemberDetails memberDetails = memberDetailsScanner
                .getMemberDetails(this.getClass().getName(), cid);
        final AnnotationMetadata entityAnnotation = memberDetails
                .getAnnotation(ENTITY);
        final AnnotationMetadata persistentAnnotation = memberDetails
                .getAnnotation(PERSISTENT);

        if (entityAnnotation != null) {
            Validate.isTrue(cardinality == Cardinality.ONE_TO_MANY
                    || cardinality == Cardinality.MANY_TO_MANY,
View Full Code Here

        //Checks to ensure permission evaluator class includes the @RooPermissionEvaluator annotation
        /*if (annotationValues == null) {
            return null;
        }*/
       
        final MemberDetails permissionEvaluatorClassDetails = memberDetailsScanner
                .getMemberDetails(getClass().getName(),
                        permissionEvaluatorClass);
       
        Map<JavaType, String> domainTypesToPlurals = getDomainTypesToPlurals();
       
View Full Code Here

         */
        final JpaEntityMetadata parent = getParentMetadata(governorPhysicalType
                .getMemberHoldingTypeDetails());

        // Get the governor's members
        final MemberDetails governorMemberDetails = getMemberDetails(governorPhysicalType);

        // Get the governor's ID field, if any
        final Identifier identifier = getIdentifier(metadataIdentificationString);

        boolean isGaeEnabled = false;
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) {
            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;
                }
            }
        }
View Full Code Here

                .getTypeDetails(formBackingType);
        Validate.notNull(
                formBackingType,
                "Class or interface type details for type '%s' could not be resolved",
                formBackingType);
        final MemberDetails memberDetails = memberDetailsScanner
                .getMemberDetails(getClass().getName(), formBackingTypeDetails);

        // Add composite PK identifier fields if needed
        for (final FieldMetadata field : persistenceMemberLocator
                .getEmbeddedIdentifierFields(formBackingType)) {
View Full Code Here

                .getIdentifierType(entity);
        if (identifierType == null) {
            return null;
        }

        final MemberDetails memberDetails = getMemberDetails(entity);
        if (memberDetails == null) {
            return null;
        }

        final MemberHoldingTypeDetails persistenceMemberHoldingTypeDetails = MemberFindingUtils
                .getMostConcreteMemberHoldingTypeDetailsWithTag(memberDetails,
                        PERSISTENT_TYPE);
        if (persistenceMemberHoldingTypeDetails == null) {
            return null;
        }

        // We need to be informed if our dependent metadata changes
        metadataDependencyRegistry.registerDependency(
                persistenceMemberHoldingTypeDetails.getDeclaredByMetadataId(),
                metadataIdentificationString);

        final MethodParameter firstResultParameter = new MethodParameter(
                INT_PRIMITIVE, "firstResult");
        final MethodParameter maxResultsParameter = new MethodParameter(
                INT_PRIMITIVE, "maxResults");

        final MethodMetadata identifierAccessorMethod = memberDetails
                .getMostConcreteMethodWithTag(IDENTIFIER_ACCESSOR_METHOD);
        final MethodMetadata versionAccessorMethod = persistenceMemberLocator
                .getVersionAccessor(entity);
        final MemberTypeAdditions countMethodAdditions = layerService
                .getMemberTypeAdditions(metadataIdentificationString,
                        COUNT_ALL_METHOD.name(), entity, identifierType,
                        LAYER_POSITION);
        final MemberTypeAdditions findMethodAdditions = layerService
                .getMemberTypeAdditions(metadataIdentificationString,
                        FIND_METHOD.name(), entity, identifierType,
                        LAYER_POSITION, new MethodParameter(identifierType,
                                "id"));
        final MemberTypeAdditions findAllMethodAdditions = layerService
                .getMemberTypeAdditions(metadataIdentificationString,
                        FIND_ALL_METHOD.name(), entity, identifierType,
                        LAYER_POSITION);
        final MemberTypeAdditions findEntriesMethod = layerService
                .getMemberTypeAdditions(metadataIdentificationString,
                        FIND_ENTRIES_METHOD.name(), entity, identifierType,
                        LAYER_POSITION, firstResultParameter,
                        maxResultsParameter);
        final MethodParameter entityParameter = new MethodParameter(entity,
                "obj");
        final MemberTypeAdditions flushMethodAdditions = layerService
                .getMemberTypeAdditions(metadataIdentificationString,
                        FLUSH_METHOD.name(), entity, identifierType,
                        LAYER_POSITION, entityParameter);
        final MemberTypeAdditions mergeMethodAdditions = layerService
                .getMemberTypeAdditions(metadataIdentificationString,
                        MERGE_METHOD.name(), entity, identifierType,
                        LAYER_POSITION, entityParameter);
        final MemberTypeAdditions persistMethodAdditions = layerService
                .getMemberTypeAdditions(metadataIdentificationString,
                        PERSIST_METHOD.name(), entity, identifierType,
                        LAYER_POSITION, entityParameter);
        final MemberTypeAdditions removeMethodAdditions = layerService
                .getMemberTypeAdditions(metadataIdentificationString,
                        REMOVE_METHOD.name(), entity, identifierType,
                        LAYER_POSITION, entityParameter);
        if (persistMethodAdditions == null || findMethodAdditions == null
                || identifierAccessorMethod == null) {
            return null;
        }

        String transactionManager = null;
        final AnnotationMetadata jpaActiveRecordAnnotation = memberDetails
                .getAnnotation(ROO_JPA_ACTIVE_RECORD);
        if (jpaActiveRecordAnnotation != null) {
            final StringAttributeValue transactionManagerAttr = (StringAttributeValue) jpaActiveRecordAnnotation
                    .getAttribute(TRANSACTION_MANAGER_ATTRIBUTE);
            if (transactionManagerAttr != null) {
View Full Code Here

TOP

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

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.