public class JavaToXSD extends Object implements JavaToXSDIntf
Handles the conversion of Java classes to XML Schema This class is the key class to use for all Java to Schema requirements.
Approach 1: Starting from scratch.
You can generate an empty schema model by providing a target namespace.
To this empty schema model, Complex Types and Global Elements can be added.
createSchema
Approach 2: You want to generate a complex type as a string given a xmltype and a Java Class.
generateForSingleType
generateForEndpoint
Modifier and Type | Field and Description |
---|---|
protected JavaToXSDHelper |
helper |
protected String |
jaxrpcAssert |
protected SchemaUtils |
schemautils |
protected WSDLUtils |
utils |
Constructor and Description |
---|
JavaToXSD()
Constructor
|
Modifier and Type | Method and Description |
---|---|
JBossXSModel |
generateForSingleType(QName xmlType,
Class javaType)
Method that is used to obtain a Schema Model given
a Java class, a XMLName and a XMLType
|
JBossXSModel |
generateForSingleType(QName xmlType,
Class javaType,
Map<String,QName> elementNames) |
SchemaCreatorIntf |
getSchemaCreator()
Get the SchemaCreator (that deals with creation of schema types)
Pluggable feature of JavaToXSD
|
JBossXSModel |
parseSchema(Map<String,URL> locs)
Given a set of schema files, parse them to yield an unified JBossXSModel
|
JBossXSModel |
parseSchema(URL xsdURL)
Given a schema file in a file, return a Schema Model
|
void |
setPackageNamespaceMap(Map<String,String> map)
A map of package->namespace map that denote user customization
|
void |
setWSDLStyle(String style)
Set the WSDL Style
|
protected WSDLUtils utils
protected SchemaUtils schemautils
protected String jaxrpcAssert
protected JavaToXSDHelper helper
public JBossXSModel generateForSingleType(QName xmlType, Class javaType) throws IOException
JavaToXSDIntf
generateForSingleType
in interface JavaToXSDIntf
javaType
- Class object that is the type of the xmlTypeIOException
public JBossXSModel generateForSingleType(QName xmlType, Class javaType, Map<String,QName> elementNames) throws IOException
generateForSingleType
in interface JavaToXSDIntf
IOException
public SchemaCreatorIntf getSchemaCreator()
JavaToXSDIntf
getSchemaCreator
in interface JavaToXSDIntf
public JBossXSModel parseSchema(URL xsdURL)
xsdURL
- Location of the schema filepublic JBossXSModel parseSchema(Map<String,URL> locs)
locs
- a map of schema namespace to schema locationpublic void setPackageNamespaceMap(Map<String,String> map)
JavaToXSDIntf
setPackageNamespaceMap
in interface JavaToXSDIntf
JavaToXSDIntf.setPackageNamespaceMap(java.util.Map)
public void setWSDLStyle(String style)
setWSDLStyle
in interface JavaToXSDIntf
for Constants.DOCUMENT_LITERAL
and Constants.RPC_LITERAL
Copyright © 2018 JBoss by Red Hat. All rights reserved.