Class ContextStack

    • Constructor Detail

      • ContextStack

        public ContextStack​(SymbolResolver symbols)
        Creates a new ContextStack.
        Parameters:
        symbols - the SymbolMap is used to resolve fieldIds and nodeIds.
    • Method Detail

      • pushFieldContext

        public Context.FieldContext pushFieldContext​(String fieldId)
        Creates a new Context for the given field and places it at the top of the stack. The new Context is determined by the field itself, and it is made to be relative to the one currently at the top of the stack (or absolute if the stack is empty).
      • pushNodeContext

        public Context.NodeContext pushNodeContext​(String nodeId)
        Creates a new Context for the given node and places it at the top of the stack. The new Context is relative to the one currently at the top of the stack (or absolute if the stack is empty).
      • isFieldContext

        public Boolean isFieldContext()
        Returns true if the context at the top of the stack is a Context.FieldContext. Does not remove the context from the stack.
      • isNodeContext

        public Boolean isNodeContext()
        Returns true if the context at the top of the stack is a Context.NodeContext. Does not remove the context from the stack.
      • symbol

        public String symbol()
        Returns the [field or node] identifier that was used to create the context that is currently at the top of the stack. Does not remove the context from the stack.
      • absolutePath

        public Expression.PathExpression absolutePath()
        Returns the absolute path of the context that is currently at the top of the stack. Does not remove the context from the stack.
      • relativePath

        public Expression.PathExpression relativePath()
        Returns the relative path of the context that is currently at the top of the stack. Does not remove the context from the stack.