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

public Class Base64BinaryType

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

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

Field Summary

Modifier and TypeField and Description
private static final byte[]
private static final char[]
private static final byte
private static final long
public static final Base64BinaryType

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
private static int

Returns:

-1 if format is illegal.
calcLength
(final char[] buf)

computes the length of binary data.

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.
protected static char
encode(int i)

private static byte[]
private static char[]
public static byte[]
load(String lexicalValue)

public static String
save(byte[] input)

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

decodeMapback to summary
private static final byte[] decodeMap
encodeMapback to summary
private static final char[] encodeMap
PADDINGback to summary
private static final byte PADDING
serialVersionUIDback to summary
private static final long serialVersionUID

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

theInstanceback to summary
public static final Base64BinaryType theInstance

Constructor Detail

Base64BinaryTypeback to summary
private Base64BinaryType()

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

calcLengthback to summary
private static int calcLength(final char[] buf)

computes the length of binary data. This function also performs format check.

Returns:int

-1 if format is illegal.

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
protected static char encode(int i)
initDecodeMapback to summary
private static byte[] initDecodeMap()
initEncodeMapback to summary
private static char[] initEncodeMap()
loadback to summary
public static byte[] load(String lexicalValue)
saveback to summary
public static String save(byte[] input)
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.