Examples of EnumAttributeValue


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

                    }
                    if (inheritance != null) {
                        final AnnotationAttributeValue<?> value = inheritance
                                .getAttribute(new JavaSymbolName("strategy"));
                        if (value instanceof EnumAttributeValue) {
                            final EnumAttributeValue enumAttributeValue = (EnumAttributeValue) value;
                            final EnumDetails details = enumAttributeValue
                                    .getValue();
                            if (details != null
                                    && details.getType().equals(
                                            INHERITANCE_TYPE)) {
                                if ("TABLE_PER_CLASS".equals(details.getField()
View Full Code Here

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

            final JavaType fieldType = JavaParserUtils.getJavaType(
                    compilationUnitServices, nameToFind, null);

            final EnumDetails enumDetails = new EnumDetails(fieldType,
                    new JavaSymbolName(fieldName));
            return new EnumAttributeValue(annotationName, enumDetails);
        }

        if (expression instanceof NameExpr) {
            final NameExpr field = (NameExpr) expression;
            final String name = field.getName();
            // As we have no way of finding out the real type
            final JavaType fieldType = new JavaType("unknown.Object");
            final EnumDetails enumDetails = new EnumDetails(fieldType,
                    new JavaSymbolName(name));
            return new EnumAttributeValue(annotationName, enumDetails);
        }

        if (expression instanceof ClassExpr) {
            final ClassExpr clazz = (ClassExpr) expression;
            final Type nameToFind = clazz.getType();
View Full Code Here

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

        if (cardinality == null) {
            // Assume set field is an enum
            annotations.add(new AnnotationMetadataBuilder(ELEMENT_COLLECTION));
        }
        else {
            attributes.add(new EnumAttributeValue(
                    new JavaSymbolName("cascade"), new EnumDetails(
                            CASCADE_TYPE, new JavaSymbolName("ALL"))));
            if (fetch != null) {
                JavaSymbolName value = new JavaSymbolName("EAGER");
                if (fetch == Fetch.LAZY) {
                    value = new JavaSymbolName("LAZY");
                }
                attributes.add(new EnumAttributeValue(new JavaSymbolName(
                        "fetch"), new EnumDetails(FETCH_TYPE, value)));
            }
            if (mappedBy != null) {
                attributes.add(new StringAttributeValue(new JavaSymbolName(
                        "mappedBy"), mappedBy.getSymbolName()));
View Full Code Here

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

        if (enumType != null) {
            JavaSymbolName value = new JavaSymbolName("ORDINAL");
            if (enumType == EnumType.STRING) {
                value = new JavaSymbolName("STRING");
            }
            attributes.add(new EnumAttributeValue(new JavaSymbolName("value"),
                    new EnumDetails(ENUM_TYPE, value)));
        }

        annotations.add(new AnnotationMetadataBuilder(ENUMERATED, attributes));
    }
View Full Code Here

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

            final JavaType fieldType = JavaParserUtils.getJavaType(
                    compilationUnitServices, nameToFind, null);

            final EnumDetails enumDetails = new EnumDetails(fieldType,
                    new JavaSymbolName(fieldName));
            return new EnumAttributeValue(annotationName, enumDetails);
        }

        if (expression instanceof NameExpr) {
            final NameExpr field = (NameExpr) expression;
            final String name = field.getName();
            // As we have no way of finding out the real type
            final JavaType fieldType = new JavaType("unknown.Object");
            final EnumDetails enumDetails = new EnumDetails(fieldType,
                    new JavaSymbolName(name));
            return new EnumAttributeValue(annotationName, enumDetails);
        }

        if (expression instanceof ClassExpr) {
            final ClassExpr clazz = (ClassExpr) expression;
            final Type nameToFind = clazz.getType();
View Full Code Here

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

            }
            else if (persistenceType == DateFieldPersistenceType.JPA_TIMESTAMP) {
                value = "TIMESTAMP";
            }
            final List<AnnotationAttributeValue<?>> attrs = new ArrayList<AnnotationAttributeValue<?>>();
            attrs.add(new EnumAttributeValue(new JavaSymbolName("value"),
                    new EnumDetails(TEMPORAL_TYPE, new JavaSymbolName(value))));
            annotations.add(new AnnotationMetadataBuilder(TEMPORAL, attrs));
        }
        // Always add a DateTimeFormat annotation
        final List<AnnotationAttributeValue<?>> attributes = new ArrayList<AnnotationAttributeValue<?>>();
View Full Code Here

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

        arrayValues.add(new StringAttributeValue(new JavaSymbolName("value"),
                "form"));
        requestMappingAttributes
                .add(new ArrayAttributeValue<StringAttributeValue>(
                        new JavaSymbolName("params"), arrayValues));
        requestMappingAttributes.add(new EnumAttributeValue(new JavaSymbolName(
                "method"), new EnumDetails(REQUEST_METHOD, new JavaSymbolName(
                "GET"))));
        final AnnotationMetadataBuilder requestMapping = new AnnotationMetadataBuilder(
                REQUEST_MAPPING, requestMappingAttributes);
        final List<AnnotationMetadataBuilder> annotations = new ArrayList<AnnotationMetadataBuilder>();
View Full Code Here

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

                                .getSymbolName()
                                .replaceFirst(
                                        "find"
                                                + javaTypeMetadataHolder
                                                        .getPlural(), "")));
        requestMappingAttributes.add(new EnumAttributeValue(new JavaSymbolName(
                "method"), new EnumDetails(REQUEST_METHOD, new JavaSymbolName(
                "GET"))));
        final AnnotationMetadataBuilder requestMapping = new AnnotationMetadataBuilder(
                REQUEST_MAPPING, requestMappingAttributes);
        final List<AnnotationMetadataBuilder> annotations = new ArrayList<AnnotationMetadataBuilder>();
View Full Code Here

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

        if (fetch != null) {
            JavaSymbolName value = new JavaSymbolName("EAGER");
            if (fetch == Fetch.LAZY) {
                value = new JavaSymbolName("LAZY");
            }
            attributes.add(new EnumAttributeValue(new JavaSymbolName("fetch"),
                    new EnumDetails(FETCH_TYPE, value)));
        }

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

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

                    "ALL");
        }
        else if (onUpdate == CascadeAction.CASCADE
                && onDelete != CascadeAction.CASCADE) {
            final List<EnumAttributeValue> arrayValues = new ArrayList<EnumAttributeValue>();
            arrayValues.add(new EnumAttributeValue(new JavaSymbolName(
                    attributeName), new EnumDetails(CASCADE_TYPE,
                    new JavaSymbolName("PERSIST"))));
            arrayValues.add(new EnumAttributeValue(new JavaSymbolName(
                    attributeName), new EnumDetails(CASCADE_TYPE,
                    new JavaSymbolName("MERGE"))));
            annotationBuilder
                    .addAttribute(new ArrayAttributeValue<EnumAttributeValue>(
                            new JavaSymbolName(attributeName), arrayValues));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.