public class CommonsXsdSchemaCollection extends Object implements XsdSchemaCollection, org.springframework.beans.factory.InitializingBean, org.springframework.context.ResourceLoaderAware
XsdSchemaCollection
that uses Apache WS-Commons XML Schema.
Setting the inline
flag to true
will result in all referenced schemas
(included and imported) being merged into the referred schema. When including the schemas into a WSDL, this greatly
simplifies the deployment of the schemas.
Constructor and Description |
---|
CommonsXsdSchemaCollection()
Constructs a new, empty instance of the
CommonsXsdSchemaCollection . |
CommonsXsdSchemaCollection(org.springframework.core.io.Resource[] resources)
Constructs a new instance of the
CommonsXsdSchemaCollection based on the given resources. |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
XmlValidator |
createValidator()
Creates a
XmlValidator based on the schemas contained in this collection. |
XsdSchema[] |
getXsdSchemas()
Returns all schemas contained in this collection.
|
void |
setInline(boolean inline)
Defines whether included schemas should be inlined into the including schema.
|
void |
setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) |
void |
setUriResolver(org.apache.ws.commons.schema.resolver.URIResolver uriResolver)
Sets the WS-Commons uri resolver to use when resolving (relative) schemas.
|
void |
setXsds(org.springframework.core.io.Resource[] xsdResources)
Sets the schema resources to be loaded.
|
String |
toString() |
public CommonsXsdSchemaCollection()
CommonsXsdSchemaCollection
.
A subsequent call to the setXsds(Resource[])
is required.
public CommonsXsdSchemaCollection(org.springframework.core.io.Resource[] resources)
CommonsXsdSchemaCollection
based on the given resources.resources
- the schema resources to loadpublic void setXsds(org.springframework.core.io.Resource[] xsdResources)
xsdResources
- the schema resources to be loadedpublic void setInline(boolean inline)
Defaults to false
.
public void setUriResolver(org.apache.ws.commons.schema.resolver.URIResolver uriResolver)
Default is an internal subclass of DefaultURIResolver
which correctly handles schemas on the classpath.
public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
setResourceLoader
in interface org.springframework.context.ResourceLoaderAware
public void afterPropertiesSet() throws IOException
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
IOException
public XsdSchema[] getXsdSchemas()
XsdSchemaCollection
getXsdSchemas
in interface XsdSchemaCollection
public XmlValidator createValidator()
XsdSchemaCollection
XmlValidator
based on the schemas contained in this collection.createValidator
in interface XsdSchemaCollection