Package org.springframework.roo.classpath.details

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


        oneToOneBuilder.addStringAttribute(MAPPED_BY,
                mappedByFieldName.getSymbolName());
        addCascadeType(oneToOneBuilder, onUpdate, onDelete);
        annotations.add(oneToOneBuilder);

        return new FieldMetadataBuilder(getId(), Modifier.PRIVATE, annotations,
                fieldName, fieldType);
    }
View Full Code Here


        else {
            // Add @JoinColumns annotation
            annotations.add(getJoinColumnsAnnotation(references, fieldType));
        }

        return new FieldMetadataBuilder(getId(), Modifier.PRIVATE, annotations,
                fieldName, fieldType);
    }
View Full Code Here

                .getDeclaredByMetadataId();
        final ClassOrInterfaceTypeDetailsBuilder cidBuilder = new ClassOrInterfaceTypeDetailsBuilder(
                targetTypeDetails);

        // Create the field
        cidBuilder.addField(new FieldMetadataBuilder(declaredByMetadataId,
                PRIVATE | TRANSIENT, Arrays
                        .asList(new AnnotationMetadataBuilder(AUTOWIRED)),
                fieldName, JMS_OPERATIONS));

        // Create the method
View Full Code Here

        final JavaSymbolName fieldName = new JavaSymbolName("solrServer");
        if (governorTypeDetails.getDeclaredField(fieldName) != null) {
            return null;
        }

        return new FieldMetadataBuilder(getId(), Modifier.TRANSIENT,
                Arrays.asList(new AnnotationMetadataBuilder(AUTOWIRED)),
                fieldName, SOLR_SERVER);
    }
View Full Code Here

        else {
            // A SimpleMailMessage bean exists; auto-wire it into the entity and
            // use it as a template
            final List<AnnotationMetadataBuilder> smmAnnotations = Arrays
                    .asList(new AnnotationMetadataBuilder(AUTOWIRED));
            final FieldMetadataBuilder smmFieldBuilder = new FieldMetadataBuilder(
                    targetClassMID, PRIVATE_TRANSIENT, smmAnnotations,
                    new JavaSymbolName(TEMPLATE_MESSAGE_FIELD),
                    SIMPLE_MAIL_MESSAGE);
            cidBuilder.addField(smmFieldBuilder);
            // Use the injected bean as a template (for thread safety)
View Full Code Here

        }
        final ClassOrInterfaceTypeDetailsBuilder cidBuilder = new ClassOrInterfaceTypeDetailsBuilder(
                existing);

        // Add the MailSender field
        final FieldMetadataBuilder mailSenderFieldBuilder = new FieldMetadataBuilder(
                declaredByMetadataId, PRIVATE_TRANSIENT, annotations,
                fieldName, MAIL_SENDER);
        cidBuilder.addField(mailSenderFieldBuilder);

        // Add the "sendMessage" method
View Full Code Here

                }
                final FieldMetadata field = BeanInfoUtils
                        .getFieldForPropertyName(formBackingTypeDetails,
                                fieldName);
                if (field != null) {
                    final FieldMetadataBuilder fieldMd = new FieldMetadataBuilder(
                            field);
                    fieldMd.setFieldName(parameterNames.get(i));
                    fields.add(fieldMd.build());
                }
            }
            final FinderMetadataDetails details = new FinderMetadataDetails(
                    method.getMethodName().getSymbolName(), method, fields);
            finderMetadataDetails.add(details);
View Full Code Here

            final String identifierFieldName = formBackingTypePersistenceMetadata
                    .getIdentifierField().getFieldName().getSymbolName();
            formCreate.setAttribute("compositePkField", identifierFieldName);
            for (final FieldMetadata embeddedField : formBackingTypePersistenceMetadata
                    .getRooIdentifierFields()) {
                final FieldMetadataBuilder fieldBuilder = new FieldMetadataBuilder(
                        embeddedField);
                fieldBuilder
                        .setFieldName(new JavaSymbolName(identifierFieldName
                                + "."
                                + embeddedField.getFieldName().getSymbolName()));
                for (int i = 0; i < fieldCopy.size(); i++) {
                    // Make sure form fields are not presented twice.
                    if (fieldCopy.get(i).getFieldName()
                            .equals(embeddedField.getFieldName())) {
                        fieldCopy.remove(i);
                        break;
                    }
                }
                formFields.add(fieldBuilder.build());
            }
        }
        formFields.addAll(fieldCopy);

        // If identifier manually assigned, show it in creation
View Full Code Here

                for (final JavaSymbolName fieldName : destType
                        .getWatchedFieldNames()) {
                    for (final FieldMetadataBuilder fieldBuilder : templateClassBuilder
                            .getDeclaredFields()) {
                        if (fieldBuilder.getFieldName().equals(fieldName)) {
                            final FieldMetadataBuilder abstractFieldBuilder = new FieldMetadataBuilder(
                                    abstractClassBuilder
                                            .getDeclaredByMetadataId(),
                                    fieldBuilder.build());
                            abstractClassBuilder
                                    .addField(convertModifier(abstractFieldBuilder));
View Full Code Here

     * Generates a field to store the serialization ID
     *
     * @return a non-<code>null</code> field
     */
    private FieldMetadataBuilder createSerialVersionField() {
        final FieldMetadataBuilder fieldBuilder = new FieldMetadataBuilder(
                getId(), PRIVATE | STATIC | FINAL, SERIAL_VERSION_FIELD,
                LONG_PRIMITIVE, DEFAULT_SERIAL_VERSION);
        fieldBuilder.getCustomData().put(
                CustomDataKeys.SERIAL_VERSION_UUID_FIELD, true);
        return fieldBuilder;
    }
View Full Code Here

TOP

Related Classes of org.springframework.roo.classpath.details.FieldMetadataBuilder

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.