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
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new, empty instance of theCommonsXsdSchemaCollection.CommonsXsdSchemaCollection(org.springframework.core.io.Resource... resources) Constructs a new instance of theCommonsXsdSchemaCollectionbased on the given resources. -
Method Summary
Modifier and TypeMethodDescriptionvoidCreates aXmlValidatorbased on the schemas contained in this collection.Returns all schemas contained in this collection.voidsetInline(boolean inline) Defines whether included schemas should be inlined into the including schema.voidsetResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) voidsetUriResolver(org.apache.ws.commons.schema.resolver.URIResolver uriResolver) Sets the WS-Commons uri resolver to use when resolving (relative) schemas.voidsetXsds(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 theCommonsXsdSchemaCollectionbased 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
DefaultURIResolverwhich correctly handles schemas on the classpath. -
setResourceLoader
public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) - Specified by:
setResourceLoaderin interfaceorg.springframework.context.ResourceLoaderAware
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
IOException
-
getXsdSchemas
Description copied from interface:XsdSchemaCollectionReturns all schemas contained in this collection.- Specified by:
getXsdSchemasin interfaceXsdSchemaCollection- Returns:
- the schemas contained in this collection
-
createValidator
Description copied from interface:XsdSchemaCollectionCreates aXmlValidatorbased on the schemas contained in this collection.- Specified by:
createValidatorin interfaceXsdSchemaCollection- Returns:
- a validator for this collection
-
toString
-