Class RelationQueryNode

    • Field Detail

      • STAR_NAME_TEST

        public static final Name STAR_NAME_TEST
        Acts as an synthetic placeholder for a location step that matches any name. This is required because a JCR path does not allow a Name with a single '*' (star) character.
    • Constructor Detail

      • RelationQueryNode

        protected RelationQueryNode​(QueryNode parent,
                                    int operation,
                                    QueryNodeFactory factory)
        Creates a new RelationQueryNode without a type nor value assigned.
        Parameters:
        parent - the parent node for this query node.
        operation - the operation.
        factory - the query node factory.
    • Method Detail

      • getType

        public int getType()
        Returns the type of this node.
        Specified by:
        getType in class QueryNode
        Returns:
        the type of this node.
      • setUnaryMinus

        public void setUnaryMinus​(boolean b)
        If b is true then the value in this relation node contains a receding unary minus.
        Parameters:
        b - true if this relation contains a unary minus.
      • getValueType

        public int getValueType()
        Returns the type of the value.
        Returns:
        the type of the value.
      • getRelativePath

        public PathQueryNode getRelativePath()
        Returns:
        the relative path that references the property in this relation.
      • setRelativePath

        public void setRelativePath​(Path relPath)
        Sets the relative path to the property in this relation.
        Parameters:
        relPath - the relative path to a property.
        Throws:
        IllegalArgumentException - if relPath is absolute.
      • addPathElement

        public void addPathElement​(Path.Element element)
        Adds a path element to the existing relative path. To add a path element which matches all node names use STAR_NAME_TEST.
        Parameters:
        element - the path element to append.
      • getLongValue

        public long getLongValue()
        Returns the long value if this relation if of type QueryConstants.TYPE_LONG.
        Returns:
        the long value.
      • setLongValue

        public void setLongValue​(long value)
        Sets a new value of type long.
        Parameters:
        value - the new value.
      • getPositionValue

        public int getPositionValue()
        Returns the int position index value if this relation is of type QueryConstants.TYPE_POSITION.
        Returns:
        the position index value.
      • setPositionValue

        public void setPositionValue​(int value)
        Sets a new value for the position index.
        Parameters:
        value - the new value.
      • getDoubleValue

        public double getDoubleValue()
        Returns the double value if this relation if of type QueryConstants.TYPE_DOUBLE.
        Returns:
        the double value.
      • setDoubleValue

        public void setDoubleValue​(double value)
        Sets a new value of type double.
        Parameters:
        value - the new value.
      • setStringValue

        public void setStringValue​(String value)
        Sets a new value of type String.
        Parameters:
        value - the new value.
      • getDateValue

        public Date getDateValue()
        Returns the Date value if this relation if of type QueryConstants.TYPE_DATE.
        Returns:
        the Date value.
      • setDateValue

        public void setDateValue​(Date value)
        Sets a new value of type Date.
        Parameters:
        value - the new value.
      • getOperation

        public int getOperation()
        Returns the operation type.
        Returns:
        the operation type.
      • equals

        public boolean equals​(Object obj)
        Returns true if obj is the same type of QueryNode as this node and is equal to this node.
        Overrides:
        equals in class NAryQueryNode<QueryNode>
        Parameters:
        obj - the reference object with which to compare.
        Returns:
        true if obj is equal to this; false otherwise.