当前位置: 首页>>代码示例>>Java>>正文


Java SerializationHandler.characters方法代码示例

本文整理汇总了Java中com.sun.org.apache.xml.internal.serializer.SerializationHandler.characters方法的典型用法代码示例。如果您正苦于以下问题:Java SerializationHandler.characters方法的具体用法?Java SerializationHandler.characters怎么用?Java SerializationHandler.characters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.org.apache.xml.internal.serializer.SerializationHandler的用法示例。


在下文中一共展示了SerializationHandler.characters方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: characters

import com.sun.org.apache.xml.internal.serializer.SerializationHandler; //导入方法依赖的package包/类
/**
 * Dispatch the character content of a node to an output handler.
 *
 * The escape setting should be taken care of when outputting to
 * a handler.
 */
public void characters(final int node, SerializationHandler handler)
    throws TransletException
{
    int nodeID = getNodeIdent(node);
    if (nodeID == RTF_ROOT || nodeID == RTF_TEXT) {
        boolean escapeBit = false;
        boolean oldEscapeSetting = false;

        try {
            for (int i = 0; i < _size; i++) {

                if (_dontEscape != null) {
                    escapeBit = _dontEscape.getBit(i);
                    if (escapeBit) {
                        oldEscapeSetting = handler.setEscaping(false);
                    }
                }

                handler.characters(_textArray[i]);

                if (escapeBit) {
                    handler.setEscaping(oldEscapeSetting);
                }
            }
        } catch (SAXException e) {
            throw new TransletException(e);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:36,代码来源:SimpleResultTreeImpl.java

示例2: characters

import com.sun.org.apache.xml.internal.serializer.SerializationHandler; //导入方法依赖的package包/类
/**
 * Used by some compiled code as a shortcut for passing strings to the
 * output handler
 */
public final void characters(final String string,
                             SerializationHandler handler)
    throws TransletException {
    if (string != null) {
       //final int length = string.length();
       try {
           handler.characters(string);
       } catch (Exception e) {
           throw new TransletException(e);
       }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:AbstractTranslet.java

示例3: copy

import com.sun.org.apache.xml.internal.serializer.SerializationHandler; //导入方法依赖的package包/类
public static void copy(Object obj,
                        SerializationHandler handler,
                        int node,
                        DOM dom) {
    try {
        if (obj instanceof DTMAxisIterator)
  {
            DTMAxisIterator iter = (DTMAxisIterator) obj;
            dom.copy(iter.reset(), handler);
        }
        else if (obj instanceof Node) {
            dom.copy(((Node) obj).node, handler);
        }
        else if (obj instanceof DOM) {
            //((DOM)obj).copy(((com.sun.org.apache.xml.internal.dtm.ref.DTMDefaultBase)((DOMAdapter)obj).getDOMImpl()).getDocument(), handler);
            DOM newDom = (DOM)obj;
            newDom.copy(newDom.getDocument(), handler);
        }
        else {
            String string = obj.toString();         // or call stringF()
            final int length = string.length();
            if (length > _characterArray.length)
                _characterArray = new char[length];
            string.getChars(0, length, _characterArray, 0);
            handler.characters(_characterArray, 0, length);
        }
    }
    catch (SAXException e) {
        runTimeError(RUN_TIME_COPY_ERR);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:32,代码来源:BasisLibrary.java


注:本文中的com.sun.org.apache.xml.internal.serializer.SerializationHandler.characters方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。