@groovy.transform.CompileStatic abstract class AbstractMemberDefinition extends java.lang.Object
Abstract base class for domain class member definitions (properties and fields). Contains shared logic for validation, constraints, and annotation generation.
| Modifiers | Name | Description |
|---|---|---|
static enum |
AbstractMemberDefinition.ConstraintStyle |
Constraint style options for member validation. |
| Type | Name and description |
|---|---|
static java.util.Set<java.lang.String> |
BUILTIN_TYPESBuilt-in types that don't require imports. |
java.lang.Boolean |
blank |
AbstractMemberDefinition.ConstraintStyle |
constraintStyle |
java.lang.Integer |
maxSize |
java.lang.Integer |
minSize |
java.lang.String |
name |
java.lang.Boolean |
nullable |
java.lang.String |
type |
| Constructor and description |
|---|
AbstractMemberDefinition() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected abstract java.lang.String |
getMemberType()Returns the member type name for error messages (e.g., "Property" or "Field"). |
|
java.util.Set<java.lang.String> |
getRequiredImports()Gets the required import statements for Jakarta Validation annotations. |
|
boolean |
isBuiltinType()Checks if the type is a built-in type that doesn't require imports. |
|
protected static boolean |
isValidTypeName(java.lang.String typeName)Validates that a type name looks like a valid class/type name. |
|
java.util.List<java.lang.String> |
toAnnotations()Generates Jakarta Validation annotations for the member. |
|
java.lang.String |
toConstraintLine()Generates the constraint line for the constraints block. |
|
abstract java.lang.String |
toDeclaration()Generates the declaration line for the domain class. |
|
boolean |
usesGrailsConstraints()Determines if this member should use Grails constraints. |
|
boolean |
usesJakartaAnnotations()Determines if this member should use Jakarta annotations. |
|
void |
validate()Validates the member definition. |
| 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) |
Built-in types that don't require imports.
Returns the member type name for error messages (e.g., "Property" or "Field").
Gets the required import statements for Jakarta Validation annotations.
Checks if the type is a built-in type that doesn't require imports.
Validates that a type name looks like a valid class/type name.
Allows simple names (String), qualified names (java.util.Date), and generics (List<Book>).
Generates Jakarta Validation annotations for the member. Returns an empty list if no annotations are needed.
Generates the constraint line for the constraints block. Returns null if no constraints are needed.
Generates the declaration line for the domain class.
Determines if this member should use Grails constraints.
Determines if this member should use Jakarta annotations.
Validates the member definition.