net.sf.saxon.value
Class HexBinaryValue

java.lang.Object
  |
  +--net.sf.saxon.value.Value
        |
        +--net.sf.saxon.value.AtomicValue
              |
              +--net.sf.saxon.value.HexBinaryValue
All Implemented Interfaces:
Expression, Item, java.io.Serializable

public class HexBinaryValue
extends AtomicValue

A value of type xs:hexBinary

See Also:
Serialized Form

Constructor Summary
HexBinaryValue(byte[] value)
          Constructor: create a hexBinary value from a given array of bytes
HexBinaryValue(java.lang.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
 
Method Summary
 int conversionPreference(java.lang.Class required, Configuration config)
          Get conversion preference for this value to a Java class.
 AtomicValue convert(int requiredType)
          Convert to target data type
 java.lang.Object convertToJava(java.lang.Class target, Configuration config)
          Convert to Java object (for passing to external functions)
 void display(int level, NamePool pool)
          Diagnostic print of expression structure
 boolean equals(java.lang.Object other)
          Test if the two hexBinary values are equal.
 byte[] getBinaryValue()
          Get the binary value
 ItemType getItemType()
          Determine the data type of the exprssion
 int getLengthInOctets()
          Get the number of octets in the value
 java.lang.String getStringValue()
          Convert to string
 int hashCode()
           
 
Methods inherited from class net.sf.saxon.value.AtomicValue
convert, effectiveBooleanValue, evaluateAsString, evaluateItem, getCardinality, getComponent, getPrimitiveValue, getTypedValue, iterate
 
Methods inherited from class net.sf.saxon.value.Value
analyze, asItem, asValue, collapseWhitespace, getDependencies, getSpecialProperties, getSubExpressions, inverse, normalizeWhitespace, promote, simplify, stringToNumber, trimWhitespace
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HexBinaryValue

public HexBinaryValue(java.lang.CharSequence s)
               throws XPathException
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

getBinaryValue

public byte[] getBinaryValue()
Get the binary value


convert

public AtomicValue convert(int requiredType)
                    throws XPathException
Convert to target data type

Specified by:
convert in class AtomicValue
Parameters:
requiredType - an integer identifying the required atomic type
Returns:
an AtomicValue, a value of the required type
Throws:
XPathException - if the conversion is not possible

getStringValue

public java.lang.String getStringValue()
Convert to string

Specified by:
getStringValue in interface Item
Specified by:
getStringValue in class Value
Returns:
the canonical representation.

getItemType

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

Returns:
Type.HEX_BINARY_TYPE

getLengthInOctets

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


conversionPreference

public int conversionPreference(java.lang.Class required,
                                Configuration config)
Get conversion preference for this value to a Java class. A low result indicates higher preference.

Overrides:
conversionPreference in class AtomicValue

convertToJava

public java.lang.Object convertToJava(java.lang.Class target,
                                      Configuration config)
                               throws XPathException
Convert to Java object (for passing to external functions)

Overrides:
convertToJava in class AtomicValue
Parameters:
target - The class required by the external function
config - The configuration (needed for access to schema information)
Returns:
an object of the target class
XPathException

equals

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

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

display

public void display(int level,
                    NamePool pool)
Diagnostic print of expression structure

Parameters:
level - indentation level for this expression