Package net.sf.saxon.value
Class Base64BinaryValue
java.lang.Object
net.sf.saxon.value.AtomicValue
net.sf.saxon.value.BinaryValue
net.sf.saxon.value.Base64BinaryValue
- All Implemented Interfaces:
Comparable<XPathComparable>,Iterable<AtomicValue>,AtomicMatchKey,XPathComparable,AtomicSequence,GroundedValue,IdentityComparable,Item,Sequence,ConversionResult
A value of type xs:base64Binary
-
Field Summary
Fields inherited from class net.sf.saxon.value.BinaryValue
binaryValueFields inherited from class net.sf.saxon.value.AtomicValue
metadata -
Constructor Summary
ConstructorsConstructorDescriptionBase64BinaryValue(byte[] value) Constructor: create a base64Binary value from a given array of bytesBase64BinaryValue(byte[] value, AtomicMetadata metadata) 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 TypeMethodDescriptionintstatic byte[]decode(UnicodeString in) Decode a character string in base64 notation to yield the encoded octetsstatic UnicodeStringencode(byte[] value) Encode a byte sequence into base64 representationConvert to stringDetermine the primitive type of the value.withMetadata(AtomicMetadata metadata) Create a copy of this atomic value (usually so that the type label can be changed).Methods inherited from class net.sf.saxon.value.BinaryValue
asMapKey, byteArrayHashCode, equals, getBinaryValue, getLengthInOctets, getXPathComparable, getXPathMatchKey, hashCode, startsWithMethods inherited from class net.sf.saxon.value.AtomicValue
asAtomic, atomize, checkPermittedContents, checkValidInJavascript, effectiveBooleanValue, getCanonicalLexicalRepresentation, getCardinality, getComponent, getGenre, getItemType, getLabel, getLength, getUnicodeStringValue, getUType, head, identityHashCode, isIdentical, isIdentical, isNaN, isUntypedAtomic, itemAt, iterate, iterator, show, toShortString, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.sf.saxon.expr.sort.AtomicMatchKey
asAtomic, longHashCodeMethods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, materializeMethods inherited from interface net.sf.saxon.om.Item
getStringValue, isStreamed, reduce, subsequenceMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
Constructor Details
-
Base64BinaryValue
Constructor: create a base64Binary value from a supplied string in base64 encoding- Parameters:
s- the lexical representation of the base64 binary value. There is no requirement that whitespace should already be collapsed.- Throws:
XPathException- if the supplied value is not in the lexical space of the xs:base64Binary data type
-
Base64BinaryValue
public Base64BinaryValue(byte[] value) Constructor: create a base64Binary value from a given array of bytes- Parameters:
value- array of bytes holding the octet sequence
-
Base64BinaryValue
Constructor: create a base64Binary value from a given array of bytes- Parameters:
value- array of bytes holding the octet sequencemetadata- the specific type (must be a subtype of BASE64_BINARY)
-
-
Method Details
-
withMetadata
Create a copy of this atomic value (usually so that the type label can be changed). The type label of the copy will be reset to the primitive type.- Specified by:
withMetadatain classAtomicValue- Parameters:
metadata- the type label to be attached to the value, a subtype of xs:base64Binary- Returns:
- the copied value
-
getPrimitiveType
Description copied from class:AtomicValueDetermine the primitive type of the value. This delivers the same answer as getItemType().getPrimitiveItemType(). The primitive types are the 19 primitive types of XML Schema, plus xs:integer, xs:dayTimeDuration and xs:yearMonthDuration, and xs:untypedAtomic. For external objects, the result is xs:anyAtomicType.- Specified by:
getPrimitiveTypein classAtomicValue- Returns:
- the primitive type
-
getPrimitiveStringValue
Convert to string- Specified by:
getPrimitiveStringValuein classAtomicValue- Returns:
- the canonical representation.
-
encode
Encode a byte sequence into base64 representation- Parameters:
value- the byte sequence- Returns:
- the base64 representation
-
decode
Decode a character string in base64 notation to yield the encoded octets- Parameters:
in- the lexical representation- Returns:
- the array of octets represented
- Throws:
XPathException- if the format is invalid (as required by XSD, this method does draconian error handling, unlike many other base64 decoders which are liberal in what they accept)
-
compareTo
- Specified by:
compareToin interfaceComparable<XPathComparable>- Overrides:
compareToin classBinaryValue
-