本文整理汇总了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);
}
}
}
示例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);
}
}
}
示例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);
}
}