Class GetAttr

    • Method Detail

      • ofExpressions

        public static GetAttr ofExpressions​(ToExpression arg1,
                                            ToExpression arg2)
        Creates a GetAttr function from the given expressions.
        Parameters:
        arg1 - the argument to extract from.
        arg2 - the path to extract.
        Returns:
        The resulting GetAttr function.
      • ofExpressions

        public static GetAttr ofExpressions​(ToExpression arg1,
                                            java.lang.String arg2)
        Creates a GetAttr function from the given expressions.
        Parameters:
        arg1 - the argument to extract from.
        arg2 - the path to extract.
        Returns:
        The resulting GetAttr function.
      • evaluate

        public Value evaluate​(Value target)
        Gets the value at the defined path out of the target value.
        Parameters:
        target - the target value to retrieve a value out of.
        Returns:
        the retrieve value.
      • getTarget

        public Expression getTarget()
        Gets the expression to retrieve an attribute of.
        Returns:
        the expression targeted by this function.
      • getPath

        public java.util.List<GetAttr.Part> getPath()
        Gets the list of GetAttr.Parts that make up the path to the requested attribute.
        Returns:
        the list of path parts to the requested attribute.
      • accept

        public <R> R accept​(ExpressionVisitor<R> visitor)
        Description copied from class: Expression
        Invoke the ExpressionVisitor functions for this expression.
        Specified by:
        accept in class Expression
        Type Parameters:
        R - the visitor return type.
        Parameters:
        visitor - the visitor to be invoked.
        Returns:
        the return value of the visitor.
      • template

        public java.lang.String template()
        Description copied from class: SyntaxElement
        Converts this expression to a string template. By default, this implementation returns a RuntimeException.
        Overrides:
        template in class SyntaxElement
        Returns:
        the String template.