@groovy.transform.CompileStatic class DomainFieldModifier extends java.lang.Object
Utility class for modifying domain class source files to add properties and fields.
| Constructor and description |
|---|
DomainFieldModifier() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
void |
addField(java.io.File domainFile, FieldDefinition field)Adds a field to the domain class file. |
|
void |
addMember(java.io.File domainFile, AbstractMemberDefinition member)Adds a member (property or field) to the domain class file. |
|
void |
addProperty(java.io.File domainFile, PropertyDefinition property)Adds a property to the domain class file. |
|
java.io.File |
findDomainFile(java.io.File projectDir, java.lang.String className)Finds the domain class file for the given class name. |
|
boolean |
memberExists(java.io.File domainFile, java.lang.String memberName)Checks if a member (property or field) with the given name already exists in the domain class. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
Adds a field to the domain class file.
domainFile - the domain class filefield - the field definition to addAdds a member (property or field) to the domain class file.
domainFile - the domain class filemember - the member definition to addAdds a property to the domain class file.
domainFile - the domain class fileproperty - the property definition to addFinds the domain class file for the given class name.
projectDir - the project root directoryclassName - the simple class name or fully qualified class nameChecks if a member (property or field) with the given name already exists in the domain class.
domainFile - the domain class filememberName - the member name to check