Package org.citrusframework.xml
Class XsdSchemaRepository
java.lang.Object
org.citrusframework.xml.XsdSchemaRepository
- All Implemented Interfaces:
InitializingPhase,Named
Schema repository holding a set of XML schema resources known in the test scope.
- Author:
- Christoph Deppisch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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.Gets the locations.getName()Gets the name.Gets the schema mapping strategy.List<org.springframework.xml.xsd.XsdSchema>Get the list of known schemas.voidvoidsetLocations(List<String> locations) Sets the locations.voidvoidsetSchemaMappingStrategy(XsdSchemaMappingStrategy schemaMappingStrategy) Set the schema mapping strategy.voidsetSchemas(List<org.springframework.xml.xsd.XsdSchema> schemas) Set the list of known schemas.
-
Constructor Details
-
XsdSchemaRepository
public XsdSchemaRepository()
-
-
Method Details
-
canValidate
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 interfaceInitializingPhase
-
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
Get the list of known schemas.- Returns:
- the schemaSources
-
setSchemas
Set the list of known schemas.- Parameters:
schemas- the schemas to set
-
setSchemaMappingStrategy
Set the schema mapping strategy.- Parameters:
schemaMappingStrategy- the schemaMappingStrategy to set
-
getSchemaMappingStrategy
Gets the schema mapping strategy.- Returns:
- The current XsdSchemaMappingStrategy
-
setName
-
getName
Gets the name.- Returns:
- the name to get.
-
getLocations
Gets the locations.- Returns:
- the locations to get.
-
setLocations
Sets the locations.- Parameters:
locations- the locations to set
-