Top Description Fields Constructors Methods
com.sun.msv.datatype.xsd

public Class HexBinaryType

extends BinaryBaseType
Class Inheritance
Imports
com.sun.msv.datatype.SerializationContext, org.relaxng.datatype.ValidationContext

"hexBinary" type. type of the value object is BinaryValueType. See http://www.w3.org/TR/xmlschema-2/#hexBinary for the spec
Author
Kohsuke KAWAGUCHI

Field Summary

Modifier and TypeField and Description
private static final long
public static final HexBinaryType

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Object
_createValue(String lexicalValue, ValidationContext context)

Implements abstract com.sun.msv.datatype.xsd.XSDatatypeImpl._createValue.

converts a whitespace-processed lexical value into the corresponding value object
protected boolean
public String
convertToLexicalValue(Object value, SerializationContext
Context information that will be possibly used for the conversion. Currently, this object is used only by QName, but may be extended in the future.
context
)

Implements com.sun.msv.datatype.xsd.XSDatatype.convertToLexicalValue.

converts value object back to the corresponding value in the lexical space.
public static char
encode(int ch)

private static int
hexToBin(char ch)

public static byte[]
public static String
save(byte[] data)

public String
serializeJavaObject(Object value, SerializationContext
The context object is used to obtain information necessary to serialize the value object. For example, QName type uses the context to encode the URI into a prefix.
context
)

Implements abstract com.sun.msv.datatype.xsd.BinaryBaseType.serializeJavaObject.

Implements com.sun.msv.datatype.DatabindableDatatype.serializeJavaObject.

converts a value object back to the lexical representation.
Inherited from com.sun.msv.datatype.xsd.BinaryBaseType:
_createJavaObjectcountLengthgetBaseTypegetJavaObjectTypeisFacetApplicable

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.sun.msv.datatype.xsd.BinaryBaseType.serialVersionUID.

theInstanceback to summary
public static final HexBinaryType theInstance

Constructor Detail

HexBinaryTypeback to summary
private HexBinaryType()

Method Detail

_createValueback to summary
public Object _createValue(String lexicalValue, ValidationContext context)

Implements abstract com.sun.msv.datatype.xsd.XSDatatypeImpl._createValue.

Doc from com.sun.msv.datatype.xsd.XSDatatypeImpl._createValue.

converts a whitespace-processed lexical value into the corresponding value object

checkFormatback to summary
protected boolean checkFormat(String lexicalValue, ValidationContext context)

Implements abstract com.sun.msv.datatype.xsd.XSDatatypeImpl.checkFormat.

convertToLexicalValueback to summary
public String convertToLexicalValue(Object value, SerializationContext context)

Implements com.sun.msv.datatype.xsd.XSDatatype.convertToLexicalValue.

Doc from com.sun.msv.datatype.xsd.XSDatatype.convertToLexicalValue.

converts value object back to the corresponding value in the lexical space.

This method does the reverse operation of the createValue method. The returned string is not necessarily the canonical representation. Also note that the implementation may accept invalid values without throwing IllegalArgumentException. To make sure that the result is actually a valid representation, call the isValid method.

Be careful not to confuse this method with The serializeJavaObject method, which is defined in the DatabindableDatatype method.

Parameters
context:SerializationContext

Context information that will be possibly used for the conversion. Currently, this object is used only by QName, but may be extended in the future.

encodeback to summary
public static char encode(int ch)
hexToBinback to summary
private static int hexToBin(char ch)
loadback to summary
public static byte[] load(String s)
saveback to summary
public static String save(byte[] data)
serializeJavaObjectback to summary
public String serializeJavaObject(Object value, SerializationContext context)

Implements abstract com.sun.msv.datatype.xsd.BinaryBaseType.serializeJavaObject.

Implements com.sun.msv.datatype.DatabindableDatatype.serializeJavaObject.

Doc from com.sun.msv.datatype.DatabindableDatatype.serializeJavaObject.

converts a value object back to the lexical representation.

This method is a kind of the "reverse" function of the createJavaObject method.

Parameters
context:SerializationContext

The context object is used to obtain information necessary to serialize the value object. For example, QName type uses the context to encode the URI into a prefix.

Returns:String

null if the given object is invalid with respect to this datatype.