當前位置: 首頁>>代碼示例>>Java>>正文


Java Digester.setNamespaceAware方法代碼示例

本文整理匯總了Java中org.apache.commons.digester.Digester.setNamespaceAware方法的典型用法代碼示例。如果您正苦於以下問題:Java Digester.setNamespaceAware方法的具體用法?Java Digester.setNamespaceAware怎麽用?Java Digester.setNamespaceAware使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.commons.digester.Digester的用法示例。


在下文中一共展示了Digester.setNamespaceAware方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: XmlParser

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
/**
     * Constructor.
     * Creates a digester parser and initializes syntax rules.
     */
 public XmlParser()
 {
digester = new Digester();
digester.setValidating(validating);
digester.setNamespaceAware(true);
digester.setUseContextClassLoader(true);
// Register our local copy of the DTDs that we can find
 for (int i = 0; i < registrations.length; i += 2) {
     URL url = this.getClass().getResource(registrations[i+1]);
     if (url != null)
         {
         digester.register(registrations[i], url.toString());
         }
 }
   // Init syntax rules
 initDigester( digester );
 }
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:22,代碼來源:XmlParser.java

示例2: parseConfig

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
private void parseConfig(String publicId, String entityURL,
    String strutsConfig) {
    // Prepare a Digester for parsing a struts-config.xml file
    Digester digester = new Digester();

    digester.push(config);
    digester.setNamespaceAware(true);
    digester.setValidating(true);
    digester.addRuleSet(new ConfigRuleSet());
    digester.register(publicId,
        this.getClass().getResource(entityURL).toString());

    // Parse the test struts-config.xml file
    try {
        InputStream input =
            this.getClass().getResourceAsStream(strutsConfig);

        assertNotNull("Got an input stream for " + strutsConfig, input);
        digester.parse(input);
        input.close();
    } catch (Throwable t) {
        t.printStackTrace(System.out);
        fail("Parsing threw exception:  " + t);
    }
}
 
開發者ID:SonarSource,項目名稱:sonar-scanner-maven,代碼行數:26,代碼來源:TestModuleConfig.java

示例3: XmlParser

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
/**
    * Constructor.
    * Creates a digester parser and initializes syntax rules.
    */
public XmlParser()
{
  digester = new Digester();
  digester.setValidating(validating);
  digester.setNamespaceAware(true);
  digester.setUseContextClassLoader(true);
  // Register our local copy of the DTDs that we can find
for (int i = 0; i < registrations.length; i += 2) {
    URL url = this.getClass().getResource(registrations[i+1]);
    if (url != null)
        {
        digester.register(registrations[i], url.toString());
        }
}
  // Init syntax rules
initDigester( digester );
}
 
開發者ID:SonarSource,項目名稱:sonar-scanner-maven,代碼行數:22,代碼來源:XmlParser.java

示例4: DdlUtilsDataHandling

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
/**
 * Creates a new data handling object.
 */
public DdlUtilsDataHandling()
{
    _digester = new Digester();
    _digester.setEntityResolver(new EntityResolver() {
        public InputSource resolveEntity(String publicId, String systemId)
        {
            // we don't care about the DTD for data files
            return new InputSource(new StringReader(""));
        }

    });
    _digester.setNamespaceAware(true);
    _digester.setValidating(false);
    _digester.setUseContextClassLoader(true);
    _digester.setRules(new ExtendedBaseRules());
    _digester.addRuleSet(new DataRuleSet());
}
 
開發者ID:KualiCo,項目名稱:ojb,代碼行數:21,代碼來源:DdlUtilsDataHandling.java

示例5: S2ValidatorResources

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
/**
 * インスタンスを構築します。
 * 
 * @param streams
 *            入力ストリームの配列
 * @throws IOException
 *             IO例外が発生した場合。
 * @throws SAXException
 *             SAX例外が発生した場合。
 */
public S2ValidatorResources(InputStream[] streams) throws IOException,
        SAXException {
    URL rulesUrl = ValidatorResources.class
            .getResource("digester-rules.xml");
    Digester digester = DigesterLoader.createDigester(rulesUrl);
    digester.setNamespaceAware(true);
    digester.setValidating(true);
    digester.setUseContextClassLoader(true);
    for (int i = 0; i < REGISTRATIONS.length; i += 2) {
        URL url = ValidatorResources.class
                .getResource(REGISTRATIONS[i + 1]);
        if (url != null) {
            digester.register(REGISTRATIONS[i], url.toString());
        }
    }
    for (int i = 0; i < streams.length; i++) {
        digester.push(this);
        digester.parse(streams[i]);
    }
    initialize();
}
 
開發者ID:seasarorg,項目名稱:sa-struts,代碼行數:32,代碼來源:S2ValidatorResources.java

示例6: 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

示例7: 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

示例8: 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

示例9: initDigester

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
/**
 *  Initialize the digester.
 */
