ExoLab     OpenEJB     OpenJMS     OpenORB     Castor     Tyrex     
 

Main
  Home
  Download
  API
  Schema
  Mailing Lists
  CVS

XML
  Using XML
  Source Generator
  Schema Support
  XML Mapping

JDO
  Using JDO
  New features
  JDO Config
  Types
  FAQs
  Presentation

Advanced JDO
  OQL
  Trans. & Locks
  Design
  KeyGen
  Long Trans.
  Nested Attrs.

More
  Presentations
  The Examples
  Configuration
  Tips & Tricks
  Full JavaDoc

About
  License
  Contributors
  Status, Todo
  Changelog
  Library
  Contact

  



Castor XML Schema Support

Introduction
Supported XML Schema Built-in Datatypes
Primitive Datatypes
Derived Datatypes
Supported XML Schema Structures
Groups

Introduction

The Source Code Generator is supporting the W3C XML Schema Candidate Recommendation document (10/24/2000). Roughly speaking the Castor maps an XML Schema type to a corresponding Java type.

But it happens that a Schema type does not have the corresponding one in Java. Thus the Source Generator uses Castor implementation of these specific types (located in the types package). For instance the TimeDuration type is implemented directly in Castor. Many built-in types are supported but not all of them. You will find next a detailed list of supported built-in types.

Remember that the representation of XML Schema datatypes does not try to fit exactly the W3C XML Schema specifications, the aim is to map an XML Schema type to the java type that fit the most to the XML Schema type.

For a detailled support of XML Schema structure, please refer to Source Generator User Document(PDF).

Supported XML Schema Built-in Datatypes

The following is a list of the supported datatypes with the corresponding facets and the java mapping type.

Primitive Datatypes

TypeSupported FacetsJava mapping type
binaryprimitive byte array
booleanprimitive boolean type
decimal maxExclusive
minExclusive
maxInclusive
minInclusive
precision
scale
java.math.BigDecimal
double pattern
maxExclusive
minExclusive
maxInclusive
minInclusive
double primitive type
float pattern
maxExclusive
minExclusive
maxInclusive
minInclusive
primitive float type
IDjava.lang.String
IDREFjava.lang.Object
QName length
maxLength
minLength
pattern
java.lang.String
recurringDuration maxExclusive
minExclusive
maxInclusive
minInclusive
org.exolab.castor.types.RecurringDuration
string length
minLength
maxLength
pattern
enumeration
java.lang.String
timeDuration maxExclusive
minExclusive
maxInclusive
minInclusive
org.exolab.castor.type.TimeDuration
uriReferencejava.lang.String

Derived Datatypes

TypeSupported FacetsJava mapping type
centuryorg.exolab.castor.types.century
CDATA length
maxLength
minLength
pattern
java.lang.string
dateorg.exolab.castor.types.Date
IDREFSjava.util.Vector of IDREF
integer maxExclusive
minExclusive
maxInclusive
minInclusive
pattern
primitive int type
NCNamejava.lang.String
NMToken java.lang.String
NMTOKENSjava.util.Vector of NMTOKEN
long maxExclusive
minExclusive
maxInclusive
minInclusive
pattern
primitive long type
month maxExclusive
minExclusive
maxInclusive
minInclusive
org.exolab.castor.types.Month
negativeInteger maxExclusive
minExclusive
maxInclusive
minInclusive
pattern
primitive int type
nonNegativeInteger maxExclusive
minExclusive
maxInclusive
minInclusive
pattern
primitive int type
nonPositiveInteger maxExclusive
minExclusive
maxInclusive
minInclusive
pattern
primitive int type
positiveInteger maxExclusive
minExclusive
maxInclusive
minInclusive
pattern
primitive int type
short maxExclusive
minExclusive
maxInclusive
minInclusive
pattern
primitive int type
timeorg.exolab.castor.types.Time
timeInstantjava.util.Date
timePeriod maxExclusive
minExclusive
maxInclusive
minInclusive
org.exolab.castor.type.TimePeriod
year maxExclusive
minExclusive
maxInclusive
minInclusive
org.exolab.castor.type.Year

Supported XML Schema Structures

For a detailled support of XML Schema structure, please refer to Source Generator User Document(PDF).

The supported structures for XML Schema is currently limited to:

Structural elements:

-annotation
-simpleType
-complexType
-element
-attribute
-attributeGroup
-group

Groups

The source code generator currently supports single level choice and all. The sequence group is treated as an all. Nested groups (groups which appear beneath other groups) are currently flattened and the children of the group are treated as if they were children of the containing structure.

A work around for nested groups is to simply create a new complex type which represents the group.

 
   
  
   
 


Copyright © 1999-2001 ExoLab Group. All rights reserved.
 
Java, EJB, JDBC, JNDI, JTA, Sun, Sun Microsystems are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and in other countries. XML, XML Schema, XSLT and related standards are trademarks or registered trademarks of MIT, INRIA, Keio or others, and a product of the World Wide Web Consortium. All other product names mentioned herein are trademarks of their respective owners.