Enum Operator

    • Method Detail

      • values

        public static Operator[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Operator c : Operator.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Operator valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • formatXpath

        public String formatXpath​(String a,
                                  String b)
        Formats an XPath constraint with this operator and the given operands. The operands are simply used as-is, without any quoting or escaping.
        Parameters:
        a - first operand
        b - second operand
        Returns:
        XPath constraint, a op b or jcr:like(a, b) for LIKE
      • formatSql

        public String formatSql​(String a,
                                String b)
        Formats an SQL constraint with this operator and the given operands. The operands are simply used as-is, without any quoting or escaping.
        Parameters:
        a - first operand
        b - second operand
        Returns:
        SQL constraint, a op b
      • getAllQueryOperators

        public static String[] getAllQueryOperators()
        Returns an array of the names of all the JCR 2.0 query operators.
        Returns:
        names of all query operators
      • getOperatorByName

        public static Operator getOperatorByName​(String name)
                                          throws RepositoryException
        Returns the operator with the given JCR name.
        Parameters:
        name - JCR name of an operator
        Returns:
        operator with the given name
        Throws:
        RepositoryException - if the given name is unknown