Class CommonsXsdSchemaCollection
java.lang.Object
org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.ResourceLoaderAware
,XsdSchemaCollection
public class CommonsXsdSchemaCollection
extends Object
implements XsdSchemaCollection, org.springframework.beans.factory.InitializingBean, org.springframework.context.ResourceLoaderAware
Implementation of the
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.
- Since:
- 1.5.0
- Author:
- Arjen Poutsma
- See Also:
-
Constructor Summary
ConstructorDescriptionConstructs a new, empty instance of theCommonsXsdSchemaCollection
.CommonsXsdSchemaCollection
(org.springframework.core.io.Resource... resources) Constructs a new instance of theCommonsXsdSchemaCollection
based on the given resources. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Creates aXmlValidator
based on the schemas contained in this collection.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.toString()
-
Constructor Details
-
CommonsXsdSchemaCollection
public CommonsXsdSchemaCollection()Constructs a new, empty instance of theCommonsXsdSchemaCollection
.A subsequent call to the
setXsds(Resource[])
is required. -
CommonsXsdSchemaCollection
public CommonsXsdSchemaCollection(org.springframework.core.io.Resource... resources) Constructs a new instance of theCommonsXsdSchemaCollection
based on the given resources.- Parameters:
resources
- the schema resources to load
-
-
Method Details
-
setXsds
public void setXsds(org.springframework.core.io.Resource... xsdResources) Sets the schema resources to be loaded.- Parameters:
xsdResources
- the schema resources to be loaded
-
setInline
public void setInline(boolean inline) Defines whether included schemas should be inlined into the including schema.Defaults to
false
. -
setUriResolver
public void setUriResolver(org.apache.ws.commons.schema.resolver.URIResolver uriResolver) Sets the WS-Commons uri resolver to use when resolving (relative) schemas.Default is an internal subclass of
DefaultURIResolver
which correctly handles schemas on the classpath. -
setResourceLoader
public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) - Specified by:
setResourceLoader
in interfaceorg.springframework.context.ResourceLoaderAware
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
IOException
-
getXsdSchemas
Description copied from interface:XsdSchemaCollection
Returns all schemas contained in this collection.- Specified by:
getXsdSchemas
in interfaceXsdSchemaCollection
- Returns:
- the schemas contained in this collection
-
createValidator
Description copied from interface:XsdSchemaCollection
Creates aXmlValidator
based on the schemas contained in this collection.- Specified by:
createValidator
in interfaceXsdSchemaCollection
- Returns:
- a validator for this collection
-
toString
-