Package org.springframework.roo.classpath.details.annotations

Examples of org.springframework.roo.classpath.details.annotations.AnnotationMetadataBuilder


        final JavaType versionType = versionAccessorMethod.getReturnType();
        builder.getImportRegistrationResolver().addImports(
                identifierAccessorMethod.getReturnType(), versionType);

        final List<AnnotationMetadataBuilder> annotations = new ArrayList<AnnotationMetadataBuilder>();
        annotations.add(new AnnotationMetadataBuilder(TEST));

        final String entityName = annotationValues.getEntity()
                .getSimpleTypeName();

        final InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder();
View Full Code Here


        final JavaType versionType = versionAccessorMethod.getReturnType();
        builder.getImportRegistrationResolver().addImports(
                identifierAccessorMethod.getReturnType(), versionType);

        final List<AnnotationMetadataBuilder> annotations = new ArrayList<AnnotationMetadataBuilder>();
        annotations.add(new AnnotationMetadataBuilder(TEST));

        final String entityName = annotationValues.getEntity()
                .getSimpleTypeName();

        final InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder();
View Full Code Here

        if (governorHasMethod(methodName)) {
            return null;
        }

        final List<AnnotationMetadataBuilder> annotations = new ArrayList<AnnotationMetadataBuilder>();
        annotations.add(new AnnotationMetadataBuilder(TEST));

        final String entityName = annotationValues.getEntity()
                .getSimpleTypeName();

        final InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder();
View Full Code Here

        builder.getImportRegistrationResolver().addImport(
                identifierAccessorMethod.getReturnType());

        final List<AnnotationMetadataBuilder> annotations = new ArrayList<AnnotationMetadataBuilder>();
        annotations.add(new AnnotationMetadataBuilder(TEST));
        if (isGaeSupported) {
            final AnnotationMetadataBuilder transactionalBuilder = new AnnotationMetadataBuilder(
                    TRANSACTIONAL);
            if (StringUtils.isNotBlank(transactionManager)
                    && !"transactionManager".equals(transactionManager)) {
                transactionalBuilder.addStringAttribute("value",
                        transactionManager);
            }
            transactionalBuilder
                    .addEnumAttribute("propagation", new EnumDetails(
                            PROPAGATION, new JavaSymbolName("SUPPORTS")));
            annotations.add(transactionalBuilder);
        }
View Full Code Here

                    + javaType.getFullyQualifiedTypeName() + "'");
        }

        if (MemberFindingUtils.getAnnotationOfType(cid.getAnnotations(),
                RooJavaType.ROO_JSON) == null) {
            final AnnotationMetadataBuilder annotationBuilder = new AnnotationMetadataBuilder(
                    RooJavaType.ROO_JSON);
            if (rootName != null && rootName.length() > 0) {
                annotationBuilder.addStringAttribute("rootName", rootName);
            }
            if (deepSerialize) {
                annotationBuilder.addBooleanAttribute("deepSerialize", true);
            }
            if (iso8601Dates) {
                annotationBuilder.addBooleanAttribute("iso8601Dates", true);
            }
            final ClassOrInterfaceTypeDetailsBuilder cidBuilder = new ClassOrInterfaceTypeDetailsBuilder(
                    cid);
            cidBuilder.addAnnotation(annotationBuilder);
            typeManagementService.createOrUpdateTypeOnDisk(cidBuilder.build());
View Full Code Here

        return accessors;
    }

    private AnnotationMetadataBuilder getColumnBuilder(
            final Identifier identifier) {
        final AnnotationMetadataBuilder columnBuilder = new AnnotationMetadataBuilder(
                COLUMN);
        columnBuilder.addStringAttribute("name", identifier.getColumnName());
        if (StringUtils.isNotBlank(identifier.getColumnDefinition())) {
            columnBuilder.addStringAttribute("columnDefinition",
                    identifier.getColumnDefinition());
        }
        columnBuilder.addBooleanAttribute("nullable", false);

        // Add length attribute for Strings
        if (identifier.getColumnSize() < 4000
                && identifier.getFieldType().equals(JavaType.STRING)) {
            columnBuilder.addIntegerAttribute("length",
                    identifier.getColumnSize());
        }

        // Add precision and scale attributes for numeric fields
        if (identifier.getScale() > 0
                && (identifier.getFieldType().equals(JavaType.DOUBLE_OBJECT)
                        || identifier.getFieldType().equals(
                                JavaType.DOUBLE_PRIMITIVE) || identifier
                        .getFieldType().equals(BIG_DECIMAL))) {
            columnBuilder.addIntegerAttribute("precision",
                    identifier.getColumnSize());
            columnBuilder.addIntegerAttribute("scale", identifier.getScale());
        }

        return columnBuilder;
    }
View Full Code Here

    private AnnotationMetadata getEmbeddableAnnotation() {
        if (governorTypeDetails.getAnnotation(EMBEDDABLE) != null) {
            return null;
        }
        final AnnotationMetadataBuilder annotationBuilder = new AnnotationMetadataBuilder(
                EMBEDDABLE);
        return annotationBuilder.build();
    }
View Full Code Here

        // We need to create a default identifier field
        final List<AnnotationMetadataBuilder> annotations = new ArrayList<AnnotationMetadataBuilder>();

        // Compute the column name, as required
        final AnnotationMetadataBuilder columnBuilder = new AnnotationMetadataBuilder(
                COLUMN);
        columnBuilder.addStringAttribute("name", "id");
        columnBuilder.addBooleanAttribute("nullable", false);
        annotations.add(columnBuilder);

        fieldBuilders.add(new FieldMetadataBuilder(getId(), Modifier.PRIVATE,
                annotations, new JavaSymbolName("id"), LONG_OBJECT));
View Full Code Here

        String temporalType = StringUtils.defaultIfEmpty(
                StringUtils.upperCase(columnDefinition), "DATE");
        if ("DATETIME".equals(temporalType)) {
            temporalType = "TIMESTAMP"; // ROO-2606
        }
        final AnnotationMetadataBuilder temporalBuilder = new AnnotationMetadataBuilder(
                TEMPORAL);
        temporalBuilder.addEnumAttribute("value", new EnumDetails(
                TEMPORAL_TYPE, new JavaSymbolName(temporalType)));
        annotations.add(temporalBuilder);

        final AnnotationMetadataBuilder dateTimeFormatBuilder = new AnnotationMetadataBuilder(
                DATE_TIME_FORMAT);
        dateTimeFormatBuilder.addStringAttribute("style", "M-");
        annotations.add(dateTimeFormatBuilder);
    }
View Full Code Here

        final String declaredByMetadataId = PhysicalTypeIdentifier
                .createIdentifier(name,
                        pathResolver.getFocusedPath(Path.SRC_MAIN_JAVA));

        final List<AnnotationMetadataBuilder> annotations = new ArrayList<AnnotationMetadataBuilder>(
                Arrays.asList(new AnnotationMetadataBuilder(ROO_JAVA_BEAN),
                        new AnnotationMetadataBuilder(ROO_TO_STRING),
                        new AnnotationMetadataBuilder(EMBEDDABLE)));

        if (serializable) {
            annotations.add(new AnnotationMetadataBuilder(ROO_SERIALIZABLE));
        }

        final int modifier = Modifier.PUBLIC;
        final ClassOrInterfaceTypeDetailsBuilder cidBuilder = new ClassOrInterfaceTypeDetailsBuilder(
                declaredByMetadataId, modifier, name,
View Full Code Here

TOP

Related Classes of org.springframework.roo.classpath.details.annotations.AnnotationMetadataBuilder

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.