@AstTransformer public class DefaultGrailsDomainClassInjector extends java.lang.Object implements GrailsArtefactClassInjector, GrailsDomainClassInjector
Default implementation of domain class injector interface that adds the 'id' and 'version' properties and other previously boilerplate code.
Modifiers | Name | Description |
---|---|---|
private java.util.List<org.codehaus.groovy.ast.ClassNode> |
classesWithInjectedToString |
Type Params | Return Type | Name and description |
---|---|---|
|
private void |
addAssociationForKey(java.lang.String key, java.util.List<org.codehaus.groovy.ast.PropertyNode> properties, org.codehaus.groovy.ast.ClassNode declaringType, org.codehaus.groovy.ast.ClassNode propertyType) |
|
private java.util.Collection<org.codehaus.groovy.ast.PropertyNode> |
createPropertiesForBelongsToOrHasOneExpression(org.codehaus.groovy.ast.expr.Expression e, org.codehaus.groovy.ast.ClassNode classNode) |
|
private java.util.List<org.codehaus.groovy.ast.PropertyNode> |
createPropertiesForHasManyExpression(org.codehaus.groovy.ast.expr.Expression e, org.codehaus.groovy.ast.ClassNode classNode) |
|
private org.codehaus.groovy.ast.ClassNode |
findPropertyType(org.codehaus.groovy.ast.expr.Expression expression) Finds the type of the generated property. |
|
public java.lang.String[] |
getArtefactTypes() |
|
private java.lang.String |
getMappingFileName(java.lang.String className) Returns the ORM framework's mapping file name for the specified class name. |
|
private void |
injectAssociationProperties(org.codehaus.groovy.ast.ClassNode classNode, java.util.List<org.codehaus.groovy.ast.PropertyNode> propertiesToAdd) |
|
private void |
injectAssociations(org.codehaus.groovy.ast.ClassNode classNode) |
|
private void |
injectIdProperty(org.codehaus.groovy.ast.ClassNode classNode) |
|
private void |
injectToStringMethod(org.codehaus.groovy.ast.ClassNode classNode) |
|
private void |
injectVersionProperty(org.codehaus.groovy.ast.ClassNode classNode) |
|
private boolean |
isEnum(org.codehaus.groovy.ast.ClassNode classNode) |
|
public void |
performInjection(org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.classgen.GeneratorContext context, org.codehaus.groovy.ast.ClassNode classNode) |
|
public void |
performInjection(org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.ast.ClassNode classNode) |
|
public void |
performInjectionOnAnnotatedClass(org.codehaus.groovy.control.SourceUnit source, org.codehaus.groovy.ast.ClassNode classNode) |
|
public void |
performInjectionOnAnnotatedEntity(org.codehaus.groovy.ast.ClassNode classNode) |
|
public boolean |
shouldInject(java.net.URL url) |
|
protected boolean |
shouldInjectClass(org.codehaus.groovy.ast.ClassNode classNode) |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Finds the type of the generated property. The type will be a java.util.Set that is parameterized by the type of the expression passed in.
expression
- the expression used to parameterize the java.util.Set. Only used if a org.codehaus.groovy.ast.expr.ClassExpression. Otherwise ignored.Returns the ORM framework's mapping file name for the specified class name.
className
- The class name of the mapped file