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
ConstructorsConstructorDescriptionPropertyAccess(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> Taccept(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: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
-
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
-