Package org.springframework.roo.model

Examples of org.springframework.roo.model.JavaSymbolName


     *
     * @param type the parameter's type (required)
     * @param name the parameter's name (required)
     */
    public MethodParameter(final JavaType type, final String name) {
        this(type, new JavaSymbolName(name));
    }
View Full Code Here


                .getTypeFromString(fileContents, SIMPLE_CLASS_DECLARED_BY_MID,
                        SIMPLE_CLASS_TYPE);

        final FieldMetadataBuilder fieldBuilder = new FieldMetadataBuilder(
                SIMPLE_CLASS_DECLARED_BY_MID, Modifier.PRIVATE,
                new JavaSymbolName("newFieldAddedByCode"), new JavaType(
                        String.class), "\"Create by code\"");
        final ClassOrInterfaceTypeDetails newSimpleInterfaceDetails = addField(
                simpleInterfaceDetails, fieldBuilder.build());

        // Invoke
View Full Code Here

        final AnnotationMetadataBuilder autowiredAnnotation = new AnnotationMetadataBuilder(
                AUTOWIRED);
        final String repositoryFieldName = StringUtils
                .uncapitalize(repositoryType.getSimpleTypeName());
        cidBuilder.addField(new FieldMetadataBuilder(callerMID, 0, Arrays
                .asList(autowiredAnnotation), new JavaSymbolName(
                repositoryFieldName), repositoryType));

        // Create the additions to invoke the given method on this field
        final String methodCall = repositoryFieldName + "."
                + method.getCall(parameters);
View Full Code Here

        if (autowire) {
            // Add an autowired field of the type of this service
            cidBuilder.addField(new FieldMetadataBuilder(callerMID, 0, Arrays
                    .asList(new AnnotationMetadataBuilder(AUTOWIRED)),
                    new JavaSymbolName(fieldName), serviceInterface));
        }
        else {
            // Add a set method of the type of this service
            cidBuilder.addField(new FieldMetadataBuilder(callerMID, 0,
                    new JavaSymbolName(fieldName), serviceInterface, null));
            JavaSymbolName setMethodName = new JavaSymbolName("set"
                    + serviceInterface.getSimpleTypeName());
            List<JavaType> parameterTypes = new ArrayList<JavaType>();
            parameterTypes.add(serviceInterface);
            List<JavaSymbolName> parameterNames = new ArrayList<JavaSymbolName>();
            parameterNames.add(new JavaSymbolName(fieldName));
            final InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder();
            bodyBuilder.append("\n\tthis." + fieldName + " = " + fieldName
                    + ";\n");

            MethodMetadataBuilder setSeviceMethod = new MethodMetadataBuilder(
View Full Code Here

        saveResult(file, result);

        final ClassOrInterfaceTypeDetailsBuilder cidBuilder = new ClassOrInterfaceTypeDetailsBuilder(
                enumDetails);

        cidBuilder.addEnumConstant(new JavaSymbolName("ALIEN"));

        final ClassOrInterfaceTypeDetails enumDetails2 = cidBuilder.build();

        // Invoke
        final String result2 = typeParsingService
View Full Code Here

                .getTypeFromString(fileContents, SIMPLE_CLASS_DECLARED_BY_MID,
                        SIMPLE_CLASS_TYPE);

        final FieldMetadataBuilder fieldBuilder = new FieldMetadataBuilder(
                SIMPLE_CLASS_DECLARED_BY_MID, Modifier.PRIVATE,
                new JavaSymbolName("newFieldAddedByCode"), new JavaType(
                        String.class), "\"Create by code\"");
        final ClassOrInterfaceTypeDetails newSimpleInterfaceDetails = addField(
                simpleInterfaceDetails, fieldBuilder.build());

        // Invoke
View Full Code Here

        if (governorHasMethod(EQUALS_METHOD_NAME, parameterType)) {
            return null;
        }

        final List<JavaSymbolName> parameterNames = Arrays
                .asList(new JavaSymbolName(OBJECT_NAME));

        builder.getImportRegistrationResolver().addImport(EQUALS_BUILDER);

        final String typeName = destination.getSimpleTypeName();
View Full Code Here

        Validate.notNull(domainType, "Domain type required");
        final AnnotationMetadataBuilder interfaceAnnotationMetadata = new AnnotationMetadataBuilder(
                ROO_SERVICE);
        interfaceAnnotationMetadata
                .addAttribute(new ArrayAttributeValue<ClassAttributeValue>(
                        new JavaSymbolName("domainTypes"), Arrays
                                .asList(new ClassAttributeValue(
                                        new JavaSymbolName("foo"), domainType))));
        if (role == null) {
            role = "";
        }
        if (requireAuthentication || usePermissionEvaluator || !role.equals("")) {
            interfaceAnnotationMetadata.addBooleanAttribute(
                    "requireAuthentication", requireAuthentication);
        }
        if (!role.equals("")) {
            interfaceAnnotationMetadata
                    .addAttribute(new ArrayAttributeValue<StringAttributeValue>(
                            new JavaSymbolName("authorizedCreateOrUpdateRoles"),
                            Arrays.asList(new StringAttributeValue(
                                    new JavaSymbolName("bar"), role))));
            interfaceAnnotationMetadata
                    .addAttribute(new ArrayAttributeValue<StringAttributeValue>(
                            new JavaSymbolName("authorizedReadRoles"), Arrays
                                    .asList(new StringAttributeValue(
                                            new JavaSymbolName("bar"), role))));
            interfaceAnnotationMetadata
                    .addAttribute(new ArrayAttributeValue<StringAttributeValue>(
                            new JavaSymbolName("authorizedDeleteRoles"), Arrays
                                    .asList(new StringAttributeValue(
                                            new JavaSymbolName("bar"), role))));
        }
        if (usePermissionEvaluator) {
            interfaceAnnotationMetadata.addBooleanAttribute(
                    "usePermissionEvaluator", true);
        }
View Full Code Here

        // Build interface type
        final AnnotationMetadataBuilder interfaceAnnotationMetadata = new AnnotationMetadataBuilder(
                ROO_REPOSITORY_JPA);
        interfaceAnnotationMetadata.addAttribute(new ClassAttributeValue(
                new JavaSymbolName("domainType"), domainType));
        final String interfaceMdId = PhysicalTypeIdentifier.createIdentifier(
                interfaceType, pathResolver.getPath(interfaceIdentifier));
        final ClassOrInterfaceTypeDetailsBuilder cidBuilder = new ClassOrInterfaceTypeDetailsBuilder(
                interfaceMdId, Modifier.PUBLIC, interfaceType,
                PhysicalTypeCategory.INTERFACE);
View Full Code Here

*/
public class LongAttributeValueTest {

    @Test
    public void testToString() {
        assertEquals("beast -> 666", new LongAttributeValue(new JavaSymbolName(
                "beast"), 666).toString());
    }
View Full Code Here

TOP

Related Classes of org.springframework.roo.model.JavaSymbolName

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.