public String getBody() { if (bodyBuilder != null) { return bodyBuilder.getOutput(); } return null; }
public String getBody() { if (bodyBuilder != null) { return bodyBuilder.getOutput(); } return null; }
public InitializerMetadata build() { return new DefaultInitializerMetadata(getCustomData().build(), getDeclaredByMetadataId(), getModifier(), isStatic, getBodyBuilder().getOutput()); }
private String getColumnPrecisionAndScaleBody(final FieldMetadata field, final Map<String, Object> values, final String suffix) { if (values == null || !values.containsKey("precision")) { return InvocableMemberBodyBuilder.getInstance().getOutput(); bodyBuilder.appendFormalLine("}"); return bodyBuilder.getOutput();
public String getBody() { if (bodyBuilder != null) { return bodyBuilder.getOutput(); } return null; }
public String getBody() { if (bodyBuilder != null) { return bodyBuilder.getOutput(); } return null; }
public ConstructorMetadata build() { return new DefaultConstructorMetadata(getCustomData().build(), getDeclaredByMetadataId(), getModifier(), buildAnnotations(), getParameterTypes(), getParameterNames(), getThrowsTypes(), getBodyBuilder().getOutput()); } }
public FieldMetadata getLoggerField() { InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder(); bodyBuilder.append(getNameOfJavaType(LOGGER_FACTORY_JAVA_TYPE)); bodyBuilder.append(".getLogger("); bodyBuilder.append(governorPhysicalTypeMetadata.getType().getSimpleTypeName()); bodyBuilder.append(".class)"); final String initializer = bodyBuilder.getOutput(); FieldMetadataBuilder field = new FieldMetadataBuilder(getId(), Modifier.PRIVATE | Modifier.STATIC | Modifier.FINAL, new JavaSymbolName("LOG"), LOGGER_JAVA_TYPE, initializer); return field.build(); }
private String getDigitsBody(final FieldMetadata field, final AnnotationMetadata digitsAnnotation, final String suffix) { final String fieldName = field.getFieldName().getSymbolName(); final JavaType fieldType = field.getFieldType(); final Integer integerValue = (Integer) digitsAnnotation.getAttribute(new JavaSymbolName("integer")).getValue(); final Integer fractionValue = (Integer) digitsAnnotation.getAttribute(new JavaSymbolName("fraction")).getValue(); final BigDecimal maxValue = new BigDecimal(StringUtils.rightPad("9", integerValue, '9') + "." + StringUtils.rightPad("9", fractionValue, '9')); final InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder(); if (fieldType.equals(BIG_DECIMAL)) { bodyBuilder.appendFormalLine("if (" + fieldName + ".compareTo(new " + BIG_DECIMAL.getSimpleTypeName() + "(\"" + maxValue + "\")) == 1) {"); bodyBuilder.indent(); bodyBuilder.appendFormalLine(fieldName + " = new " + BIG_DECIMAL.getSimpleTypeName() + "(\"" + maxValue + "\");"); } else { bodyBuilder.appendFormalLine("if (" + fieldName + " > " + maxValue.doubleValue() + suffix + ") {"); bodyBuilder.indent(); bodyBuilder.appendFormalLine(fieldName + " = " + maxValue.doubleValue() + suffix + ";"); } bodyBuilder.indentRemove(); bodyBuilder.appendFormalLine("}"); return bodyBuilder.getOutput(); }
public MethodMetadata build() { DefaultMethodMetadata methodMetadata = new DefaultMethodMetadata(getCustomData().build(), getDeclaredByMetadataId(), getModifier(), buildAnnotations(), getMethodName(), getReturnType(), getParameterTypes(), getParameterNames(), getThrowsTypes(), getBodyBuilder() .getOutput()); methodMetadata.setCommentStructure(this.getCommentStructure()); // ROO-3648: Add support to generate Generic Methods methodMetadata.setGenericDefinition(this.getGenericDefinition()); return methodMetadata; }
return bodyBuilder.getOutput();
return bodyBuilder.getOutput();
return bodyBuilder.getOutput();
Modifier.PUBLIC, exceptionList, new ArrayList<AnnotationMetadata>(), parameterTypeList, parameterNameList, bodyBuilder.getOutput());
public InitializerMetadata build() { return new DefaultInitializerMetadata(getCustomData().build(), getDeclaredByMetadataId(), getModifier(), isStatic, getBodyBuilder().getOutput()); }
private String getColumnPrecisionAndScaleBody(final FieldMetadata field, final Map<String, Object> values, final String suffix) { if (values == null || !values.containsKey("precision")) { return InvocableMemberBodyBuilder.getInstance().getOutput(); bodyBuilder.appendFormalLine("}"); return bodyBuilder.getOutput();
public ConstructorMetadata build() { return new DefaultConstructorMetadata(getCustomData().build(), getDeclaredByMetadataId(), getModifier(), buildAnnotations(), getParameterTypes(), getParameterNames(), getThrowsTypes(), getBodyBuilder().getOutput()); } }
private String getDigitsBody(final FieldMetadata field, final AnnotationMetadata digitsAnnotation, final String suffix) { final String fieldName = field.getFieldName().getSymbolName(); final JavaType fieldType = field.getFieldType(); final Integer integerValue = (Integer) digitsAnnotation.getAttribute(new JavaSymbolName("integer")).getValue(); final Integer fractionValue = (Integer) digitsAnnotation.getAttribute(new JavaSymbolName("fraction")).getValue(); final BigDecimal maxValue = new BigDecimal(StringUtils.rightPad("9", integerValue, '9') + "." + StringUtils.rightPad("9", fractionValue, '9')); final InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder(); if (fieldType.equals(BIG_DECIMAL)) { bodyBuilder.appendFormalLine("if (" + fieldName + ".compareTo(new " + BIG_DECIMAL.getSimpleTypeName() + "(\"" + maxValue + "\")) == 1) {"); bodyBuilder.indent(); bodyBuilder.appendFormalLine(fieldName + " = new " + BIG_DECIMAL.getSimpleTypeName() + "(\"" + maxValue + "\");"); } else { bodyBuilder.appendFormalLine("if (" + fieldName + " > " + maxValue.doubleValue() + suffix + ") {"); bodyBuilder.indent(); bodyBuilder.appendFormalLine(fieldName + " = " + maxValue.doubleValue() + suffix + ";"); } bodyBuilder.indentRemove(); bodyBuilder.appendFormalLine("}"); return bodyBuilder.getOutput(); }
public MethodMetadata build() { DefaultMethodMetadata methodMetadata = new DefaultMethodMetadata(getCustomData().build(), getDeclaredByMetadataId(), getModifier(), buildAnnotations(), getMethodName(), getReturnType(), getParameterTypes(), getParameterNames(), getThrowsTypes(), getBodyBuilder() .getOutput()); methodMetadata.setCommentStructure(this.getCommentStructure()); // ROO-3648: Add support to generate Generic Methods methodMetadata.setGenericDefinition(this.getGenericDefinition()); return methodMetadata; }
return bodyBuilder.getOutput();