Package org.springframework.roo.classpath.layers

Examples of org.springframework.roo.classpath.layers.MethodParameter


        }
        metadataDependencyRegistry
                .registerDependency(idField.getDeclaredByMetadataId(),
                        metadataIdentificationString);

        final MethodParameter idParameter = new MethodParameter(idType,
                ID_FIELD_NAME);
        return layerService.getMemberTypeAdditions(
                metadataIdentificationString, FIND_METHOD.name(), entity,
                idType, LAYER_POSITION, idParameter);
    }
View Full Code Here


        // 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);
View Full Code Here

    @Test
    public void testGetAdditionsForSaveMethodWhenServiceDoesNotProvideIt() {
        final ClassOrInterfaceTypeDetails mockServiceInterface = getMockService(
                "x", null, "x", "x");
        final MethodParameter methodParameter = new MethodParameter(
                mockTargetType, "anything");
        assertAdditions("x", Arrays.asList(mockServiceInterface),
                SAVE.getKey(), null, methodParameter);
    }
View Full Code Here

    @Test
    public void testGetAdditionsForSaveMethodWhenServiceProvidesIt() {
        final ClassOrInterfaceTypeDetails mockServiceInterface = getMockService(
                "x", "save", "x", "x");
        final MethodParameter methodParameter = new MethodParameter(
                mockTargetType, "user");
        assertAdditions("x", Arrays.asList(mockServiceInterface),
                SAVE.getKey(), "personService.savePerson(user)",
                methodParameter);
    }
View Full Code Here

    @Test
    public void testGetAdditionsForUpdateMethodWhenServiceDoesNotProvideIt() {
        final ClassOrInterfaceTypeDetails mockServiceInterface = getMockService(
                "x", "x", "", "x");
        final MethodParameter methodParameter = new MethodParameter(
                mockTargetType, "employee");
        assertAdditions("x", Arrays.asList(mockServiceInterface),
                UPDATE.getKey(), null, methodParameter);
    }
View Full Code Here

    @Test
    public void testGetAdditionsForUpdateMethodWhenServiceProvidesIt() {
        final ClassOrInterfaceTypeDetails mockServiceInterface = getMockService(
                "x", "x", "change", "x");
        final MethodParameter methodParameter = new MethodParameter(
                mockTargetType, "bob");
        assertAdditions("x", Arrays.asList(mockServiceInterface),
                UPDATE.getKey(), "personService.changePerson(bob)",
                methodParameter);
    }
View Full Code Here

        metadataDependencyRegistry.registerDependency(
                persistenceMemberHoldingTypeDetails.getDeclaredByMetadataId(),
                dodMetadataId);

        // Get the additions to make for each required method
        final MethodParameter fromParameter = new MethodParameter(
                JavaType.INT_PRIMITIVE, "from");
        final MethodParameter toParameter = new MethodParameter(
                JavaType.INT_PRIMITIVE, "to");
        final MemberTypeAdditions findEntriesMethod = layerService
                .getMemberTypeAdditions(dodMetadataId,
                        FIND_ENTRIES_METHOD.name(), entity, identifierType,
                        LayerType.HIGHEST.getPosition(), fromParameter,
                        toParameter);
        final MemberTypeAdditions findMethodAdditions = layerService
                .getMemberTypeAdditions(dodMetadataId, FIND_METHOD.name(),
                        entity, identifierType,
                        LayerType.HIGHEST.getPosition(), new MethodParameter(
                                identifierType, "id"));
        final MethodParameter entityParameter = new MethodParameter(entity,
                "obj");
        final MemberTypeAdditions flushMethod = layerService
                .getMemberTypeAdditions(dodMetadataId, FLUSH_METHOD, entity,
                        identifierType, LayerType.HIGHEST.getPosition(),
                        entityParameter);
View Full Code Here

            final MemberTypeAdditions findMethod = layerService
                    .getMemberTypeAdditions(metadataIdentificationString,
                            CustomDataKeys.FIND_METHOD.name(),
                            formBackingObject, identifierType,
                            LayerType.HIGHEST.getPosition(),
                            new MethodParameter(identifierType, "id"));
            findMethods.put(formBackingObject, findMethod);
            toStringMethods.put(
                    formBackingObject,
                    getToStringMethods(memberDetails,
                            metadataIdentificationString));
View Full Code Here

        final List<MethodParameter> parameters = new ArrayList<MethodParameter>();
        for (final String parameterName : parameterNames) {
            final JavaSymbolName mockSymbol = mock(JavaSymbolName.class);
            when(mockSymbol.getSymbolName()).thenReturn(parameterName);
            // We can use any parameter type here, as it's ignored in production
            parameters.add(new MethodParameter(JavaType.OBJECT, mockSymbol));
        }

        // Invoke and check
        assertEquals(expectedMethodCall, method.getCall(mockAnnotationValues,
                mockTargetEntity, PLURAL, parameters));
View Full Code Here

                identifierField.getDeclaredByMetadataId(),
                metadataIdentificationString);

        final JavaSymbolName entityName = JavaSymbolName
                .getReservedWordSafeName(entity);
        final MethodParameter entityParameter = new MethodParameter(entity,
                entityName);
        final MethodParameter idParameter = new MethodParameter(identifierType,
                "id");
        final MethodParameter firstResultParameter = new MethodParameter(
                INT_PRIMITIVE, "firstResult");
        final MethodParameter maxResultsParameter = new MethodParameter(
                INT_PRIMITIVE, "sizeNo");

        final Map<MethodMetadataCustomDataKey, MemberTypeAdditions> additions = new HashMap<MethodMetadataCustomDataKey, MemberTypeAdditions>();
        additions.put(COUNT_ALL_METHOD, layerService.getMemberTypeAdditions(
                metadataIdentificationString, COUNT_ALL_METHOD.name(), entity,
View Full Code Here

TOP

Related Classes of org.springframework.roo.classpath.layers.MethodParameter

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.