private Digester initDigester() {
    URL rulesUrl = this.getClass().getResource(VALIDATOR_RULES);
    if (rulesUrl == null) {
        // Fix for Issue# VALIDATOR-195
        rulesUrl = ValidatorResources.class.getResource(VALIDATOR_RULES);
    }
    if (getLog().isDebugEnabled()) {
        getLog().debug("Loading rules from '" + rulesUrl + "'");
    }
    Digester digester = DigesterLoader.createDigester(rulesUrl);
    digester.setNamespaceAware(true);
    digester.setValidating(true);
    digester.setUseContextClassLoader(true);

    // Add rules for arg0-arg3 elements
    addOldArgRules(digester);

    // register DTDs
    for (int i = 0; i < REGISTRATIONS.length; i += 2) {
        URL url = this.getClass().getResource(REGISTRATIONS[i + 1]);
        if (url != null) {
            digester.register(REGISTRATIONS[i], url.toString());
        }
    }
    return digester;
}
 
開發者ID:ManfredTremmel,項目名稱:gwt-commons-validator,代碼行數:30,代碼來源:ValidatorResources.java

示例10: createEmptyDigester

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
static protected Digester createEmptyDigester()
  throws ParserConfigurationException, SAXException
{
  SAXParserFactory spf = SAXParserFactory.newInstance();
  spf.setNamespaceAware(true);
  // requires JAXP 1.3, in JavaSE 5.0
  // spf.setXIncludeAware(true);
  Digester digester = new Digester(spf.newSAXParser());
  digester.setNamespaceAware(true);

  return digester;
}
 
開發者ID:alessandroleite,項目名稱:maven-jdev-plugin,代碼行數:13,代碼來源:FacesConfigParser.java

示例11: getDigester

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
protected static Digester getDigester() {

		Digester digester = new Digester();

		digester.setValidating(false);

		digester.addObjectCreate("rss", RSS.class);
		digester.addSetProperties("rss");

		digester.addObjectCreate("rss/channel", Channel.class);
		digester.addSetProperties("rss/channel");
		digester.addCallMethod("rss/channel/title", "setTitle", 0);
		digester.addSetNext("rss/channel", "addChannel");

		digester.addObjectCreate("rss/channel/item", Item.class);
		digester.addSetProperties("rss/channel/item");
		digester.addCallMethod("rss/channel/item/title", "setTitle", 0);
		digester.addCallMethod("rss/channel/item/guid", "setGuid", 0);
		digester.addCallMethod("rss/channel/item/link", "setLink", 0);
		digester.addCallMethod("rss/channel/item/description", "setDescription", 0);
		digester.addCallMethod("rss/channel/item/author", "setAuthor", 0);
		digester.addCallMethod("rss/channel/item/pubDate", "setPubDate", 0);
		digester.addCallMethod("rss/channel/item/category", "addCategory", 1);
		digester.addCallParam("rss/channel/item/category", 0);
		digester.addSetNext("rss/channel/item", "addItem");

		digester.addObjectCreate("rss/channel/item/enclosure", Enclosure.class);
		digester.addSetProperties("rss/channel/item/enclosure");
		digester.addSetNext("rss/channel/item/enclosure", "addEnclosure");

		digester.setNamespaceAware(true);

		digester.setRuleNamespaceURI("http://purl.org/rss/1.0/modules/content/");
		// some feeds use <content:encoded> for their HTML
		digester.addCallMethod("rss/channel/item/encoded", "setDescription", 0);

		return digester;
	}
 
開發者ID:bmunzenb,項目名稱:feed-buddy,代碼行數:39,代碼來源:RSSParser.java

示例12: parseRecord

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
private static List<RawOccurrenceRecord> parseRecord(InputSource inputSource, OccurrenceSchemaType schemaType)
  throws IOException, SAXException {
  RawOccurrenceRecordBuilder builder = new RawOccurrenceRecordBuilder();
  Digester digester = new Digester();
  digester.setNamespaceAware(true);
  digester.setValidating(false);
  digester.push(builder);
  digester.addRuleSet(RULE_SETS.get(schemaType));
  digester.parse(inputSource);

  builder.resolvePriorities();
  return builder.generateRawOccurrenceRecords();
}
 
開發者ID:gbif,項目名稱:occurrence,代碼行數:14,代碼來源:XmlFragmentParser.java

示例13: createDigester

import org.apache.commons.digester.Digester; //導入方法依賴的package包/類
public static Digester createDigester(boolean validateXml) {

		Digester digester = new Digester();

		digester.setNamespaceAware(false);
		digester.setUseContextClassLoader(true);
		digester.setValidating(validateXml);

		try {
			digester.addRuleSet(new ManagedBeanRuleSet());
		} catch (IncompatibleClassChangeError e) {
			e.printStackTrace();
		}

		digester.push(new FacesConfigBean());

		return digester;

	}
 
開發者ID:camac,項目名稱:Barista,代碼行數:20,代碼來源:BaristaUtil.java

示例14: 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.setNamespaceAware方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。