Class BooleanValue


  • public final class BooleanValue
    extends Value
    A boolean XPath value
    • Constructor Detail

      • BooleanValue

        public BooleanValue​(boolean value)
        Constructor: create a boolean value
        Parameters:
        value - the initial value, true or false
    • Method Detail

      • asString

        public java.lang.String asString()
        Convert to string
        Specified by:
        asString in class Value
        Returns:
        "true" or "false"
      • asNumber

        public double asNumber()
        Convert to number
        Specified by:
        asNumber in class Value
        Returns:
        1 for true, 0 for false
      • asBoolean

        public boolean asBoolean()
        Convert to boolean (null operation)
        Specified by:
        asBoolean in class Value
        Returns:
        the value
      • getDataType

        public int getDataType()
        Determine the data type of the exprssion
        Specified by:
        getDataType in class Expression
        Returns:
        Value.BOOLEAN,
      • conversionPreference

        public int conversionPreference​(java.lang.Class required)
        Get conversion preference for this value to a Java class. A low result indicates higher preference.
        Specified by:
        conversionPreference in class Value
      • convertToJava

        public java.lang.Object convertToJava​(java.lang.Class target)
                                       throws XPathException
        Convert to Java object (for passing to external functions)
        Specified by:
        convertToJava in class Value
        Parameters:
        target - The class required by the external function
        Returns:
        an object of the target class
        Throws:
        XPathException
      • display

        public void display​(int level)
        Diagnostic print of expression structure
        Specified by:
        display in class Expression