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


Java ContentHandler.endPrefixMapping方法代碼示例

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


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

示例1: endPrefixMapping

import org.xml.sax.ContentHandler; //導入方法依賴的package包/類
private void endPrefixMapping(ContentHandler contentHandler, NamedNodeMap attrs, String excludePrefix) throws SAXException {
    if(attrs == null)
        return;
    for(int i=0; i < attrs.getLength();i++) {
        Attr a = (Attr)attrs.item(i);
        //check if attr is ns declaration
        if("xmlns".equals(a.getPrefix()) || "xmlns".equals(a.getLocalName())) {
            if(!fixNull(a.getPrefix()).equals(excludePrefix)) {
                contentHandler.endPrefixMapping(fixNull(a.getPrefix()));
            }
        }
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:14,代碼來源:SAAJMessage.java

示例2: writeEnd

import org.xml.sax.ContentHandler; //導入方法依賴的package包/類
/**
 * Writes the end element event.
 */
public void writeEnd(ContentHandler contentHandler) throws SAXException{
    contentHandler.endElement(fixNull(nsUri),localName,getQName());
    for( int i=ns.length-2; i>=0; i-=2 ) {
        contentHandler.endPrefixMapping(fixNull(ns[i]));
    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:10,代碼來源:TagInfoset.java

示例3: popNamespaces

import org.xml.sax.ContentHandler; //導入方法依賴的package包/類
/**
 * Pop, or undeclare all namespace definitions that are currently
 * declared at the given element depth, or deepter.
 * @param elemDepth the element depth for which mappings declared at this
 * depth or deeper will no longer be valid
 * @param saxHandler The ContentHandler to notify of any endPrefixMapping()
 * calls.  This parameter can be null.
 */
void popNamespaces(int elemDepth, ContentHandler saxHandler)
{
    while (true)
    {
        if (m_nodeStack.isEmpty())
            return;
        MappingRecord map = (MappingRecord)(m_nodeStack.peek());
        int depth = map.m_declarationDepth;
        if (depth < elemDepth)
            return;
        /* the depth of the declared mapping is elemDepth or deeper
         * so get rid of it
         */

        map = (MappingRecord) m_nodeStack.pop();
        final String prefix = map.m_prefix;
        popNamespace(prefix);
        if (saxHandler != null)
        {
            try
            {
                saxHandler.endPrefixMapping(prefix);
            }
            catch (SAXException e)
            {
                // not much we can do if they aren't willing to listen
            }
        }

    }
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:40,代碼來源:NamespaceMappings.java

示例4: generate

import org.xml.sax.ContentHandler; //導入方法依賴的package包/類
@Override
public void generate(CacheXmlGenerator cacheXmlGenerator) throws SAXException {
  final ContentHandler handler = cacheXmlGenerator.getContentHandler();

  try {
    handler.startPrefixMapping(PREFIX, NAMESPACE);

    final AttributesImpl atts = new AttributesImpl();
    addAttribute(atts, ATTRIBUTE_VALUE, extension.getValue());
    emptyElement(handler, PREFIX, ELEMENT_CACHE, atts);
  } finally {
    handler.endPrefixMapping("mock");
  }
}
 
開發者ID:ampool,項目名稱:monarch,代碼行數:15,代碼來源:MockCacheExtensionXmlGenerator.java

示例5: generate

import org.xml.sax.ContentHandler; //導入方法依賴的package包/類
@Override
public void generate(CacheXmlGenerator cacheXmlGenerator) throws SAXException {
  final ContentHandler handler = cacheXmlGenerator.getContentHandler();

  try {
    handler.startPrefixMapping(PREFIX, NAMESPACE);

    final AttributesImpl atts = new AttributesImpl();
    addAttribute(atts, ATTRIBUTE_VALUE, extension.getValue());
    emptyElement(handler, PREFIX, ELEMENT_REGION, atts);
  } finally {
    handler.endPrefixMapping(PREFIX);
  }
}
 
開發者ID:ampool,項目名稱:monarch,代碼行數:15,代碼來源:MockRegionExtensionXmlGenerator.java


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