Search in sources :

Example 1 with SecureASTCustomizer

use of org.codehaus.groovy.control.customizers.SecureASTCustomizer in project groovy-core by groovy.

the class SecureASTCustomizerFactory method onNodeChildren.

@Override
public boolean onNodeChildren(final FactoryBuilderSupport builder, final Object node, final Closure childContent) {
    if (node instanceof SecureASTCustomizer) {
        Closure clone = (Closure) childContent.clone();
        clone.setDelegate(node);
        clone.call();
    }
    return false;
}
Also used : SecureASTCustomizer(org.codehaus.groovy.control.customizers.SecureASTCustomizer) Closure(groovy.lang.Closure)

Example 2 with SecureASTCustomizer

use of org.codehaus.groovy.control.customizers.SecureASTCustomizer in project groovy by apache.

the class SecureASTCustomizerFactory method onNodeChildren.

@Override
public boolean onNodeChildren(final FactoryBuilderSupport builder, final Object node, final Closure childContent) {
    if (node instanceof SecureASTCustomizer) {
        Closure clone = (Closure) childContent.clone();
        clone.setDelegate(node);
        clone.setResolveStrategy(Closure.DELEGATE_FIRST);
        clone.call();
    }
    return false;
}
Also used : SecureASTCustomizer(org.codehaus.groovy.control.customizers.SecureASTCustomizer) Closure(groovy.lang.Closure)

Aggregations

Closure (groovy.lang.Closure)2 SecureASTCustomizer (org.codehaus.groovy.control.customizers.SecureASTCustomizer)2