Spring Framework DefaultDocumentLoader - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework DefaultDocumentLoader class.

This code example shows how to use the following methods:
		 
	private Resource resource;
	 
	private ErrorHandler errorHandler = new RiotSaxErrorHandler(log);
 
	private DocumentLoader loader = new DefaultDocumentLoader();
	 
	public DocumentReader(Resource resource) {
		this.resource = resource;
	} 
	 
	protected int getValidationMode() { 
		return VALIDATION_MODE_NONE;
	} 
	 
	protected EntityResolver getEntityResolver() {
		return null; 
	} 
	 
	public Document readDocument() {
5
CodeRank
This code example shows how to use the following methods:
 */ 
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"));
4
CodeRank
This code example shows how to use the following methods:
        }  
    } 
    private SAXParserFactory saxParserFactory;
    private SAXParserFactory nsasaxParserFactory;
     
    TunedDocumentLoader() { 
        try { 
            Class<?> cls = ClassLoaderUtils.loadClass("com.ctc.wstx.sax.WstxSAXParserFactory",
                                                      TunedDocumentLoader.class); 
            saxParserFactory = (SAXParserFactory)cls.newInstance();
            nsasaxParserFactory = (SAXParserFactory)cls.newInstance();
        } catch (Throwable e) {
            //woodstox not found, use any other Stax parser 
            saxParserFactory = SAXParserFactory.newInstance();
            nsasaxParserFactory = SAXParserFactory.newInstance();
        } 
 
        try { 
            nsasaxParserFactory.setFeature("http://xml.org/sax/features/namespaces", true); 
            nsasaxParserFactory.setFeature("http://xml.org/sax/features/namespace-prefixes", 
4
CodeRank
This code example shows how to use the following methods:
 * </p> 
 * 
 * @author Mulesoft Inc. 
 * @since 3.4 
 */ 
public class MunitDocumentLoader extends DefaultDocumentLoader 
{ 
 
    static final String JAXP_SCHEMA_LANGUAGE = 
            "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; 
    static final String W3C_XML_SCHEMA = 
            "http://www.w3.org/2001/XMLSchema"; 
 
    public Document loadDocument(InputSource inputSource, EntityResolver entityResolver, 
                                 ErrorHandler errorHandler, int validationMode, boolean namespaceAware) throws Exception 
    { 
 
        DOMParser xmlReader = new MunitDomParser(); 
        xmlReader.setFeature("http://xml.org/sax/features/validation", Boolean.TRUE); 
        xmlReader.setFeature("http://xml.org/sax/features/namespaces", Boolean.TRUE); 
4
CodeRank
This code example shows how to use the following methods:
package org.apache.cloudstack.spring.module.context; 
 
import org.apache.commons.logging.Log; 
import org.apache.commons.logging.LogFactory; 
import org.springframework.beans.factory.xml.DefaultDocumentLoader;
import org.w3c.dom.Document;
import org.xml.sax.EntityResolver;
import org.xml.sax.ErrorHandler;
import org.xml.sax.InputSource;
 
public class TimedDocumentLoader extends DefaultDocumentLoader {
 
    private static final Log logger = LogFactory.getLog(TimedDocumentLoader.class);
 
    private static long time = 0;
 
    @Override 
    public Document loadDocument(InputSource inputSource, EntityResolver entityResolver, ErrorHandler errorHandler,
            int validationMode, boolean namespaceAware) throws Exception {
        long start = System.currentTimeMillis();

4
CodeRank
See Code Examples for Spring Framework DefaultDocumentLoader Methods: