@Override 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)); } annotations.add(new AnnotationMetadataBuilder(ROO_UPLOADED_FILE, attrs)); annotations.add(new AnnotationMetadataBuilder(LOB)); }
String attributeValue = null; if (value instanceof BooleanAttributeValue) { attributeValue = ((BooleanAttributeValue) value).getValue().toString(); } else if (value instanceof CharAttributeValue) { attributeValue = "'" + ((CharAttributeValue) value).getValue().toString() + "'";
@Override public String toString() { return getName() + " -> " + value; } }
headerAttributeValue = new BooleanAttributeValue( new JavaSymbolName("header"), false); headerAttributeValue = new BooleanAttributeValue( new JavaSymbolName("header"), headerAttributeValue.getValue());
headerAttributeValue = new BooleanAttributeValue( new JavaSymbolName("webResultHeader"), false); headerAttributeValue = new BooleanAttributeValue( new JavaSymbolName("webResultHeader"), headerAttributeValue.getValue());
public void addBooleanAttribute(final String key, final boolean value) { addAttribute(new BooleanAttributeValue(new JavaSymbolName(key), value)); }
final boolean castValue = ((BooleanAttributeValue) value).getValue(); final BooleanLiteralExpr convertedValue = new BooleanLiteralExpr(castValue); return new MemberValuePair(value.getName().getSymbolName(), convertedValue);
@Override public String toString() { return getName() + " -> " + value; } }
final List<AnnotationAttributeValue<?>> attrs = new ArrayList<AnnotationAttributeValue<?>>(); attrs.add(new BooleanAttributeValue(new JavaSymbolName("unique"), true)); columnBuilder = new AnnotationMetadataBuilder(COLUMN, attrs);
/** * Return an instance of the Metadata offered by this add-on */ @Override protected ItdTypeDetailsProvidingMetadataItem getMetadata( String metadataIdentificationString, JavaType aspectName, PhysicalTypeMetadata governorPhysicalTypeMetadata, String itdFilename) { // We know governor type details are non-null and can be safely cast ClassOrInterfaceTypeDetails controllerDetails = (ClassOrInterfaceTypeDetails) governorPhysicalTypeMetadata .getMemberHoldingTypeDetails(); Validate.notNull( controllerDetails, "Governor failed to provide class type details, in violation of superclass contract"); AnnotationMetadata stringTrimmerAnnotation = MemberFindingUtils .getAnnotationOfType(controllerDetails.getAnnotations(), GVNIX_STRING_TRIMMER_BINDER); boolean emptyAsNull = ((BooleanAttributeValue) stringTrimmerAnnotation .getAttribute(new JavaSymbolName("emptyAsNull"))).getValue() .booleanValue(); // Pass dependencies required by the metadata in through its constructor return new StringTrimmerBinderMetadata(metadataIdentificationString, aspectName, governorPhysicalTypeMetadata, emptyAsNull); }
return new BooleanAttributeValue(annotationName, value);
String attributeValue = null; if (value instanceof BooleanAttributeValue) { attributeValue = ((BooleanAttributeValue) value).getValue().toString(); } else if (value instanceof CharAttributeValue) { attributeValue = "'" + ((CharAttributeValue) value).getValue().toString() + "'";
attributes.add(new BooleanAttributeValue(new JavaSymbolName("orphanRemoval"), getOrphanRemoval().booleanValue()));
if (!exported.getValue()) {
attributes.add(new BooleanAttributeValue(new JavaSymbolName("orphanRemoval"), getOrphanRemoval().booleanValue()));
if (!exported.getValue()) {
/** * {@inheritDoc} */ public void addExportedAttr(List<AnnotationAttributeValue<?>> attrs) { // Exported attr: always true to know when export from WSDL attrs.add(new BooleanAttributeValue(new JavaSymbolName("exported"), true)); }
/** * {@inheritDoc} */ public void addEnumElementAttr(TypeDeclaration typeDecl, List<AnnotationAttributeValue<?>> annotAttrs) { // Check if is an Enum class if (typeDecl instanceof EnumDeclaration) { annotAttrs.add(new BooleanAttributeValue(new JavaSymbolName( "enumElement"), true)); } else { annotAttrs.add(new BooleanAttributeValue(new JavaSymbolName( "enumElement"), false)); } }
public void addBooleanAttribute(final String key, final boolean value) { addAttribute(new BooleanAttributeValue(new JavaSymbolName(key), value)); }
@Override 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)); } annotations.add(new AnnotationMetadataBuilder(ROO_UPLOADED_FILE, attrs)); annotations.add(new AnnotationMetadataBuilder(LOB)); }