Package org.springframework.roo.classpath.details

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


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

        final MethodMetadata identifierAccessor = persistenceMemberLocator
                .getIdentifierAccessor(entity);
        final MethodMetadata versionAccessor = persistenceMemberLocator
                .getVersionAccessor(entity);
        final Set<FieldMetadata> locatedFields = locateFields(entity,
                memberDetails, metadataIdentificationString,
                identifierAccessor, versionAccessor);
View Full Code Here


                else {
                    if (fieldTypeCid != null
                            && !customDataBuilder.keySet().contains(
                                    CustomDataKeys.EMBEDDED_FIELD)) {
                        customDataBuilder.put(APPLICATION_TYPE_KEY, null);
                        final MethodMetadata applicationTypeIdentifierAccessor = persistenceMemberLocator
                                .getIdentifierAccessor(entity);
                        final MethodMetadata applicationTypeVersionAccessor = persistenceMemberLocator
                                .getVersionAccessor(entity);
                        final List<FieldMetadata> applicationTypeFields = new ArrayList<FieldMetadata>();

                        int dropDownFields = 0;
                        final MemberDetails applicationTypeMemberDetails = getMemberDetails(fieldType);
View Full Code Here

        final List<JavaSymbolName> parameterNames = Collections
                .<JavaSymbolName> emptyList();
        final JavaType returnType = JavaType.VOID_PRIMITIVE;

        // 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 new MethodMetadataBuilder(userMethod);
        }
View Full Code Here

        final JavaType parameterType = entity;
        final List<JavaSymbolName> parameterNames = Arrays.asList(OBJ_SYMBOL);
        final JavaType returnType = JavaType.BOOLEAN_PRIMITIVE;

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

        final JavaType parameterType = JavaType.INT_PRIMITIVE;
        final List<JavaSymbolName> parameterNames = Arrays.asList(INDEX_SYMBOL);

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

        // Method definition to find or build
        final JavaSymbolName methodName = new JavaSymbolName("getRandom"
                + entity.getSimpleTypeName());

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

        final JavaType[] parameterTypes = {};
        final List<JavaSymbolName> parameterNames = Collections
                .<JavaSymbolName> emptyList();

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

                + entity.getSimpleTypeName());
        final JavaType parameterType = JavaType.INT_PRIMITIVE;
        final List<JavaSymbolName> parameterNames = Arrays.asList(INDEX_SYMBOL);

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

            final JavaSymbolName methodName, final String methodDelegateName) {
        // Method definition to find or build
        final JavaType[] parameterTypes = {};

        // Locate user-defined method
        final MethodMetadata userMethod = getGovernorMethod(methodName,
                parameterTypes);
        if (userMethod != null) {
            return new MethodMetadataBuilder(userMethod);
        }

        // Create the method
        final List<AnnotationMetadataBuilder> annotations = new ArrayList<AnnotationMetadataBuilder>();

        final InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder();

        // Address non-injected entity manager field
        final MethodMetadata entityManagerMethod = getEntityManagerMethod();
        Validate.notNull(entityManagerMethod,
                "Entity manager method should not have returned null");

        // Use the getEntityManager() method to acquire an entity manager (the
        // method will throw an exception if it cannot be acquired)
        final String entityManagerFieldName = getEntityManagerField()
                .getFieldName().getSymbolName();
        bodyBuilder.appendFormalLine("if (this." + entityManagerFieldName
                + " == null) this." + entityManagerFieldName + " = "
                + entityManagerMethod.getMethodName().getSymbolName() + "();");

        JavaType returnType = JavaType.VOID_PRIMITIVE;
        if ("flush".equals(methodDelegateName)) {
            addTransactionalAnnotation(annotations);
            bodyBuilder.appendFormalLine("this." + entityManagerFieldName
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

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.