当前位置: 首页>>代码示例>>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;未经允许,请勿转载。