grails.plugin.component.view.internal.ComponentViewsTransform.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of views-component Show documentation
Show all versions of views-component Show documentation
Grace Views : Views Component
The newest version!
package grails.plugin.component.view.internal
import grails.compiler.traits.TraitInjector
import grails.plugin.component.view.ComponentViewTemplate
import grails.views.compiler.ViewsTransform
import groovy.transform.CompileStatic
import groovy.transform.InheritConstructors
import org.codehaus.groovy.control.CompilePhase
import org.codehaus.groovy.transform.GroovyASTTransformation
import org.grails.core.io.support.GrailsFactoriesLoader
/**
* @author Graeme Rocher
* @since 1.0
*/
@GroovyASTTransformation(phase = CompilePhase.SEMANTIC_ANALYSIS)
@CompileStatic
@InheritConstructors
class ComponentViewsTransform extends ViewsTransform {
@Override
protected List findTraitInjectors() {
def injectors = super.findTraitInjectors()
injectors += GrailsFactoriesLoader.loadFactories(TraitInjector).findAll() { TraitInjector ti ->
ti.artefactTypes.contains(ComponentViewTemplate.TYPE)
}
return injectors
}
}