Package com.consol.citrus.xml
Class XsdSchemaRepository
- java.lang.Object
-
- com.consol.citrus.xml.XsdSchemaRepository
-
- All Implemented Interfaces:
com.consol.citrus.common.InitializingPhase,com.consol.citrus.common.Named
public class XsdSchemaRepository extends Object implements com.consol.citrus.common.Named, com.consol.citrus.common.InitializingPhase
Schema repository holding a set of XML schema resources known in the test scope.- Author:
- Christoph Deppisch
-
-
Constructor Summary
Constructors Constructor Description XsdSchemaRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddCitrusSchema(String schemaName)Adds Citrus message schema to repository if available on classpath.booleancanValidate(Document doc)Find the matching schema for document using given schema mapping strategy.List<String>getLocations()Gets the locations.StringgetName()Gets the name.XsdSchemaMappingStrategygetSchemaMappingStrategy()Gets the schema mapping strategy.List<org.springframework.xml.xsd.XsdSchema>getSchemas()Get the list of known schemas.voidinitialize()voidsetLocations(List<String> locations)Sets the locations.voidsetName(String name)voidsetSchemaMappingStrategy(XsdSchemaMappingStrategy schemaMappingStrategy)Set the schema mapping strategy.voidsetSchemas(List<org.springframework.xml.xsd.XsdSchema> schemas)Set the list of known schemas.
-
-
-
Method Detail
-
canValidate
public boolean canValidate(Document doc)
Find the matching schema for document using given schema mapping strategy.- Parameters:
doc- the document instance to validate.- Returns:
- boolean flag marking matching schema instance found
-
initialize
public void initialize()
- Specified by:
initializein interfacecom.consol.citrus.common.InitializingPhase
-
addCitrusSchema
protected void addCitrusSchema(String schemaName) throws IOException, SAXException, ParserConfigurationException
Adds Citrus message schema to repository if available on classpath.- Parameters:
schemaName- The name of the schema within the citrus schema package- Throws:
IOExceptionSAXExceptionParserConfigurationException
-
getSchemas
public List<org.springframework.xml.xsd.XsdSchema> getSchemas()
Get the list of known schemas.- Returns:
- the schemaSources
-
setSchemas
public void setSchemas(List<org.springframework.xml.xsd.XsdSchema> schemas)
Set the list of known schemas.- Parameters:
schemas- the schemas to set
-
setSchemaMappingStrategy
public void setSchemaMappingStrategy(XsdSchemaMappingStrategy schemaMappingStrategy)
Set the schema mapping strategy.- Parameters:
schemaMappingStrategy- the schemaMappingStrategy to set
-
getSchemaMappingStrategy
public XsdSchemaMappingStrategy getSchemaMappingStrategy()
Gets the schema mapping strategy.- Returns:
- The current XsdSchemaMappingStrategy
-
setName
public void setName(String name)
- Specified by:
setNamein interfacecom.consol.citrus.common.Named
-
getName
public String getName()
Gets the name.- Returns:
- the name the name to get.
-
getLocations
public List<String> getLocations()
Gets the locations.- Returns:
- the locations the locations to get.
-
-