Package org.springframework.roo.classpath.details

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


        final JavaType returnType = new JavaType(
                LIST.getFullyQualifiedTypeName(), 0, DataType.TYPE, null,
                Arrays.asList(destination));

        // Locate user-defined method
        final MethodMetadata userMethod = getGovernorMethod(methodName,
                parameterTypes);
        if (userMethod != null) {
            Validate.isTrue(userMethod.getReturnType().equals(returnType),
                    "Method '%s' on '%s' must return '%s'", methodName,
                    destination, returnType.getNameIncludingTypeParameters());
            return userMethod;
        }
View Full Code Here


        final JavaType returnType = new JavaType(
                LIST.getFullyQualifiedTypeName(), 0, DataType.TYPE, null,
                Arrays.asList(destination));

        // Locate user-defined method
        final MethodMetadata userMethod = getGovernorMethod(methodName,
                parameterTypes);
        if (userMethod != null) {
            Validate.isTrue(userMethod.getReturnType().equals(returnType),
                    "Method '%s' on '%s' must return '%s'", methodName,
                    destination, returnType.getNameIncludingTypeParameters());
            return userMethod;
        }
View Full Code Here

        final JavaType returnType = new JavaType(
                LIST.getFullyQualifiedTypeName(), 0, DataType.TYPE, null,
                Arrays.asList(destination));

        // Locate user-defined method
        final MethodMetadata userMethod = getGovernorMethod(methodName,
                parameterTypes);
        if (userMethod != null) {
            Validate.isTrue(userMethod.getReturnType().equals(returnType),
                    "Method '%s' on '%s' must return '%s'", methodName,
                    destination, returnType.getNameIncludingTypeParameters());
            return userMethod;
        }
View Full Code Here

                ENTITY_MANAGER_METHOD_NAME);
        final JavaType[] parameterTypes = {};
        final JavaType returnType = ENTITY_MANAGER;

        // Locate user-defined method
        final MethodMetadata userMethod = getGovernorMethod(methodName,
                parameterTypes);
        if (userMethod != null) {
            Validate.isTrue(userMethod.getReturnType().equals(returnType),
                    "Method '%s' on '%s' must return '%s'", methodName,
                    destination, returnType.getNameIncludingTypeParameters());
            entityManagerMethod = userMethod;
            return;
        }
View Full Code Here

        final List<JavaSymbolName> parameterNames = Arrays
                .asList(new JavaSymbolName(idFieldName));
        final JavaType returnType = destination;

        // Locate user-defined method
        final MethodMetadata userMethod = getGovernorMethod(methodName,
                parameterType);
        if (userMethod != null) {
            Validate.isTrue(
                    userMethod.getReturnType().equals(returnType),
                    "Method '" + methodName + "' on '" + returnType
                            + "' must return '"
                            + returnType.getNameIncludingTypeParameters() + "'");
            findMethod = userMethod;
            return;
View Full Code Here

                "Unable to obtain physical type metadata for type %s",
                formbackingObject.getFullyQualifiedTypeName());
        final MemberDetails memberDetails = memberDetailsScanner
                .getMemberDetails(getClass().getName(),
                        formbackingClassOrInterfaceDetails);
        final MethodMetadata identifierAccessor = persistenceMemberLocator
                .getIdentifierAccessor(formbackingObject);
        final MethodMetadata versionAccessor = persistenceMemberLocator
                .getVersionAccessor(formbackingObject);

        for (final MethodMetadata method : memberDetails.getMethods()) {
            // Only interested in accessors
            if (!BeanInfoUtils.isAccessorMethod(method)) {
                continue;
            }
            if (++fieldCounter < 7) {
                if (method.getMethodName().equals(
                        identifierAccessor.getMethodName())
                        || method.getMethodName().equals(
                                versionAccessor.getMethodName())) {
                    continue;
                }
                if (method.hasSameName(identifierAccessor, versionAccessor)) {
                    continue;
                }
View Full Code Here

            final MethodMetadataBuilder methodBuilder = new MethodMetadataBuilder(
                    method);
            // Remove all annotations from proxy method
            methodBuilder.setAnnotations(new ArrayList<AnnotationMetadata>());
            methodBuilder.setReturnType(gwtType);
            final MethodMetadata convertedMethod = methodBuilder.build();
            if (gwtTypeService.isMethodReturnTypeInSourcePath(convertedMethod,
                    mirroredDetails, sourcePackages)) {
                convertedProxyMethods.add(methodBuilder.build());
            }
        }
View Full Code Here

                metadataDependencyRegistry.registerDependency(
                        method.getDeclaredByMetadataId(),
                        metadataIdentificationString);
            }
        }
        final MethodMetadata identifierAccessor = persistenceMemberLocator
                .getIdentifierAccessor(javaType);
        if (identifierAccessor == null) {
            return null;
        }
View Full Code Here

            final JavaType javaType, final MemberDetails memberDetails,
            final String metadataIdentificationString) {
        Validate.notNull(javaType, "Java type required");
        Validate.notNull(memberDetails, "Member details required");

        final MethodMetadata identifierAccessor = persistenceMemberLocator
                .getIdentifierAccessor(javaType);
        final MethodMetadata versionAccessor = persistenceMemberLocator
                .getVersionAccessor(javaType);

        final Map<JavaSymbolName, DateTimeFormatDetails> dates = new LinkedHashMap<JavaSymbolName, DateTimeFormatDetails>();
        final JavaTypePersistenceMetadataDetails javaTypePersistenceMetadataDetails = getJavaTypePersistenceMetadataDetails(
                javaType, memberDetails, metadataIdentificationString);
View Full Code Here

            final String metadataIdentificationString) {
        Validate.notNull(javaType, "Java type required");
        Validate.notNull(memberDetails, "Member details required");
        Validate.notBlank(metadataIdentificationString, "Metadata id required");

        final MethodMetadata idAccessor = memberDetails
                .getMostConcreteMethodWithTag(IDENTIFIER_ACCESSOR_METHOD);
        if (idAccessor == null) {
            return null;
        }

        final FieldMetadata idField = CollectionUtils
                .firstElementOf(persistenceMemberLocator
                        .getIdentifierFields(javaType));
        if (idField == null) {
            return null;
        }

        final JavaType idType = persistenceMemberLocator
                .getIdentifierType(javaType);
        if (idType == null) {
            return null;
        }

        registerDependency(idAccessor.getDeclaredByMetadataId(),
                metadataIdentificationString);
        registerDependency(idField.getDeclaredByMetadataId(),
                metadataIdentificationString);

        final MethodParameter entityParameter = new MethodParameter(javaType,
                JavaSymbolName.getReservedWordSafeName(javaType));
        final MethodParameter idParameter = new MethodParameter(idType, idField
                .getFieldName().getSymbolName());
        final MethodMetadata versionAccessor = memberDetails
                .getMostConcreteMethodWithTag(VERSION_ACCESSOR_METHOD);
        final MemberTypeAdditions persistMethod = layerService
                .getMemberTypeAdditions(metadataIdentificationString,
                        PERSIST_METHOD.name(), javaType, idType,
                        LAYER_POSITION, entityParameter);
View Full Code Here

TOP

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

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.