@Test public void instantiates_an_implicit_schema_validator_when_no_schema_is_set() throws Exception { DomSourceValidator validator = factory.createValidator(domSource("<changelog></changelog>")); assertThat(validator).isInstanceOf(ImplicitSchemaValidator.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);  }