Class ArtefactTypeAstTransformation

  • All Implemented Interfaces:
    groovy.transform.CompilationUnitAware, org.codehaus.groovy.transform.ASTTransformation

    public class ArtefactTypeAstTransformation
    extends AbstractArtefactTypeAstTransformation
    implements groovy.transform.CompilationUnitAware
    A transformation used to apply transformers to classes not located in Grails directory structure. For example any class can be annotated with @Artefact("Controller") to make it into a controller no matter what the location.
    Since:
    2.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.codehaus.groovy.control.CompilationUnit compilationUnit  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static void doPerformInjectionOnArtefactType​(org.codehaus.groovy.control.SourceUnit sourceUnit, org.codehaus.groovy.ast.ClassNode cNode, java.lang.String artefactType)
      Deprecated.
      static java.util.List<ClassInjector> findInjectors​(java.lang.String artefactType, ClassInjector[] classInjectors)  
      protected org.codehaus.groovy.ast.ClassNode getAnnotationType()  
      protected java.lang.Class getAnnotationTypeClass()  
      protected java.lang.Class<?> getAstAppliedMarkerClass()  
      static boolean hasArtefactType​(java.lang.String artefactType, GrailsArtefactClassInjector gace)  
      protected boolean isApplied​(org.codehaus.groovy.ast.ClassNode cNode)  
      protected boolean isArtefactAnnotationNode​(org.codehaus.groovy.ast.AnnotationNode annotationNode)  
      protected void markApplied​(org.codehaus.groovy.ast.ClassNode classNode)  
      static void performInjection​(org.codehaus.groovy.control.SourceUnit sourceUnit, org.codehaus.groovy.ast.ClassNode cNode, java.util.Collection<ClassInjector> injectors)  
      void performInjectionOnArtefactType​(org.codehaus.groovy.control.SourceUnit sourceUnit, org.codehaus.groovy.ast.ClassNode cNode, java.lang.String artefactType)  
      protected void performTraitInjectionOnArtefactType​(org.codehaus.groovy.control.SourceUnit sourceUnit, org.codehaus.groovy.ast.ClassNode cNode, java.lang.String artefactType)  
      protected void postProcess​(org.codehaus.groovy.control.SourceUnit sourceUnit, org.codehaus.groovy.ast.AnnotationNode annotationNode, org.codehaus.groovy.ast.ClassNode classNode, java.lang.String artefactType)  
      protected java.lang.String resolveArtefactType​(org.codehaus.groovy.control.SourceUnit sourceUnit, org.codehaus.groovy.ast.AnnotationNode annotationNode, org.codehaus.groovy.ast.ClassNode classNode)  
      void setCompilationUnit​(org.codehaus.groovy.control.CompilationUnit unit)  
      void visit​(org.codehaus.groovy.ast.ASTNode[] astNodes, org.codehaus.groovy.control.SourceUnit sourceUnit)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • compilationUnit

        protected org.codehaus.groovy.control.CompilationUnit compilationUnit
    • Constructor Detail

      • ArtefactTypeAstTransformation

        public ArtefactTypeAstTransformation()
    • Method Detail

      • visit

        public void visit​(org.codehaus.groovy.ast.ASTNode[] astNodes,
                          org.codehaus.groovy.control.SourceUnit sourceUnit)
        Specified by:
        visit in interface org.codehaus.groovy.transform.ASTTransformation
      • performTraitInjectionOnArtefactType

        protected void performTraitInjectionOnArtefactType​(org.codehaus.groovy.control.SourceUnit sourceUnit,
                                                           org.codehaus.groovy.ast.ClassNode cNode,
                                                           java.lang.String artefactType)
      • isApplied

        protected boolean isApplied​(org.codehaus.groovy.ast.ClassNode cNode)
      • markApplied

        protected void markApplied​(org.codehaus.groovy.ast.ClassNode classNode)
      • getAstAppliedMarkerClass

        protected java.lang.Class<?> getAstAppliedMarkerClass()
      • postProcess

        protected void postProcess​(org.codehaus.groovy.control.SourceUnit sourceUnit,
                                   org.codehaus.groovy.ast.AnnotationNode annotationNode,
                                   org.codehaus.groovy.ast.ClassNode classNode,
                                   java.lang.String artefactType)
      • resolveArtefactType

        protected java.lang.String resolveArtefactType​(org.codehaus.groovy.control.SourceUnit sourceUnit,
                                                       org.codehaus.groovy.ast.AnnotationNode annotationNode,
                                                       org.codehaus.groovy.ast.ClassNode classNode)
      • isArtefactAnnotationNode

        protected boolean isArtefactAnnotationNode​(org.codehaus.groovy.ast.AnnotationNode annotationNode)
      • getAnnotationType

        protected org.codehaus.groovy.ast.ClassNode getAnnotationType()
      • getAnnotationTypeClass

        protected java.lang.Class getAnnotationTypeClass()
      • doPerformInjectionOnArtefactType

        @Deprecated
        public static void doPerformInjectionOnArtefactType​(org.codehaus.groovy.control.SourceUnit sourceUnit,
                                                            org.codehaus.groovy.ast.ClassNode cNode,
                                                            java.lang.String artefactType)
        Deprecated.
      • performInjection

        public static void performInjection​(org.codehaus.groovy.control.SourceUnit sourceUnit,
                                            org.codehaus.groovy.ast.ClassNode cNode,
                                            java.util.Collection<ClassInjector> injectors)
      • findInjectors

        public static java.util.List<ClassInjector> findInjectors​(java.lang.String artefactType,
                                                                  ClassInjector[] classInjectors)
      • setCompilationUnit

        public void setCompilationUnit​(org.codehaus.groovy.control.CompilationUnit unit)
        Specified by:
        setCompilationUnit in interface groovy.transform.CompilationUnitAware