public final class BooleanValue extends AtomicValue implements Comparable
Modifier and Type | Field and Description |
---|---|
static BooleanValue |
FALSE
The boolean value FALSE
|
static BooleanValue |
TRUE
The boolean value TRUE
|
EMPTY_CLASS_ARRAY
EMPTY_VALUE_ARRAY
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Object other)
Compare the value to another boolean value
|
AtomicValue |
convertPrimitive(BuiltInAtomicType requiredType,
boolean validate,
XPathContext context)
Convert to target data type
|
Object |
convertToJava(Class target,
XPathContext context)
Convert to Java object (for passing to external functions)
|
boolean |
effectiveBooleanValue(XPathContext context)
Get the effective boolean value of this expression
|
boolean |
equals(Object other)
Determine whether two boolean values are equal
|
static AtomicValue |
fromString(CharSequence s)
Convert a string to a boolean value, using the XML Schema rules (including
whitespace trimming)
|
static BooleanValue |
get(boolean value)
Factory method: get a BooleanValue
|
boolean |
getBooleanValue()
Get the value
|
ItemType |
getItemType(TypeHierarchy th)
Determine the data type of the expression
|
String |
getStringValue()
Convert to string
|
int |
hashCode()
Get a hash code for comparing two BooleanValues
|
String |
toString()
Diagnostic display of this value as a string
|
checkPermittedContents, convert, convert, display, evaluateAsString, evaluateItem, getCardinality, getComponent, getImplementationMethod, getLength, getPrimitiveValue, getStringValueCS, getTypedValue, hasBuiltInType, iterate, process, schemaEquals
asItem, asIterator, asValue, collapseWhitespace, convert, convertJavaObjectToXPath, getDependencies, getIterator, getParentExpression, getSpecialProperties, itemAt, iterateSubExpressions, makeQNameValue, normalizeWhitespace, optimize, promote, reduce, simplify, stringToNumber, trimWhitespace, typeCheck
public static final BooleanValue TRUE
public static final BooleanValue FALSE
public static BooleanValue get(boolean value)
value
- true or false, to determine which boolean value is
requiredpublic static AtomicValue fromString(CharSequence s)
s
- the input stringpublic boolean getBooleanValue()
public boolean effectiveBooleanValue(XPathContext context)
effectiveBooleanValue
in interface Expression
effectiveBooleanValue
in class AtomicValue
context
- dynamic evaluation context, not used in this
implementationpublic AtomicValue convertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)
convertPrimitive
in class AtomicValue
requiredType
- an integer identifying the required atomic typecontext
- validate
- true if validation is required. If set to false, the caller guarantees that
the value is valid for the target data type, and that further validation is therefore not required.
Note that a validation failure may be reported even if validation was not requested.public String getStringValue()
getStringValue
in interface Item
getStringValue
in interface ValueRepresentation
getStringValue
in class AtomicValue
Item.getStringValueCS()
public ItemType getItemType(TypeHierarchy th)
getItemType
in interface Expression
getItemType
in class Value
th
- public Object convertToJava(Class target, XPathContext context) throws XPathException
convertToJava
in class Value
target
- the Java class to which conversion is requiredXPathException
- if conversion is not possible or failspublic int compareTo(Object other)
compareTo
in interface Comparable
other
- The other boolean valueClassCastException
- if the other value is not a BooleanValue
(the parameter is declared as Object to satisfy the Comparable
interface)public boolean equals(Object other)
public int hashCode()
public String toString()
toString
in class AtomicValue