Nonvalidating Strongly Typed Wrapper Over JSR173 Parser

A wrapper over JSR173 XML!StreamReader which will provide ways of getting strongly typed java values (like int, double, Date, QName) from text and attributes. This will primarily be used in the fast unmarshaler.

Assumptions

Interface

Methods and implied built-in schema types

for xsd:string and derivates

for xsd:boolean

for xsd:byte

for xsd:short and derivates

for xsd:int and derivates

for xsd:long and derivates

for xsd:integer and derivates

for xsd:decimal and derivates

for xsd:float

for xsd:double

for xsd:hexBinary

for xsd:base64Binary

for all data related schema types: dateTime, time, date, gYearMonth, gYear, gMonth, gDay (for some of them defaults are used, same as G!DateSpecification.getCalendar() )

for all data related schema types: dateTime, time, date, gYearMonth, gYear, gMonth, gDay (for some of them defaults are used, same as G!DateSpecification.getDate() )

for all data related schema types: dateTime, time, date, gYearMonth, gYear, gMonth, gDay

for xsd:duration

for:xsd:QName

Attributes

Because of the way XML!StreamReader is designed the stream can be positioned on attributes only when a substream represents the content of an element and attributes don't have an element to hang on. For this kind of attributes the above methods should work.

For attributes in an usual document, the interface is providing two more sets of methods, in the same manner of XML!StreamReader's getAttributeValue(int index) and getAttribute(String uri, String local)

same pattern for the rest of the types.

White space

For easier access to extended or xsd:list values getString*Value() has one more form where one can pass in the white space style to be applied.

The three white space styles coresponding to XMLSchema whitespace facet: WS_PRESERVE, WS_REPLACE and WS_COLLAPSE.

Notes

NonvalidatingStronglyTypedWrapperOverJsr173Parser (last edited 2011-12-19 22:12:51 by fx)