A Model is a schema language neutral representation of the
result of a schema parsing. The back-end then works against this model
to turn this into a series of Java source code.
| Modifier and Type | Field and Description |
|---|---|
| private final Iterable | |
| pack-priv final ClassNameAllocatorWrapper | allocator
This allocator has the final say on deciding the class name. |
| private final Map | beans
Generated beans. |
| private final Map | |
| public final JCodeModel | codeModel
This model uses this code model exclusively. |
| pack-priv CCustomizations | customizations
Single linked list that connects all |
| public final SymbolSpace | defaultSymbolSpace
Default ID/IDREF symbol space. |
| private final Map | elementMappings
The element mappings. |
| pack-priv static final Locator | |
| private final Map | enums
Generated enums. |
| private CCustomizations | |
| private NameConverter | nameConverter
|
| public final Options | options
Command-line options used for building this model. |
| private boolean | packageLevelAnnotations
This field controls the generation of package level annotations for s2j |
| public JClass | rootClass
If non-null, all the generated classes should eventually derive from this class. |
| public JClass | rootInterface
If non-null, all the generated interfaces should eventually derive from this interface. |
| public final XSSchemaSet | schemaComponent
If this model was built from XML Schema, this field stores the root object of the parse schema model. |
| public boolean | serializable
True to generate serializable classes. |
| public Long | serialVersionUID
serial version UID to be generated. |
| public ImplStructureStrategy | strategy
Specifies the code generation strategy. |
| private final Map | symbolSpaces
All the defined |
| private final Map |
| Access | Constructor and Description |
|---|---|
| public | Model(Options opts, JCodeModel cm, NameConverter
Usually this should be set in the constructor, but we do allow this parameter
to be initially null, and then set later. nc, ClassNameAllocator allocator, XSSchemaSet The source schema model, if this is built from XSD. schemaComponent)
|
| allElements | back to summary |
|---|---|
| private final Iterable<? extends CElementInfo> allElements | |
| allocator | back to summary |
|---|---|
| pack-priv final ClassNameAllocatorWrapper allocator This allocator has the final say on deciding the class name. Must not be null. Model classes are responsible for using the allocator. This allocator interaction should be transparent to the user/builder of the model. | |
| beans | back to summary |
|---|---|
| private final Map<NClass, CClassInfo> beans Generated beans. | |
| cache | back to summary |
|---|---|
| private final Map<JPackage, CClassInfoParent. | |
| codeModel | back to summary |
|---|---|
| public final JCodeModel codeModel This model uses this code model exclusively. | |
| customizations | back to summary |
|---|---|
| pack-priv CCustomizations customizations Single linked list that connects all
| |
| defaultSymbolSpace | back to summary |
|---|---|
| public final SymbolSpace defaultSymbolSpace Default ID/IDREF symbol space. Any ID/IDREF without explicit reference to a symbol space is assumed to use this default symbol space. | |
| elementMappings | back to summary |
|---|---|
| private final Map<NClass, Map<QName, CElementInfo>> elementMappings The element mappings. | |
| EMPTY_LOCATOR | back to summary |
|---|---|
| pack-priv static final Locator EMPTY_LOCATOR | |
| enums | back to summary |
|---|---|
| private final Map<NClass, CEnumLeafInfo> enums Generated enums. | |
| globalCustomizations | back to summary |
|---|---|
| private CCustomizations globalCustomizations | |
| nameConverter | back to summary |
|---|---|
| private NameConverter nameConverter
| |
| options | back to summary |
|---|---|
| public final Options options Command-line options used for building this model. | |
| packageLevelAnnotations | back to summary |
|---|---|
| private boolean packageLevelAnnotations This field controls the generation of package level annotations for s2j | |
| rootClass | back to summary |
|---|---|
| public JClass rootClass If non-null, all the generated classes should eventually derive from this class. | |
| rootInterface | back to summary |
|---|---|
| public JClass rootInterface If non-null, all the generated interfaces should eventually derive from this interface. | |
| schemaComponent | back to summary |
|---|---|
| public final XSSchemaSet schemaComponent If this model was built from XML Schema, this field stores the root object of the parse schema model. Otherwise null.
| |
| serializable | back to summary |
|---|---|
| public boolean serializable True to generate serializable classes. | |
| serialVersionUID | back to summary |
|---|---|
| public Long serialVersionUID serial version UID to be generated. null if not to generate serialVersionUID field. | |
| strategy | back to summary |
|---|---|
| public ImplStructureStrategy strategy Specifies the code generation strategy. Must not be null. | |
| symbolSpaces | back to summary |
|---|---|
| private final Map<String, SymbolSpace> symbolSpaces All the defined | |
| typeUses | back to summary |
|---|---|
| private final Map<QName, TypeUse> typeUses
I really don't want to promote the notion of a 'type' in any place except in the XML Schema code, but this needs to be exposed for JAX-RPC. A reference to a named XML type will be converted into a reference to a Java type with annotations. | |
| Model | back to summary |
|---|---|
public Model(Options opts, JCodeModel cm, NameConverter nc, ClassNameAllocator allocator, XSSchemaSet schemaComponent)
| |
| add | back to summary |
|---|---|
| pack-priv void add(CEnumLeafInfo e) | |
| add | back to summary |
|---|---|
| pack-priv void add(CClassInfo ci) | |
| add | back to summary |
|---|---|
| pack-priv void add(CElementInfo ei) | |
| arrays | back to summary |
|---|---|
| public Map Implements org. No array mapping generation for XJC.
| |
| beans | back to summary |
|---|---|
| public Map Implements org. Doc from org. Returns all the
| |
| builtins | back to summary |
|---|---|
| public Map Implements org. Doc from org. Returns all the
| |
| createTopLevelBindings | back to summary |
|---|---|
| public Map Represents the "top-level binding". This is used to support the use of a schema inside WSDL. For XML Schema, the top-level binding is a map from global element declarations to its representation class. For other schema languages, it should follow the appendices in WSDL (but in practice no one would use WSDL with a schema language other than XML Schema, so it doesn't really matter.) This needs to be filled by the front-end. | |
| dump | back to summary |
|---|---|
| public void dump(Result out) Implements org. Doc from org. Dumps this model into XML. For debug only. Todo not sure if this actually works. We don't really know what are T,C.
| |
| enums | back to summary |
|---|---|
| public Map Implements org. Doc from org. Returns all the
| |
| generateCode | back to summary |
|---|---|
| public Outline generateCode(Options opt, ErrorReceiver receiver) Fully-generate the source code into the given model. | |
| getAllElements | back to summary |
|---|---|
| public Iterable Implements org. Doc from org. Returns all the
| |
| getAnyTypeInfo | back to summary |
|---|---|
| public CBuiltinLeafInfo getAnyTypeInfo() Implements org. Doc from org. Gets the
| |
| getAttributeFormDefault | back to summary |
|---|---|
| public XmlNsForm getAttributeFormDefault(String nsUri) Implements org. Doc from org. Gets the reasonable
The spec doesn't define very precisely what the
| |
| getClassInfo | back to summary |
|---|---|
| public CClassInfo getClassInfo(NClass t) Implements org. Doc from org. Returns a
This method is almost like refinement of
| |
| getCustomizations | back to summary |
|---|---|
| public CCustomizations getCustomizations() Implements com. Gets the global customizations.
| |
| getElementFormDefault | back to summary |
|---|---|
| public XmlNsForm getElementFormDefault(String nsUri) Implements org. Doc from org. Gets the reasonable
The spec doesn't define very precisely what the
| |
| getElementInfo | back to summary |
|---|---|
| public CElementInfo getElementInfo(NClass scope, QName name) Implements org. Doc from org. Returns a
| |
| getElementMappings | back to summary |
|---|---|
| public Map Implements org. Doc from org. Returns all
| |
| getLocator | back to summary |
|---|---|
| public Locator getLocator() Implements com. Doc from com. Deprecated No line number available for the "root" component. Gets the source location in the schema from which this model component is created.
| |
| getNameConverter | back to summary |
|---|---|
| public NameConverter getNameConverter() Gets the name converter that shall be used to parse XML names into Java names. | |
| getNavigator | back to summary |
|---|---|
| public Navigator Implements org. Doc from org.
| |
| getPackage | back to summary |
|---|---|
| public CClassInfoParent. | |
| getSchemaComponent | back to summary |
|---|---|
| public XSComponent getSchemaComponent() Implements com. Doc from com. Deprecated Always return null. Perhaps you are interested in If this model object is built from XML Schema, this property returns a schema component from which the model is built.
| |
| getSchemaLocations | back to summary |
|---|---|
| public Map Implements org. Doc from org. Gets This operation is expected to be only used in schema generator, so it can be slow.
| |
| getSymbolSpace | back to summary |
|---|---|
| public SymbolSpace getSymbolSpace(String name) | |
| getTypeInfo | back to summary |
|---|---|
| public CNonElement getTypeInfo(NType type) Implements org. Doc from org. Returns a
| |
| getTypeInfo | back to summary |
|---|---|
| public CNonElement getTypeInfo(Ref<NType, NClass> ref) Implements org. Doc from org. Returns a type information for the given reference.
| |
| getXmlNs | back to summary |
|---|---|
| public Map Implements org. Not implemented in the compile-time model.
| |
| isPackageLevelAnnotations | back to summary |
|---|---|
| public boolean isPackageLevelAnnotations() | |
| setNameConverter | back to summary |
|---|---|
| public void setNameConverter(NameConverter nameConverter) | |
| setPackageLevelAnnotations | back to summary |
|---|---|
| public void setPackageLevelAnnotations(boolean packageLevelAnnotations) | |
| typeUses | back to summary |
|---|---|
| public Map | |