Class HexBinaryValue

  • All Implemented Interfaces:
    AttributeValue, PrimitiveValue, Value

    public final class HexBinaryValue
    extends StringParseableValue<byte[]>
    Representation of an xs:hexBinary value. This class supports parsing xs:hexBinary values. All objects of this class are immutable and all methods of the class are thread-safe. The choice of the Java type byte[] is based on JAXB schema-to-Java mapping spec: https://docs.oracle.com/javase/tutorial/jaxb/intro/bind.html
    Version:
    $Id: $
    • Constructor Detail

      • HexBinaryValue

        public HexBinaryValue​(byte[] value)
        Creates a new HexBinaryAttributeValue that represents the byte [] value supplied.
        Parameters:
        value - the byte [] value to be represented
      • HexBinaryValue

        public HexBinaryValue​(String val)
                       throws IllegalArgumentException
        Returns a new HexBinaryAttributeValue that represents the xsi:hexBinary value indicated by the string provided.
        Parameters:
        val - a string representing the desired value
        Throws:
        IllegalArgumentException - if val is not a valid string representation of xs:hexBinary
    • Method Detail

      • printXML

        public String printXML()
        Converts the internal value (accessible via SimpleValue.getUnderlyingValue() to a valid lexical representation for XML marshalling. Equivalent to the 'printMethod' in JAXB 'javaType' binding customizations. Implementations of this typically call DatatypeConverter. This method is called by SimpleValue.getContent() and its result cached by the same method for later use. Therefore, no need to cache the result in the implementation.
        Specified by:
        printXML in class SimpleValue<byte[]>
        Returns:
        XML-valid lexical representation.