Class XsdSchemaRepository

java.lang.Object
org.citrusframework.xml.XsdSchemaRepository
All Implemented Interfaces:
InitializingPhase, Named

public class XsdSchemaRepository extends Object implements Named, InitializingPhase
Schema repository holding a set of XML schema resources known in the test scope.
Author:
Christoph Deppisch
  • Constructor Details

    • XsdSchemaRepository

      public XsdSchemaRepository()
  • Method Details

    • 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:
      initialize in interface 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:
      IOException
      SAXException
      ParserConfigurationException
    • 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:
      setName in interface Named
    • getName

      public String getName()
      Gets the name.
      Returns:
      the name to get.
    • getLocations

      public List<String> getLocations()
      Gets the locations.
      Returns:
      the locations to get.
    • setLocations

      public void setLocations(List<String> locations)
      Sets the locations.
      Parameters:
      locations - the locations to set