Class MapLiteral
java.lang.Object
org.apache.sling.scripting.sightly.compiler.expression.nodes.MapLiteral
- All Implemented Interfaces:
ExpressionNode
Defines a syntactical construction representing a map.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> Taccept(NodeVisitor<T> visitor) Accept a visitor to process this node.booleancontainsKey(String name) Checks if the map contains the property identified by the passed property name.getMap()Returns an unmodifiable view of the backing map.Returns anExpressionNodefrom the backing map.toString()
-
Constructor Details
-
MapLiteral
Creates a map representation.- Parameters:
map- the backingExpressionNodemap
-
-
Method Details
-
getMap
Returns an unmodifiable view of the backing map.- Returns:
- an unmodifiable view of the backing map
-
getValue
Returns anExpressionNodefrom the backing map.- Parameters:
key- the key under which the node is stored- Returns:
- the node, if one is stored under that key;
nullotherwise
-
containsKey
Checks if the map contains the property identified by the passed property name.- Parameters:
name- the property name- Returns:
trueif the map contains the property,falseotherwise
-
accept
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
-
toString
-