@Test public void instantiates_an_explicit_schema_validator_when_schema_is_set() throws Exception { String document = "<changelog xmlns:xsi=\"http: " xsi:noNamespaceSchemaLocation=\"http: "</changelog>"; DomSourceValidator validator = factory.createValidator(domSource(document)); assertThat(validator).isInstanceOf(ExplicitSchemaValidator.class); }
public DomSourceValidator createValidator(DOMSource source) { if (schemaDetector.hasExplicitSchema(source)) { LOGGER.debug("Explicit schema detected: validation against schema to start"); return new ExplicitSchemaValidator(); } LOGGER.debug("No schema detected: validation against embedded schema to start"); return new ImplicitSchemaValidator(); }
DomSourceValidatorFactory { public DomSourceValidator createValidator(DOMSource source) { if (schemaDetector.hasExplicitSchema(source)) { LOGGER.debug("Explicit schema detected: validation against schema to start"); return new ExplicitSchemaValidator(); } LOGGER.debug("No schema detected: validation against embedded schema to start"); return new ImplicitSchemaValidator(); } }
DomSourceValidatorFactory { public DomSourceValidator createValidator(DOMSource source) { if (schemaDetector.hasExplicitSchema(source)) { LOGGER.debug("Explicit schema detected: validation against schema to start"); return new ExplicitSchemaValidator(); } LOGGER.debug("No schema detected: validation against embedded schema to start"); return new ImplicitSchemaValidator(); } DomSourceValidatorFactory(); }
DomSourceValidatorFactory { public DomSourceValidator createValidator(DOMSource source) { if (schemaDetector.hasExplicitSchema(source)) { LOGGER.debug("Explicit schema detected: validation against schema to start"); return new ExplicitSchemaValidator(); } LOGGER.debug("No schema detected: validation against embedded schema to start"); return new ImplicitSchemaValidator(); } DomSourceValidatorFactory(); DomSourceValidator createValidator(DOMSource source); }
DomSourceValidatorFactory { public DomSourceValidator createValidator(DOMSource source) { if (schemaDetector.hasExplicitSchema(source)) { LOGGER.debug("Explicit schema detected: validation against schema to start"); return new ExplicitSchemaValidator(); } LOGGER.debug("No schema detected: validation against embedded schema to start"); return new ImplicitSchemaValidator(); } DomSourceValidatorFactory(); DomSourceValidator createValidator(DOMSource source);  }