Class Base64BinaryValue

All Implemented Interfaces:
Serializable, Expression, Item, ValueRepresentation

public class Base64BinaryValue extends AtomicValue
A value of type xs:base64Binary
See Also:
  • Constructor Details

    • Base64BinaryValue

      public Base64BinaryValue(CharSequence s) throws XPathException
      Constructor: create a base64Binary value from a supplied string in base64 encoding
      Throws:
      XPathException
    • Base64BinaryValue

      public Base64BinaryValue(byte[] value)
      Constructor: create a base64Binary value from a given array of bytes
  • Method Details

    • getBinaryValue

      public byte[] getBinaryValue()
      Get the binary value
    • convertPrimitive

      public AtomicValue convertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)
      Convert to target data type
      Specified by:
      convertPrimitive in class AtomicValue
      Parameters:
      requiredType - an integer identifying the required atomic type
      validate - true if validation is required. If set to false, the caller guarantees that the value is valid for the target data type, and that further validation is therefore not required. Note that a validation failure may be reported even if validation was not requested.
      context -
      Returns:
      an AtomicValue, a value of the required type; or an ErrorValue
    • getStringValue

      public String getStringValue()
      Convert to string
      Specified by:
      getStringValue in interface Item
      Specified by:
      getStringValue in interface ValueRepresentation
      Specified by:
      getStringValue in class AtomicValue
      Returns:
      the canonical representation.
      See Also:
    • getLengthInOctets

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

      public ItemType getItemType(TypeHierarchy th)
      Determine the data type of the exprssion
      Specified by:
      getItemType in interface Expression
      Overrides:
      getItemType in class Value
      Parameters:
      th -
      Returns:
      Type.BASE64_BINARY_TYPE
    • convertToJava

      public Object convertToJava(Class target, XPathContext context) throws XPathException
      Convert to Java object (for passing to external functions)
      Overrides:
      convertToJava in class Value
      Throws:
      XPathException
    • equals

      public boolean equals(Object other)
      Test if the two base64Binary values are equal.
      Overrides:
      equals in class Value
    • hashCode

      public int hashCode()
      Description copied from class: Value
      Return a hash code to support the equals() function
      Overrides:
      hashCode in class Value
    • byteArrayHashCode

      protected static int byteArrayHashCode(byte[] value)