Class PropertyAccess
java.lang.Object
org.apache.sling.scripting.sightly.compiler.expression.nodes.PropertyAccess
- All Implemented Interfaces:
ExpressionNode
Defines an expression in which an object is queried for a specific property (e.g.
obj.prop
).-
Constructor Summary
ConstructorDescriptionPropertyAccess
(ExpressionNode target, Iterable<String> properties) Builds a chained property access node with the given target and the specified properties.PropertyAccess
(ExpressionNode target, String property) Creates a property access node.PropertyAccess
(ExpressionNode target, ExpressionNode property) Creates a property access node. -
Method Summary
Modifier and TypeMethodDescription<T> T
accept
(NodeVisitor<T> visitor) Accept a visitor to process this node.Returns the expression node identifying the accessed property.The object being accessed.toString()
-
Constructor Details
-
PropertyAccess
Creates a property access node.- Parameters:
target
- the expression for the object being accessedproperty
- the expression identifying the object's accessed property
-
PropertyAccess
Creates a property access node.- Parameters:
target
- the expression for the object being accessedproperty
- the name of the accessed property
-
PropertyAccess
Builds a chained property access node with the given target and the specified properties.- Parameters:
target
- the target nodeproperties
- a non-empty list of property names- Throws:
IllegalArgumentException
- if the list of properties is empty
-
-
Method Details
-
accept
Description copied from interface:ExpressionNode
Accept a visitor to process this node.- Specified by:
accept
in interfaceExpressionNode
- Type Parameters:
T
- the type of the visitor- Parameters:
visitor
- The visitor- Returns:
- the node after it has been evaluated by the visitor
-
getTarget
The object being accessed.- Returns:
- a node representing the object being accessed
-
getProperty
Returns the expression node identifying the accessed property.- Returns:
- the expression node identifying the accessed property
-
toString
-