Package net.sf.saxon.value
Class Base64BinaryValue
java.lang.Object
net.sf.saxon.value.Value
net.sf.saxon.value.AtomicValue
net.sf.saxon.value.Base64BinaryValue
- All Implemented Interfaces:
Serializable
,Expression
,Item
,ValueRepresentation
A value of type xs:base64Binary
- See Also:
-
Field Summary
Fields inherited from class net.sf.saxon.value.Value
EMPTY_CLASS_ARRAY
Fields inherited from interface net.sf.saxon.expr.Expression
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD
Fields inherited from interface net.sf.saxon.om.ValueRepresentation
EMPTY_VALUE_ARRAY
-
Constructor Summary
ConstructorsConstructorDescriptionBase64BinaryValue
(byte[] value) Constructor: create a base64Binary value from a given array of bytesConstructor: create a base64Binary value from a supplied string in base64 encoding -
Method Summary
Modifier and TypeMethodDescriptionprotected static int
byteArrayHashCode
(byte[] value) convertPrimitive
(BuiltInAtomicType requiredType, boolean validate, XPathContext context) Convert to target data typeconvertToJava
(Class target, XPathContext context) Convert to Java object (for passing to external functions)boolean
Test if the two base64Binary values are equal.byte[]
Get the binary valueDetermine the data type of the exprssionint
Get the number of octets in the valueConvert to stringint
hashCode()
Return a hash code to support the equals() functionMethods inherited from class net.sf.saxon.value.AtomicValue
checkPermittedContents, convert, convert, display, effectiveBooleanValue, evaluateAsString, evaluateItem, getCardinality, getComponent, getImplementationMethod, getLength, getPrimitiveValue, getStringValueCS, getTypedValue, hasBuiltInType, iterate, process, toString
Methods inherited from class net.sf.saxon.value.Value
asItem, asIterator, asValue, convert, convertJavaObjectToXPath, getDependencies, getIterator, getParentExpression, getSpecialProperties, itemAt, iterateSubExpressions, makeQNameValue, optimize, promote, reduce, simplify, stringToNumber, typeCheck
-
Constructor Details
-
Base64BinaryValue
Constructor: create a base64Binary value from a supplied string in base64 encoding- Throws:
XPathException
-
Base64BinaryValue
public Base64BinaryValue(byte[] value) Constructor: create a base64Binary value from a given array of bytes
-
-
Method Details
-
getBinaryValue
public byte[] getBinaryValue()Get the binary value -
convertPrimitive
public AtomicValue convertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context) Convert to target data type- Specified by:
convertPrimitive
in classAtomicValue
- Parameters:
requiredType
- an integer identifying the required atomic typevalidate
- 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.context
-- Returns:
- an AtomicValue, a value of the required type; or an ErrorValue
-
getStringValue
Convert to string- Specified by:
getStringValue
in interfaceItem
- Specified by:
getStringValue
in interfaceValueRepresentation
- Specified by:
getStringValue
in classAtomicValue
- Returns:
- the canonical representation.
- See Also:
-
getLengthInOctets
public int getLengthInOctets()Get the number of octets in the value -
getItemType
Determine the data type of the exprssion- Specified by:
getItemType
in interfaceExpression
- Overrides:
getItemType
in classValue
- Parameters:
th
-- Returns:
- Type.BASE64_BINARY_TYPE
-
convertToJava
Convert to Java object (for passing to external functions)- Overrides:
convertToJava
in classValue
- Throws:
XPathException
-
equals
Test if the two base64Binary values are equal. -
hashCode
public int hashCode()Description copied from class:Value
Return a hash code to support the equals() function -
byteArrayHashCode
protected static int byteArrayHashCode(byte[] value)
-