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

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


            for (final Object o : arrayVal.getValue()) {
                if (!(o instanceof StringAttributeValue)) {
                    LOGGER.warning(getErrorMsg());
                    return;
                }
                final StringAttributeValue sv = (StringAttributeValue) o;
                if (sv.getValue().equals(finderName.getSymbolName())) {
                    alreadyAdded = true;
                }
                desiredFinders.add(sv);
            }
        }

        // Add the desired finder to the end
        if (!alreadyAdded) {
            desiredFinders.add(new StringAttributeValue(new JavaSymbolName(
                    "ignored"), finderName.getSymbolName()));
        }

        // Now let's add the "finders" attribute
        attributes.add(new ArrayAttributeValue<StringAttributeValue>(
View Full Code Here


        cidBuilder.setName(proxyType);
        cidBuilder.setExtendsTypes(Collections.singletonList(ENTITY_PROXY));
        cidBuilder.setPhysicalTypeCategory(INTERFACE);
        cidBuilder.setModifier(PUBLIC);
        final List<AnnotationAttributeValue<?>> attributeValues = new ArrayList<AnnotationAttributeValue<?>>();
        final StringAttributeValue stringAttributeValue = new StringAttributeValue(
                VALUE, entity.getName().getFullyQualifiedTypeName());
        attributeValues.add(stringAttributeValue);
        final String locator = projectOperations
                .getTopLevelPackage(focusedModule)
                + ".server.locator."
                + entity.getName().getSimpleTypeName() + "Locator";
        final StringAttributeValue locatorAttributeValue = new StringAttributeValue(
                new JavaSymbolName("locator"), locator);
        attributeValues.add(locatorAttributeValue);
        cidBuilder.updateTypeAnnotation(new AnnotationMetadataBuilder(
                PROXY_FOR_NAME, attributeValues));
        attributeValues.remove(locatorAttributeValue);
        final List<StringAttributeValue> readOnlyValues = new ArrayList<StringAttributeValue>();
        final FieldMetadata versionField = persistenceMemberLocator
                .getVersionField(entity.getName());
        if (versionField != null) {
            readOnlyValues.add(new StringAttributeValue(VALUE, versionField
                    .getFieldName().getSymbolName()));
        }
        final List<FieldMetadata> idFields = persistenceMemberLocator
                .getIdentifierFields(entity.getName());
        if (!CollectionUtils.isEmpty(idFields)) {
            readOnlyValues.add(new StringAttributeValue(VALUE, idFields.get(0)
                    .getFieldName().getSymbolName()));
        }
        final ArrayAttributeValue<StringAttributeValue> readOnlyAttribute = new ArrayAttributeValue<StringAttributeValue>(
                new JavaSymbolName("readOnly"), readOnlyValues);
        attributeValues.add(readOnlyAttribute);
View Full Code Here

    private AnnotationMetadata getRooGwtRequestAnnotation(
            final ClassOrInterfaceTypeDetails entity) {
        // The GwtRequestMetadataProvider doesn't need to know excluded methods
        // any more because it actively adds the required CRUD methods itself.
        final StringAttributeValue entityAttributeValue = new StringAttributeValue(
                VALUE, entity.getType().getFullyQualifiedTypeName());
        final List<AnnotationAttributeValue<?>> gwtRequestAttributeValues = new ArrayList<AnnotationAttributeValue<?>>();
        gwtRequestAttributeValues.add(entityAttributeValue);
        return new AnnotationMetadataBuilder(ROO_GWT_REQUEST,
                gwtRequestAttributeValues).build();
View Full Code Here

                gwtRequestAttributeValues).build();
    }

    private AnnotationMetadata getRooGwtUnmanagedRequestAnnotation(
            final ClassOrInterfaceTypeDetails entity) {
        final StringAttributeValue entityAttributeValue = new StringAttributeValue(
                VALUE, entity.getType().getFullyQualifiedTypeName());
        final List<AnnotationAttributeValue<?>> gwtRequestAttributeValues = new ArrayList<AnnotationAttributeValue<?>>();
        gwtRequestAttributeValues.add(entityAttributeValue);
        return new AnnotationMetadataBuilder(ROO_GWT_UNMANAGED_REQUEST,
                gwtRequestAttributeValues).build();
View Full Code Here

                values.add(value.getValue());
            }
        }
        else if (attributeValue != null
                && attributeValue instanceof StringAttributeValue) {
            final StringAttributeValue stringAttributeVale = (StringAttributeValue) attributeValue;
            values.add(stringAttributeVale.getValue());
        }
        return values;
    }
View Full Code Here

            final JavaType invokedType, final JavaType entityType,
            final String requestMetadataId) {
        final List<AnnotationAttributeValue<?>> serviceAttributeValues = new ArrayList<AnnotationAttributeValue<?>>();
        if (invokedType == null) {
            // Active record; specify the entity type as the invoked "service"
            final StringAttributeValue stringAttributeValue = new StringAttributeValue(
                    new JavaSymbolName("value"),
                    entityType.getFullyQualifiedTypeName());
            serviceAttributeValues.add(stringAttributeValue);
        }
        else {
            // Layer component, e.g. repository or service; specify its type as
            // the invoked "service"
            final StringAttributeValue stringAttributeValue = new StringAttributeValue(
                    new JavaSymbolName("value"),
                    invokedType.getFullyQualifiedTypeName());
            serviceAttributeValues.add(stringAttributeValue);

            // Specify the locator that GWT will use to find it
            final LogicalPath requestLogicalPath = PhysicalTypeIdentifier
                    .getPath(request.getDeclaredByMetadataId());
            final JavaType serviceLocator = gwtTypeService
                    .getServiceLocator(requestLogicalPath.getModule());
            final StringAttributeValue locatorAttributeValue = new StringAttributeValue(
                    new JavaSymbolName("locator"),
                    serviceLocator.getFullyQualifiedTypeName());
            serviceAttributeValues.add(locatorAttributeValue);
        }
        return new AnnotationMetadataBuilder(SERVICE_NAME,
View Full Code Here

TOP

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

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.