joelittlejohn
joelittlejohn

Reputation: 11832

Can I reuse an existing part of JAXB (or similar) for basic mapping of schema types to Java types?

I am writing a library in which I need to take a type like xsd:string and find the relevant Java type according to:

http://en.wikipedia.org/wiki/Java_Architecture_for_XML_Binding#Default_data_type_bindings

I've tried to navigate through the JAXB/XJC source code to find out which component does the mapping for primitive (and primitive wrapper) types but I've had no luck.

Does anyone know if there is a simple part of the JAXB or XJC APIs that I can use for this? (or another off the shelf component?)

Upvotes: 2

Views: 175

Answers (1)

bdoughan
bdoughan

Reputation: 149037

There isn't a standard API for this, each JAXB implementation will do it differently. I would recommend just creating a Map based on the table you provided.

Upvotes: 1

Related Questions