Class RuntimeCall
- java.lang.Object
-
- org.apache.sling.scripting.sightly.compiler.expression.nodes.RuntimeCall
-
- All Implemented Interfaces:
ExpressionNode
public final class RuntimeCall extends java.lang.Object implements ExpressionNode
ARuntimeCallis a special expression which provides access to utility functions from the runtime.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringFORMATThe name of theRuntimeCallfunction that will process string formatting.static java.lang.StringI18NThe name of theRuntimeCallfunction that will process i18n.static java.lang.StringINCLUDEThe name of theRuntimeCallfunction that will perform script execution delegation.static java.lang.StringJOINThe name of theRuntimeCallfunction that will process join operations on arrays.static java.lang.StringRESOURCEThe name of theRuntimeCallfunction that will perform resource inclusion in the rendering process.static java.lang.StringURI_MANIPULATIONThe name of theRuntimeCallfunction that will provide URI manipulation support.static java.lang.StringUSEThe name of theRuntimeCallfunction that will provide the support for loading Use-API objects.static java.lang.StringXSSThe name of theRuntimeCallfunction that will provide XSS escaping and filtering support.
-
Constructor Summary
Constructors Constructor Description RuntimeCall(java.lang.String functionName, java.util.List<ExpressionNode> arguments)Creates aRuntimeCallbased on afunctionNameand a list ofarguments.RuntimeCall(java.lang.String functionName, ExpressionNode... arguments)Creates aRuntimeCallbased on afunctionNameand an array ofarguments.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Taccept(NodeVisitor<T> visitor)Accept a visitor to process this node.java.util.List<ExpressionNode>getArguments()Get the nodes of the argument calls.java.lang.StringgetFunctionName()Get the name of the runtime call.
-
-
-
Field Detail
-
FORMAT
public static final java.lang.String FORMAT
The name of the
RuntimeCallfunction that will process string formatting. The function will receive the following parameters:- the format String (e.g. 'Hello {0}, welcome to {1}')
- an array of objects that will replace the format placeholders
For more details check https://github.com/Adobe-Marketing-Cloud/htl-spec/blob/1.2/SPECIFICATION.md#122-format.
- See Also:
- Constant Field Values
-
I18N
public static final java.lang.String I18N
The name of the
RuntimeCallfunction that will process i18n. The function will receive the following parameters:- the String to translate
- optional: locale information
- optional: hint information
- optional (not part of the specification): basename information; for more details see
ResourceBundle.getBundle(String, java.util.Locale)
For more details check https://github.com/Adobe-Marketing-Cloud/htl-spec/blob/1.2/SPECIFICATION.md#123-i18n.
- See Also:
- Constant Field Values
-
JOIN
public static final java.lang.String JOIN
The name of the
RuntimeCallfunction that will process join operations on arrays. The function will receive the following parameters:- the array of objects to join (e.g. [1, 2, 3])
- the join string (e.g. ';')
For more details check https://github.com/Adobe-Marketing-Cloud/htl-spec/blob/1.2/SPECIFICATION.md#124-array-join.
- See Also:
- Constant Field Values
-
URI_MANIPULATION
public static final java.lang.String URI_MANIPULATION
The name of the
RuntimeCallfunction that will provide URI manipulation support. The function will receive the following parameters:- optional: a URI string to process
- optional: a Map containing URI manipulation options
For more details check https://github.com/Adobe-Marketing-Cloud/htl-spec/blob/1.2/SPECIFICATION.md#125-uri-manipulation.
- See Also:
- Constant Field Values
-
XSS
public static final java.lang.String XSS
The name of the
RuntimeCallfunction that will provide XSS escaping and filtering support. The function will receive the following parameters:- the original string to escape / filter
- the context to be applied - see
MarkupContext
For more details check https://github.com/Adobe-Marketing-Cloud/htl-spec/blob/1.2/SPECIFICATION.md#121-display-context.
- See Also:
- Constant Field Values
-
INCLUDE
public static final java.lang.String INCLUDE
The name of the
RuntimeCallfunction that will perform script execution delegation. The function will receive the following parameters:- optional: the relative or absolute path of the script to execute
- optional: a Map of options to perform script include processing
For more details about the supported options check https://github.com/Adobe-Marketing-Cloud/htl-spec/blob/1.2/SPECIFICATION.md#228-include.
- See Also:
- Constant Field Values
-
RESOURCE
public static final java.lang.String RESOURCE
The name of the
RuntimeCallfunction that will perform resource inclusion in the rendering process. The function will receive the following parameters:- optional: a relative or absolute path of the resource to be included
- optional: a Map containing the resource processing options
For more details about the supported options check https://github.com/Adobe-Marketing-Cloud/htl-spec/blob/1.2/SPECIFICATION.md#229-resource.
- See Also:
- Constant Field Values
-
USE
public static final java.lang.String USE
The name of the
RuntimeCallfunction that will provide the support for loading Use-API objects. The function will receive the following parameters:- an identifier that allows to discover the Use-API object that needs to be loaded
- optional: a Map of the arguments that are passed to the Use-API object for initialisation or to provide context
For more details check https://github.com/Adobe-Marketing-Cloud/htl-spec/blob/1.2/SPECIFICATION.md#221-use.
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RuntimeCall
public RuntimeCall(java.lang.String functionName, ExpressionNode... arguments)Creates aRuntimeCallbased on afunctionNameand an array ofarguments.- Parameters:
functionName- the name of the function identifying the runtime callarguments- the arguments passed to the runtime call
-
RuntimeCall
public RuntimeCall(java.lang.String functionName, java.util.List<ExpressionNode> arguments)Creates aRuntimeCallbased on afunctionNameand a list ofarguments.- Parameters:
functionName- the name of the function identifying the runtime callarguments- the arguments passed to the runtime call
-
-
Method Detail
-
getFunctionName
public java.lang.String getFunctionName()
Get the name of the runtime call.- Returns:
- the name of the runtime call
-
getArguments
public java.util.List<ExpressionNode> getArguments()
Get the nodes of the argument calls.- Returns:
- the arguments list
-
accept
public <T> T accept(NodeVisitor<T> visitor)
Description copied from interface:ExpressionNodeAccept a visitor to process this node.- Specified by:
acceptin interfaceExpressionNode- Type Parameters:
T- the type of the visitor- Parameters:
visitor- The visitor- Returns:
- the node after it has been evaluated by the visitor
-
-