protected abstract def CharSequence body();
// Helper patterns
- final protected def fieldName(GeneratedProperty property) '''_«property.name»'''
+ final protected def fieldName(GeneratedProperty property) {
+ "_" + property.name
+ }
final protected def propertyNameFromGetter(MethodSignature getter) {
var String prefix;
restrictions.rangeConstraint.get, this)»
«ENDIF»
«IF restrictions.lengthConstraint.present»
- «LengthGenerator.generateLengthChecker(field.fieldName.toString, actualType, restrictions.lengthConstraint.get, this)»
+ «LengthGenerator.generateLengthChecker(field.fieldName, actualType, restrictions.lengthConstraint.get, this)»
«ENDIF»
'''
«val fieldName = property.fieldName»
«IF restrictions.getLengthConstraint.isPresent»
«IF actualType instanceof ConcreteType»
- «LengthGenerator.generateLengthCheckerCall(fieldName.toString, value)»
+ «LengthGenerator.generateLengthCheckerCall(fieldName, value)»
«ELSE»
- «LengthGenerator.generateLengthCheckerCall(fieldName.toString, value + ".getValue()")»
+ «LengthGenerator.generateLengthCheckerCall(fieldName, value + ".getValue()")»
«ENDIF»
«ENDIF»
- «val fieldUpperCase = fieldName.toString.toUpperCase(Locale.ENGLISH)»
+ «val fieldUpperCase = fieldName.toUpperCase(Locale.ENGLISH)»
«FOR currentConstant : type.getConstantDefinitions»
«IF currentConstant.getName.startsWith(TypeConstants.PATTERN_CONSTANT_NAME)
&& fieldUpperCase.equals(currentConstant.getName.substring(TypeConstants.PATTERN_CONSTANT_NAME.length))»
}
}
«ENDIF»
- this.«field.fieldName.toString» = values;
+ this.«field.fieldName» = values;
return this;
}
«checkArgument(field, restrictions, actualType, "value")»
}
«ENDIF»
- this.«field.fieldName.toString» = value;
+ this.«field.fieldName» = value;
return this;
}
«val uintType = UINT_TYPES.get(field.returnType)»
super(«parentProperties.asArguments»);
«ENDIF»
«FOR p : allProperties»
- «generateRestrictions(type, p.fieldName.toString, p.returnType)»
+ «generateRestrictions(type, p.fieldName, p.returnType)»
«ENDFOR»
«FOR p : properties»
super(«parentProperties.asArguments»);
«ENDIF»
«FOR p : allProperties»
- «generateRestrictions(type, p.fieldName.toString, p.returnType)»
+ «generateRestrictions(type, p.fieldName, p.returnType)»
«ENDFOR»
«/*
* If we have patterns, we need to apply them to the value field. This is a sad consequence of how this code is
«ENDIF»
«val fieldName = property.fieldName»
- «generateRestrictions(type, fieldName.toString, property.returnType)»
+ «generateRestrictions(type, fieldName, property.returnType)»
this.«fieldName» = «property.name»;
«FOR p : other»
public «type.name»(«propertyAndTopParentProperties.asArgumentsDeclaration») {
super(«parentProperties.asArguments»);
«IF restrictions !== null»
- «checkArgument(property, restrictions, actualType, property.fieldName.toString)»
+ «checkArgument(property, restrictions, actualType, property.fieldName)»
«ENDIF»
this.«property.fieldName» = «property.fieldName»;
«FOR other : finalProperties»