gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-26 17:19:05 29 4
gpt4 key购买 nike

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

XMLGrammarPoolImpl.containsGrammar介绍

[英]Returns true if the grammar pool contains a grammar associated to the specified grammar description. Currently, the root element name is used as the key for DTD grammars and the target namespace is used as the key for Schema grammars.
[中]如果语法池包含与指定语法描述关联的语法,则返回true。目前,根元素名用作DTD语法的键,目标命名空间用作模式语法的键。

代码示例

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

/**
 * Returns true if the grammar pool contains a grammar associated
 * to the specified description.
 *
 * @param desc The description of the grammar.
 */
public boolean containsGrammar(XMLGrammarDescription desc) {
  return super.containsGrammar(desc);
} // containsGrammar(XMLGrammarDescription):boolean

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

/**
 * Returns the grammar associated to the specified description.
 * 
 * @param desc The description of the grammar.
 */
public Grammar getGrammar(XMLGrammarDescription desc) {
  if (super.containsGrammar(desc)) {
    return super.getGrammar(desc);
  }
  return null;
} // getGrammar(XMLGrammarDescription):Grammar

代码示例来源: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);
   }
  }
 }
}

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