These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework SimpleSaxErrorHandler class.
* */ public class MergeJPAPersistenceResource extends MergeXmlConfigResource { private static final Log LOG = LogFactory.getLog(MergeJPAPersistenceResource.class); private ErrorHandler handler = new SimpleSaxErrorHandler(LOG); public Resource getMergedConfigResource(ResourceInputStream[] sources) throws BeansException { Resource configResource = null; ResourceInputStream merged = null; try { List<String> mappingFiles = new ArrayList<String>(20); ResourceInputStream[] inMemoryStreams = new ResourceInputStream[sources.length]; for (int j=0;j<sources.length;j++){ byte[] sourceArray = buildArrayFromStream(sources[j]); compileMappingFiles(mappingFiles, sourceArray); inMemoryStreams[j] = new ResourceInputStream(new ByteArrayInputStream(sourceArray), sources[j].getName()); } merged = merge(inMemoryStreams);
public class JsrBeanDefinitionDocumentReaderTests extends AbstractJsrTestCase { private static final String JOB_PARAMETERS_BEAN_DEFINITION_NAME = "jsr_jobParameters"; private Log logger = LogFactory.getLog(getClass()); private DocumentLoader documentLoader = new DefaultDocumentLoader(); private ErrorHandler errorHandler = new SimpleSaxErrorHandler(logger); @Test @SuppressWarnings("resource") public void testGetJobParameters() { Properties jobParameters = new Properties(); jobParameters.setProperty("jobParameter1", "jobParameter1Value"); jobParameters.setProperty("jobParameter2", "jobParameter2Value"); JsrXmlApplicationContext applicationContext = new JsrXmlApplicationContext(jobParameters); applicationContext.setValidating(false); applicationContext.load(new ClassPathResource("baseContext.xml"), new ClassPathResource("/META-INF/batch.xml"), new ClassPathResource("/META-INF/batch-jobs/jsrPropertyPreparseTestJob.xml")); applicationContext.refresh();
private boolean validating; public AbstractDomXmlRpcParser() { super(); setEntityResolver(new XmlRpcDtdResolver()); setErrorHandler(new SimpleSaxErrorHandler(logger)); } /** * Creates a new XML document by parsing the given InputStream. * * @param inputStream * the InputStream to parse. * @return the created XML document. * @throws XmlRpcServerException * if there are any internal errors. * @throws XmlRpcParsingException * if there are any errors during the parsing. */ protected final Document loadXmlDocument(InputStream inputStream) {