net.sf.saxon.value

Class HexBinaryValue

public class HexBinaryValue extends AtomicValue

A value of type xs:hexBinary
Constructor Summary
HexBinaryValue(CharSequence s)
Constructor: create a hexBinary value from a supplied string, in which each octet is represented by a pair of values from 0-9, a-f, A-F
HexBinaryValue(byte[] value)
Constructor: create a hexBinary value from a given array of bytes
Method Summary
AtomicValueconvertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)
Convert to target data type
ObjectconvertToJava(Class target, XPathContext context)
Convert to Java object (for passing to external functions)
booleanequals(Object other)
Test if the two hexBinary values are equal.
byte[]getBinaryValue()
Get the binary value
ItemTypegetItemType(TypeHierarchy th)
Determine the data type of the exprssion
intgetLengthInOctets()
Get the number of octets in the value
StringgetStringValue()
Convert to string
inthashCode()

Constructor Detail

HexBinaryValue

public HexBinaryValue(CharSequence s)
Constructor: create a hexBinary value from a supplied string, in which each octet is represented by a pair of values from 0-9, a-f, A-F

HexBinaryValue

public HexBinaryValue(byte[] value)
Constructor: create a hexBinary value from a given array of bytes

Method Detail

convertPrimitive

public AtomicValue convertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)
Convert to target data type

Parameters: requiredType an integer identifying the required atomic type context

Returns: an AtomicValue, a value of the required type; or an ErrorValue

convertToJava

public Object convertToJava(Class target, XPathContext context)
Convert to Java object (for passing to external functions)

equals

public boolean equals(Object other)
Test if the two hexBinary values are equal.

getBinaryValue

public byte[] getBinaryValue()
Get the binary value

getItemType

public ItemType getItemType(TypeHierarchy th)
Determine the data type of the exprssion

Parameters: th

Returns: Type.HEX_BINARY_TYPE

getLengthInOctets

public int getLengthInOctets()
Get the number of octets in the value

getStringValue

public String getStringValue()
Convert to string

Returns: the canonical representation.

hashCode

public int hashCode()