Package org.springframework.roo.model

Examples of org.springframework.roo.model.JavaSymbolName


            annotationBuilder.addBooleanAttribute("appendSuper", appendSuper);
        }
        if (!CollectionUtils.isEmpty(excludeFields)) {
            final List<StringAttributeValue> attributes = new ArrayList<StringAttributeValue>();
            for (final String excludeField : excludeFields) {
                attributes.add(new StringAttributeValue(new JavaSymbolName(
                        "value"), excludeField));
            }
            annotationBuilder
                    .addAttribute(new ArrayAttributeValue<StringAttributeValue>(
                            new JavaSymbolName("excludeFields"), attributes));
        }

        final ClassOrInterfaceTypeDetailsBuilder cidBuilder = new ClassOrInterfaceTypeDetailsBuilder(
                cid);
        cidBuilder.addAnnotation(annotationBuilder.build());
View Full Code Here


*/
public class CharAttributeValueTest {

    @Test
    public void testToString() {
        assertEquals("baz -> q", new CharAttributeValue(new JavaSymbolName(
                "baz"), 'q').toString());
    }
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    private void registerMatchers() {
        customDataKeyDecorator.registerMatchers(getClass(),
                new LayerTypeMatcher(ROO_REPOSITORY_JPA, new JavaSymbolName(
                        RooJpaRepository.DOMAIN_TYPE_ATTRIBUTE)));
    }
View Full Code Here

        metadataDependencyRegistry.registerDependency(
                PhysicalTypeIdentifier.getMetadataIdentiferType(),
                getProvidesType());
        addMetadataTrigger(ROO_SERVICE);
        customDataKeyDecorator.registerMatchers(getClass(),
                new LayerTypeMatcher(ROO_SERVICE, new JavaSymbolName(
                        RooService.DOMAIN_TYPES_ATTRIBUTE)));
    }
View Full Code Here

public class IntegerAttributeValueTest {

    @Test
    public void testToString() {
        assertEquals("answer -> 42", new IntegerAttributeValue(
                new JavaSymbolName("answer"), 42).toString());
    }
View Full Code Here

        final SetField fieldDetails = new SetField(
                SIMPLE_CLASS3_DECLARED_BY_MID, new JavaType(
                        SET.getFullyQualifiedTypeName(), 0, DataType.TYPE,
                        null, Arrays.asList(SIMPLE_CLASS3_TYPE)),
                new JavaSymbolName("children"), SIMPLE_CLASS3_TYPE,
                Cardinality.ONE_TO_MANY);

        final FieldMetadataBuilder fieldBuilder = new FieldMetadataBuilder(
                fieldDetails.getPhysicalTypeIdentifier(), Modifier.PRIVATE,
                new ArrayList<AnnotationMetadataBuilder>(),
                fieldDetails.getFieldName(), fieldDetails.getFieldType());
        fieldBuilder.setFieldInitializer("new HashSet<SimpleClass3>()");

        final ClassOrInterfaceTypeDetails newClassDetails = addField(
                simpleInterfaceDetails, fieldBuilder.build());

        // Invoke
        final String result = typeParsingService
                .getCompilationUnitContents(newClassDetails);

        saveResult(file, result, "-addField");

        checkSimple3Class(result);

        assertTrue(result
                .contains("private Set<SimpleClass3> children = new HashSet<SimpleClass3>();"));

        // Add another
        final ClassOrInterfaceTypeDetails simpleInterfaceDetails2 = typeParsingService
                .getTypeFromString(result, SIMPLE_CLASS3_DECLARED_BY_MID,
                        SIMPLE_CLASS3_TYPE);

        final ReferenceField fieldDetails2 = new ReferenceField(
                SIMPLE_CLASS3_DECLARED_BY_MID, SIMPLE_CLASS2_TYPE,
                new JavaSymbolName("referenceField"), Cardinality.MANY_TO_ONE);

        final FieldMetadataBuilder fieldBuilder2 = new FieldMetadataBuilder(
                fieldDetails2.getPhysicalTypeIdentifier(), Modifier.PRIVATE,
                new ArrayList<AnnotationMetadataBuilder>(),
                fieldDetails2.getFieldName(), fieldDetails2.getFieldType());
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

public class BooleanAttributeValueTest {

    @Test
    public void testToStringWhenFalse() {
        assertEquals("foo -> false", new BooleanAttributeValue(
                new JavaSymbolName("foo"), false).toString());
    }
View Full Code Here

    }

    @Test
    public void testToStringWhenTrue() {
        assertEquals("bar -> true", new BooleanAttributeValue(
                new JavaSymbolName("bar"), true).toString());
    }
View Full Code Here

        for (final AnnotationMetadata annotationMetadata : cid.getAnnotations()) {
            if (annotationMetadata.getAnnotationType()
                    .getFullyQualifiedTypeName()
                    .equals(ROO_PLURAL.getFullyQualifiedTypeName())) {
                final AnnotationAttributeValue<?> annotationAttributeValue = annotationMetadata
                        .getAttribute(new JavaSymbolName("value"));
                if (annotationAttributeValue != null) {
                    plural = annotationAttributeValue.getValue().toString();
                }
                break;
            }
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.