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

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


                }
                attributes.add(new EnumAttributeValue(new JavaSymbolName(
                        "fetch"), new EnumDetails(FETCH_TYPE, value)));
            }
            if (mappedBy != null) {
                attributes.add(new StringAttributeValue(new JavaSymbolName(
                        "mappedBy"), mappedBy.getSymbolName()));
            }

            switch (cardinality) {
            case ONE_TO_MANY:
View Full Code Here


        }

        AnnotationMetadataBuilder columnBuilder = null;
        if (column != null) {
            final List<AnnotationAttributeValue<?>> attrs = new ArrayList<AnnotationAttributeValue<?>>();
            attrs.add(new StringAttributeValue(new JavaSymbolName("name"),
                    column));
            columnBuilder = new AnnotationMetadataBuilder(COLUMN, attrs);
        }
        if (unique) {
            if (columnBuilder != null) {
                columnBuilder.addBooleanAttribute("unique", true);
            }
            else {
                final List<AnnotationAttributeValue<?>> attrs = new ArrayList<AnnotationAttributeValue<?>>();
                attrs.add(new BooleanAttributeValue(
                        new JavaSymbolName("unique"), true));
                columnBuilder = new AnnotationMetadataBuilder(COLUMN, attrs);
            }
        }
        if (value != null) {
            final List<AnnotationAttributeValue<?>> attrs = new ArrayList<AnnotationAttributeValue<?>>();
            attrs.add(new StringAttributeValue(new JavaSymbolName("value"),
                    value));
            annotations.add(new AnnotationMetadataBuilder(VALUE, attrs));
        }
        if (fieldName.getSymbolName().equals("created")) {
            if (columnBuilder == null) {
View Full Code Here

        String transactionManager = null;
        final AnnotationMetadata jpaActiveRecordAnnotation = memberDetails
                .getAnnotation(ROO_JPA_ACTIVE_RECORD);
        if (jpaActiveRecordAnnotation != null) {
            final StringAttributeValue transactionManagerAttr = (StringAttributeValue) jpaActiveRecordAnnotation
                    .getAttribute(TRANSACTION_MANAGER_ATTRIBUTE);
            if (transactionManagerAttr != null) {
                transactionManager = transactionManagerAttr.getValue();
            }
        }

        final boolean hasEmbeddedIdentifier = dataOnDemandMetadata
                .hasEmbeddedIdentifier();
View Full Code Here

                                .getValue()) {
                            // For now we'll only support arrays of strings
                            if (fieldType.getComponentType().equals(
                                    String.class)
                                    && val instanceof StringAttributeValue) {
                                final StringAttributeValue stringValue = (StringAttributeValue) val;
                                result.add(stringValue.getValue());
                            }
                            else if (fieldType.getComponentType().equals(
                                    JavaType.class)
                                    && val instanceof ClassAttributeValue) {
                                final ClassAttributeValue classValue = (ClassAttributeValue) val;
View Full Code Here

    public void decorateAnnotationsList(
            final List<AnnotationMetadataBuilder> annotations) {
        super.decorateAnnotationsList(annotations);

        final List<AnnotationAttributeValue<?>> attrs = new ArrayList<AnnotationAttributeValue<?>>();
        attrs.add(new StringAttributeValue(new JavaSymbolName("contentType"),
                contentType.getContentType()));

        if (autoUpload) {
            attrs.add(new BooleanAttributeValue(
                    new JavaSymbolName("autoUpload"), autoUpload));
View Full Code Here

            }
            annotations.add(new AnnotationMetadataBuilder(SIZE, attrs));
        }
        if (regexp != null) {
            final List<AnnotationAttributeValue<?>> attrs = new ArrayList<AnnotationAttributeValue<?>>();
            attrs.add(new StringAttributeValue(new JavaSymbolName("regexp"),
                    regexp));
            annotations.add(new AnnotationMetadataBuilder(PATTERN, attrs));
        }
    }
View Full Code Here

    public void decorateAnnotationsList(
            final List<AnnotationMetadataBuilder> annotations) {
        super.decorateAnnotationsList(annotations);
        if (decimalMin != null) {
            final List<AnnotationAttributeValue<?>> attrs = new ArrayList<AnnotationAttributeValue<?>>();
            attrs.add(new StringAttributeValue(new JavaSymbolName("value"),
                    decimalMin));
            annotations.add(new AnnotationMetadataBuilder(DECIMAL_MIN, attrs));
        }
        if (decimalMax != null) {
            final List<AnnotationAttributeValue<?>> attrs = new ArrayList<AnnotationAttributeValue<?>>();
            attrs.add(new StringAttributeValue(new JavaSymbolName("value"),
                    decimalMax));
            annotations.add(new AnnotationMetadataBuilder(DECIMAL_MAX, attrs));
        }
    }
View Full Code Here

        }
        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

            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));
View Full Code Here

                }
                else {
                    current = null;
                }
            }
            return new StringAttributeValue(annotationName, result);
        }

        if (expression instanceof StringLiteralExpr) {
            final String value = ((StringLiteralExpr) expression).getValue();
            return new StringAttributeValue(annotationName, value);
        }

        if (expression instanceof FieldAccessExpr) {
            final FieldAccessExpr field = (FieldAccessExpr) expression;
            final String fieldName = field.getField();
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.