当前位置: 首页>>代码示例>>Java>>正文


Java Digester.setErrorHandler方法代码示例

本文整理汇总了Java中org.apache.commons.digester.Digester.setErrorHandler方法的典型用法代码示例。如果您正苦于以下问题:Java Digester.setErrorHandler方法的具体用法?Java Digester.setErrorHandler怎么用?Java Digester.setErrorHandler使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.digester.Digester的用法示例。


在下文中一共展示了Digester.setErrorHandler方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configureDigester

import org.apache.commons.digester.Digester; //导入方法依赖的package包/类
protected void configureDigester(JasperReportsContext jasperReportsContext, Digester digester) throws SAXException, ParserConfigurationException 
{
	digester.setNamespaceAware(true);
	digester.setRuleNamespaceURI(JRXmlConstants.JASPERTEMPLATE_NAMESPACE);
	
	boolean validating = JRPropertiesUtil.getInstance(jasperReportsContext).getBooleanProperty(JRReportSaxParserFactory.COMPILER_XML_VALIDATION);
	
	digester.setErrorHandler(this);
	digester.setValidating(validating);
	digester.setFeature("http://xml.org/sax/features/validation", validating);

	digester.addRuleSet(rules);
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:14,代码来源:JRXmlTemplateDigesterFactory.java

示例2: getDigester

import org.apache.commons.digester.Digester; //导入方法依赖的package包/类
/**
 * <p>Configures a Digester</p>
 *
 * @return Digester
 */
private Digester getDigester() {

    final SaxErrorHandler errorHandler = new SaxErrorHandler();

    final Digester digester = new Digester();
    digester.setErrorHandler(errorHandler);
    digester.setValidating(true);
    digester.setEntityResolver(new DtdEntityResolver());

    return digester;
}
 
开发者ID:AndyScherzinger,项目名称:architecturerules,代码行数:17,代码来源:DigesterConfigurationFactory.java

示例3: buildDigester

import org.apache.commons.digester.Digester; //导入方法依赖的package包/类
/**
 * @return fully-initialized Digester used to process entry XML files
 */
protected Digester buildDigester(String schemaLocation, String digestorRulesFileName) {
    Digester digester = new Digester();
    digester.setNamespaceAware(false);
    digester.setValidating(true);
    digester.setErrorHandler(new XmlErrorHandler());
    digester.setSchema(schemaLocation);

    Rules rules = loadRules(digestorRulesFileName);

    digester.setRules(rules);

    return digester;
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:17,代码来源:XmlBatchInputFileTypeBase.java

示例4: buildDigester

import org.apache.commons.digester.Digester; //导入方法依赖的package包/类
/**
 * @return fully-initialized Digester used to process entry XML files
 */
private Digester buildDigester(String schemaLocation, String digestorRulesFileName) {
    Digester digester = new Digester();
    digester.setNamespaceAware(false);
    digester.setValidating(true);
    digester.setErrorHandler(new XmlErrorHandler());
    digester.setSchema(schemaLocation);

    Rules rules = loadRules(digestorRulesFileName);

    digester.setRules(rules);

    return digester;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:17,代码来源:CustomerInvoiceWriteoffBatchDigesterTest.java

示例5: execute

import org.apache.commons.digester.Digester; //导入方法依赖的package包/类
/**
 * Installs a module description in the target OpenCms. Module description
 * comes from the path given in the parameter configurationXml. The XML file
 * there contains module description(s) in the format as in WEB-INF/config/opencms-modules.xml
 * or manifest.xml of an exported module. It may contain multiple modules,
 * but it must be well formed, say, in case of multiple modules it must have one root node
 * containing the module entries. These module configuration(s) get added to
 * WEB-INF/config/opencms-modules.xml of the target installation.
 * Module content gets sync'ed and published afterwards by the respective plugin goals.
 *
 * @param webappDirectory
 *            path to WEB-INF of the OpenCms installation
 * @param adminPassword
 *            password of user "Admin" performing the operation
 * @param moduleSourcePath
 *            path to module xml configuration file
 * @throws CmsException
 *             if anything OpenCms goes wrong
 * @throws IOException
 *             in case configuration files cannot be read
 * @throws SAXException
 *             in case configuration files cannot be parsed
 */
public final void execute(final String webappDirectory,
    final String adminPassword, final String moduleSourcePath, final String moduleVersion)
    throws IOException, CmsException, SAXException {
    final String webinfdir = webappDirectory + File.separatorChar +
        "WEB-INF";
    final CmOpenCmsShell cmsshell = CmOpenCmsShell.getInstance(webinfdir,
            "Admin", adminPassword);

    this.moduleVersion = moduleVersion;
    
    if (cmsshell != null) {
        this.cms = cmsshell.getCmsObject();

        final CmsRequestContext requestcontext = this.cms.getRequestContext();
        requestcontext.setCurrentProject(this.cms.readProject("Offline"));
        
        this.setReport(new CmsShellReport(requestcontext.getLocale()));
        
        // code taken from org.opencms.module.CmsModuleImportExportHandler (readModuleFromImport)
        final Digester digester = new Digester();
        digester.setUseContextClassLoader(true);
        digester.setValidating(false);
        digester.setRuleNamespaceURI(null);
        digester.setErrorHandler(new CmsXmlErrorHandler());
        digester.push(this);
        CmsModuleXmlHandler.addXmlDigesterRules(digester);
        
        simpleReport("Parsing module file: "+moduleSourcePath+". Version: "+moduleVersion);            
        digester.parse(new FileInputStream(new File(moduleSourcePath)));
        simpleReport("End of parsing module file: "+moduleSourcePath+". Version: "+moduleVersion);
    }else{
    	System.err.println("[WARN]VfsModule.execute(): CmsShell not available");
    }
}
 
开发者ID:comundus,项目名称:vfs-maven-plugin,代码行数:58,代码来源:VfsModule.java

示例6: getDigester

import org.apache.commons.digester.Digester; //导入方法依赖的package包/类
public Digester getDigester(Configuration configuration) throws SAXNotSupportedException, SAXNotRecognizedException {
	Digester digester = new Digester();
	digester.setUseContextClassLoader(true);
	digester.push(configuration);

	URL digesterRulesURL = ClassUtils.getResourceURL(this, getDigesterRules());
	FromXmlRuleSet ruleSet = new FromXmlRuleSet(digesterRulesURL);
	digester.addRuleSet(ruleSet);

	Rule attributeChecker = new AttributeCheckingRule();
	digester.addRule("*/jmsRealms", attributeChecker);
	digester.addRule("*/jmsRealm", attributeChecker);
	digester.addRule("*/sapSystem", attributeChecker);
	digester.addRule("*/adapter", attributeChecker);
	digester.addRule("*/pipeline", attributeChecker);
	digester.addRule("*/errorMessageFormatter", attributeChecker);
	digester.addRule("*/receiver", attributeChecker);
	digester.addRule("*/sender", attributeChecker);
	digester.addRule("*/listener", attributeChecker);
	digester.addRule("*/postboxSender", attributeChecker);
	digester.addRule("*/postboxListener", attributeChecker);
	digester.addRule("*/errorSender", attributeChecker);
	digester.addRule("*/messageLog", attributeChecker);
	digester.addRule("*/inProcessStorage", attributeChecker);
	digester.addRule("*/errorStorage", attributeChecker);
	digester.addRule("*/pipe", attributeChecker);
	digester.addRule("*/readerFactory", attributeChecker);
	digester.addRule("*/manager", attributeChecker);
	digester.addRule("*/manager/flow", attributeChecker);
	digester.addRule("*/recordHandler", attributeChecker);
	digester.addRule("*/resultHandler", attributeChecker);
	digester.addRule("*/forward", attributeChecker);
	digester.addRule("*/child", attributeChecker);
	digester.addRule("*/param", attributeChecker);
	digester.addRule("*/pipeline/exits/exit", attributeChecker);
	digester.addRule("*/scheduler/job", attributeChecker);
	digester.addRule("*/locker", attributeChecker);
	digester.addRule("*/directoryCleaner", attributeChecker);
	digester.addRule("*/statistics", attributeChecker);
	digester.addRule("*/handler", attributeChecker);
	digester.addRule("*/cache", attributeChecker);
	digester.addRule("*/inputValidator", attributeChecker);
	digester.addRule("*/outputValidator", attributeChecker);
	digester.addRule("*/inputWrapper", attributeChecker);
	digester.addRule("*/outputWrapper", attributeChecker);
	if (MonitorManager.getInstance().isEnabled()) {
		MonitorManager.getInstance().setDigesterRules(digester);
	}

	boolean validation = AppConstants.getInstance().getBoolean(CONFIGURATION_VALIDATION_KEY, false);
	if (validation) {
		digester.setValidating(true);
		digester.setNamespaceAware(true);
		digester.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
		digester.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", "AdapterFramework.xsd");
		XmlErrorHandler xeh = new XmlErrorHandler();
		digester.setErrorHandler(xeh);
	}

	return digester;
}
 
开发者ID:ibissource,项目名称:iaf,代码行数:62,代码来源:ConfigurationDigester.java


注:本文中的org.apache.commons.digester.Digester.setErrorHandler方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。