Package org.springframework.xml.xsd
Class SimpleXsdSchema
java.lang.Object
org.springframework.xml.xsd.SimpleXsdSchema
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean,XsdSchema
public class SimpleXsdSchema
extends Object
implements XsdSchema, org.springframework.beans.factory.InitializingBean
The default
XsdSchema implementation.
Allows a XSD to be set by the setXsd(Resource), or directly in the constructor.
- Since:
- 1.5.0
- Author:
- Mark LaFond, Arjen Poutsma, Greg Turnquist
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new instance of theSimpleXsdSchemaclass.SimpleXsdSchema(org.springframework.core.io.Resource xsdResource) Create a new instance of theSimpleXsdSchemaclass with the specified resource. -
Method Summary
Modifier and TypeMethodDescriptionvoidCreates aXmlValidatorbased on the schema.Returns theSourceof the schema.Returns the target namespace of this schema.voidsetXsd(org.springframework.core.io.Resource xsdResource) Set the XSD resource to be exposed by calls to this instances'getSource()method.toString()
-
Constructor Details
-
SimpleXsdSchema
public SimpleXsdSchema()Create a new instance of theSimpleXsdSchemaclass.A subsequent call to the
setXsd(Resource)method is required. -
SimpleXsdSchema
public SimpleXsdSchema(org.springframework.core.io.Resource xsdResource) Create a new instance of theSimpleXsdSchemaclass with the specified resource.- Parameters:
xsdResource- the XSD resource; must not benull- Throws:
IllegalArgumentException- if the suppliedxsdResourceisnull
-
-
Method Details
-
setXsd
public void setXsd(org.springframework.core.io.Resource xsdResource) Set the XSD resource to be exposed by calls to this instances'getSource()method.- Parameters:
xsdResource- the XSD resource
-
getTargetNamespace
Description copied from interface:XsdSchemaReturns the target namespace of this schema.- Specified by:
getTargetNamespacein interfaceXsdSchema- Returns:
- the target namespace
-
getSource
Description copied from interface:XsdSchemaReturns theSourceof the schema. -
createValidator
Description copied from interface:XsdSchemaCreates aXmlValidatorbased on the schema.- Specified by:
createValidatorin interfaceXsdSchema- Returns:
- a validator for this schema
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
ParserConfigurationExceptionIOExceptionSAXException
-
toString
-