Class HexBinaryValue

All Implemented Interfaces:
Comparable<XPathComparable>, Iterable<AtomicValue>, AtomicMatchKey, XPathComparable, AtomicSequence, GroundedValue, IdentityComparable, Item, Sequence, ConversionResult

public class HexBinaryValue extends BinaryValue
A value of type xs:hexBinary
  • Constructor Details

    • HexBinaryValue

      public HexBinaryValue(UnicodeString in) 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
      Parameters:
      in - character representation of the hexBinary value
      Throws:
      XPathException - if the input is invalid
    • HexBinaryValue

      public HexBinaryValue(byte[] value)
      Constructor: create a hexBinary value from a given array of bytes
      Parameters:
      value - the value as an array of bytes
    • HexBinaryValue

      public HexBinaryValue(byte[] value, AtomicMetadata typeLabel)
      Constructor: create a hexBinary value from a given array of bytes and a specified type label
      Parameters:
      value - the value as an array of bytes
      typeLabel - the type label, which must be a subtype of HEX_BINARY
  • Method Details

    • withMetadata

      public AtomicValue withMetadata(AtomicMetadata metadata)
      Create a primitive copy of this atomic value (usually so that the type label can be changed).
      Specified by:
      withMetadata in class AtomicValue
      Parameters:
      metadata - the target type (a derived type from hexBinary)
      Returns:
      the copied value
    • getPrimitiveType

      public BuiltInAtomicType getPrimitiveType()
      Determine 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 AnyAtomicType.
      Specified by:
      getPrimitiveType in class AtomicValue
      Returns:
      the primitive type
    • getPrimitiveStringValue

      public UnicodeString getPrimitiveStringValue()
      Convert to string
      Specified by:
      getPrimitiveStringValue in class AtomicValue
      Returns:
      the canonical representation.