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.
    • Method Detail

      • accept

        public java.lang.Object accept​(QueryNodeVisitor visitor,
                                       java.lang.Object data)
                                throws RepositoryException
        Accepts a QueryNodeVisitor and calls the appropriate visit method on the visitor depending on the concrete implementation of this QueryNode.
        Specified by:
        accept in class QueryNode
        Parameters:
        visitor - the visitor to call back.
        data - arbitrary data for the visitor.
        Returns:
        the return value of the visitor.visit() call.
        Throws:
        RepositoryException
      • 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:
        java.lang.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.
      • getStringValue

        public java.lang.String getStringValue()
        Returns the String value if this relation if of type QueryConstants.TYPE_STRING.
        Returns:
        the String value.
      • setStringValue

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

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

        public void setDateValue​(java.util.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​(java.lang.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.