Search in sources :

Example 1 with PluginCallInfo

use of org.apache.sling.scripting.sightly.impl.plugin.PluginCallInfo in project sling by apache.

the class MarkupHandler method handlePlugin.

private void handlePlugin(String name, String value, ElementContext context) {
    PluginCallInfo callInfo = Syntax.parsePluginAttribute(name);
    if (callInfo != null) {
        Plugin plugin = obtainPlugin(callInfo.getName());
        ExpressionContext expressionContext = ExpressionContext.getContextForPlugin(plugin.name());
        Expression expr = expressionWrapper.transform(expressionParser.parseInterpolation(value), null, expressionContext);
        PluginInvoke invoke = plugin.invoke(expr, callInfo, compilerContext);
        context.addPlugin(invoke, plugin.priority());
        context.addPluginCall(name, callInfo, expr);
    }
}
Also used : PluginCallInfo(org.apache.sling.scripting.sightly.impl.plugin.PluginCallInfo) PluginInvoke(org.apache.sling.scripting.sightly.impl.plugin.PluginInvoke) ExpressionContext(org.apache.sling.scripting.sightly.impl.filter.ExpressionContext) Expression(org.apache.sling.scripting.sightly.compiler.expression.Expression) Plugin(org.apache.sling.scripting.sightly.impl.plugin.Plugin)

Aggregations

Expression (org.apache.sling.scripting.sightly.compiler.expression.Expression)1 ExpressionContext (org.apache.sling.scripting.sightly.impl.filter.ExpressionContext)1 Plugin (org.apache.sling.scripting.sightly.impl.plugin.Plugin)1 PluginCallInfo (org.apache.sling.scripting.sightly.impl.plugin.PluginCallInfo)1 PluginInvoke (org.apache.sling.scripting.sightly.impl.plugin.PluginInvoke)1