CCustomizable, TypeInfoSet<NType,NClass,java.lang.Void,java.lang.Void>public final class Model extends java.lang.Object implements TypeInfoSet<NType,NClass,java.lang.Void,java.lang.Void>, CCustomizable
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 | Description |
|---|---|---|
com.sun.codemodel.JCodeModel |
codeModel |
This model uses this code model exclusively.
|
SymbolSpace |
defaultSymbolSpace |
Default ID/IDREF symbol space.
|
Options |
options |
Command-line options used for building this model.
|
com.sun.codemodel.JClass |
rootClass |
If non-null, all the generated classes should eventually derive from this class.
|
com.sun.codemodel.JClass |
rootInterface |
If non-null, all the generated interfaces should eventually derive from this interface.
|
com.sun.xml.xsom.XSSchemaSet |
schemaComponent |
If this model was built from XML Schema, this field
stores the root object of the parse schema model.
|
boolean |
serializable |
True to generate serializable classes.
|
java.lang.Long |
serialVersionUID |
serial version UID to be generated.
|
ImplStructureStrategy |
strategy |
Specifies the code generation strategy.
|
| Constructor | Description |
|---|---|
Model(Options opts,
com.sun.codemodel.JCodeModel cm,
NameConverter nc,
ClassNameAllocator allocator,
com.sun.xml.xsom.XSSchemaSet schemaComponent) |
| Modifier and Type | Method | Description |
|---|---|---|
java.util.Map<NType,? extends CArrayInfo> |
arrays() |
No array mapping generation for XJC.
|
java.util.Map<NClass,CClassInfo> |
beans() |
|
java.util.Map<NType,? extends CBuiltinLeafInfo> |
builtins() |
|
java.util.Map<javax.xml.namespace.QName,CClassInfo> |
createTopLevelBindings() |
Represents the "top-level binding".
|
void |
dump(javax.xml.transform.Result out) |
|
java.util.Map<NClass,CEnumLeafInfo> |
enums() |
|
Outline |
generateCode(Options opt,
ErrorReceiver receiver) |
Fully-generate the source code into the given model.
|
java.lang.Iterable<? extends CElementInfo> |
getAllElements() |
|
CBuiltinLeafInfo |
getAnyTypeInfo() |
|
javax.xml.bind.annotation.XmlNsForm |
getAttributeFormDefault(java.lang.String nsUri) |
|
CClassInfo |
getClassInfo(NClass t) |
|
CCustomizations |
getCustomizations() |
Gets the global customizations.
|
javax.xml.bind.annotation.XmlNsForm |
getElementFormDefault(java.lang.String nsUri) |
|
CElementInfo |
getElementInfo(NClass scope,
javax.xml.namespace.QName name) |
|
java.util.Map<javax.xml.namespace.QName,CElementInfo> |
getElementMappings(NClass scope) |
|
org.xml.sax.Locator |
getLocator() |
Deprecated.
No line number available for the "root" component.
|
NameConverter |
getNameConverter() |
Gets the name converter that shall be used to parse XML names into Java names.
|
Navigator<NType,NClass,java.lang.Void,java.lang.Void> |
getNavigator() |
|
CClassInfoParent.Package |
getPackage(com.sun.codemodel.JPackage pkg) |
|
com.sun.xml.xsom.XSComponent |
getSchemaComponent() |
Deprecated.
Always return null. Perhaps you are interested in
schemaComponent? |
java.util.Map<java.lang.String,java.lang.String> |
getSchemaLocations() |
|
SymbolSpace |
getSymbolSpace(java.lang.String name) |
|
CNonElement |
getTypeInfo(NType type) |
|
CNonElement |
getTypeInfo(Ref<NType,NClass> ref) |
|
java.util.Map<java.lang.String,java.lang.String> |
getXmlNs(java.lang.String namespaceUri) |
Not implemented in the compile-time model.
|
boolean |
isPackageLevelAnnotations() |
|
void |
setNameConverter(NameConverter nameConverter) |
|
void |
setPackageLevelAnnotations(boolean packageLevelAnnotations) |
|
java.util.Map<javax.xml.namespace.QName,TypeUse> |
typeUses() |
public final com.sun.xml.xsom.XSSchemaSet schemaComponent
public final com.sun.codemodel.JCodeModel codeModel
public final Options options
public boolean serializable
public java.lang.Long serialVersionUID
public com.sun.codemodel.JClass rootClass
public com.sun.codemodel.JClass rootInterface
public ImplStructureStrategy strategy
public final SymbolSpace defaultSymbolSpace
public Model(Options opts, com.sun.codemodel.JCodeModel cm, NameConverter nc, ClassNameAllocator allocator, com.sun.xml.xsom.XSSchemaSet schemaComponent)
nc - Usually this should be set in the constructor, but we do allow this parameter
to be initially null, and then set later.schemaComponent - The source schema model, if this is built from XSD.public void setNameConverter(NameConverter nameConverter)
public final NameConverter getNameConverter()
public boolean isPackageLevelAnnotations()
public void setPackageLevelAnnotations(boolean packageLevelAnnotations)
public SymbolSpace getSymbolSpace(java.lang.String name)
public Outline generateCode(Options opt, ErrorReceiver receiver)
Outline object, which captures how the model objects
are mapped to the generated source code.
Add-ons can use those information to further augment the generated source code.
public final java.util.Map<javax.xml.namespace.QName,CClassInfo> createTopLevelBindings()
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.
public Navigator<NType,NClass,java.lang.Void,java.lang.Void> getNavigator()
getNavigator in interface TypeInfoSet<NType,NClass,java.lang.Void,java.lang.Void>public CNonElement getTypeInfo(NType type)
getTypeInfo in interface TypeInfoSet<NType,NClass,java.lang.Void,java.lang.Void>public CBuiltinLeafInfo getAnyTypeInfo()
getAnyTypeInfo in interface TypeInfoSet<NType,NClass,java.lang.Void,java.lang.Void>public CNonElement getTypeInfo(Ref<NType,NClass> ref)
getTypeInfo in interface TypeInfoSet<NType,NClass,java.lang.Void,java.lang.Void>public java.util.Map<NClass,CClassInfo> beans()
beans in interface TypeInfoSet<NType,NClass,java.lang.Void,java.lang.Void>public java.util.Map<NClass,CEnumLeafInfo> enums()
enums in interface TypeInfoSet<NType,NClass,java.lang.Void,java.lang.Void>public java.util.Map<javax.xml.namespace.QName,TypeUse> typeUses()
public java.util.Map<NType,? extends CArrayInfo> arrays()
arrays in interface TypeInfoSet<NType,NClass,java.lang.Void,java.lang.Void>public java.util.Map<NType,? extends CBuiltinLeafInfo> builtins()
builtins in interface TypeInfoSet<NType,NClass,java.lang.Void,java.lang.Void>public CClassInfo getClassInfo(NClass t)
getClassInfo in interface TypeInfoSet<NType,NClass,java.lang.Void,java.lang.Void>public CElementInfo getElementInfo(NClass scope, javax.xml.namespace.QName name)
getElementInfo in interface TypeInfoSet<NType,NClass,java.lang.Void,java.lang.Void>public java.util.Map<javax.xml.namespace.QName,CElementInfo> getElementMappings(NClass scope)
getElementMappings in interface TypeInfoSet<NType,NClass,java.lang.Void,java.lang.Void>public java.lang.Iterable<? extends CElementInfo> getAllElements()
getAllElements in interface TypeInfoSet<NType,NClass,java.lang.Void,java.lang.Void>public com.sun.xml.xsom.XSComponent getSchemaComponent()
schemaComponent?CCustomizablegetSchemaComponent in interface CCustomizablepublic org.xml.sax.Locator getLocator()
CCustomizablegetLocator in interface CCustomizablepublic CCustomizations getCustomizations()
getCustomizations in interface CCustomizablePlugin.getCustomizationURIs()public java.util.Map<java.lang.String,java.lang.String> getXmlNs(java.lang.String namespaceUri)
getXmlNs in interface TypeInfoSet<NType,NClass,java.lang.Void,java.lang.Void>public java.util.Map<java.lang.String,java.lang.String> getSchemaLocations()
getSchemaLocations in interface TypeInfoSet<NType,NClass,java.lang.Void,java.lang.Void>public javax.xml.bind.annotation.XmlNsForm getElementFormDefault(java.lang.String nsUri)
getElementFormDefault in interface TypeInfoSet<NType,NClass,java.lang.Void,java.lang.Void>public javax.xml.bind.annotation.XmlNsForm getAttributeFormDefault(java.lang.String nsUri)
getAttributeFormDefault in interface TypeInfoSet<NType,NClass,java.lang.Void,java.lang.Void>public void dump(javax.xml.transform.Result out)
dump in interface TypeInfoSet<NType,NClass,java.lang.Void,java.lang.Void>public CClassInfoParent.Package getPackage(com.sun.codemodel.JPackage pkg)
Copyright © 2018 Oracle Corporation. All rights reserved.