gpt4 book ai didi

org.apache.xerces.util.XMLGrammarPoolImpl.putGrammar()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-26 16:55:05 25 4
gpt4 key购买 nike

本文整理了Java中org.apache.xerces.util.XMLGrammarPoolImpl.putGrammar()方法的一些代码示例,展示了XMLGrammarPoolImpl.putGrammar()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLGrammarPoolImpl.putGrammar()方法的具体详情如下:
包路径:org.apache.xerces.util.XMLGrammarPoolImpl
类名称:XMLGrammarPoolImpl
方法名:putGrammar

XMLGrammarPoolImpl.putGrammar介绍

[英]Puts the specified grammar into the grammar pool and associates it to its root element name or its target namespace.
[中]将指定的语法放入语法池,并将其与根元素名或目标命名空间关联。

代码示例

代码示例来源:origin: com.rackspace.apache/xerces2-xsd11

public void cacheGrammars(String grammarType, Grammar[] grammars) {
  if(!fPoolIsLocked) {
    for (int i = 0; i < grammars.length; i++) {
      if(DEBUG) {
        System.out.println("CACHED GRAMMAR " + (i+1) ) ;
        Grammar temp = grammars[i] ;
        //print(temp.getGrammarDescription());
      }
      putGrammar(grammars[i]);
    }
  }
} // cacheGrammars(String, Grammar[]);

代码示例来源:origin: dita-ot/dita-ot

/**
 * @see org.apache.xerces.util.XMLGrammarPoolImpl#putGrammar(org.apache.xerces.xni.grammars.Grammar)
 */
@Override
public void putGrammar(Grammar grammar) {
 //Avoid caching any type of XSD grammar
 if (grammar instanceof org.apache.xerces.impl.xs.SchemaGrammar) {
 return;
 }
 super.putGrammar(grammar);
}

代码示例来源:origin: stackoverflow.com

XMLGrammarPoolImpl pool = new XMLGrammarPoolImpl();
pool.putGrammar(grammar);

XMLSchema11Factory factory = new XMLSchema11Factory();
Schema schema = factory.newSchema(pool);

Validator validator = schema.newValidator();

DOMSource source = new DOMSource(document);
validator.validate(source);

代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator

public void putGrammar(Grammar grammar) 
 {
  if (grammar == null)
   return;
  // we overide this method to perform 'selective' caching of schemas
  XMLGrammarDescription description = grammar.getGrammarDescription();
  if (!fPoolIsLocked && !containsGrammar(grammar.getGrammarDescription())) 
  {
   // in order to avoid caching the inline schemas
   // we ensure the literal system id does not end with wsdl
   // before we attempt to 'put' the grammar
   String litSysId = description.getLiteralSystemId();
   String basSysId = description.getBaseSystemId();
   if (litSysId != null && litSysId.endsWith("xsd")
      && basSysId != null && basSysId.endsWith("wsdl")) 
   {
        /*
         * System.out.println("putGramamr : " +
         * schemaDescription.getNamespace() + ", " +
         * schemaDescription.getExpandedSystemId() + ", " +
         * schemaDescription.getBaseSystemId());
         */
    super.putGrammar(grammar);
   }
  }
 }
}

代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator

pool.putGrammar(oldGrammar);

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com