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


Java CharacterData.appendData方法代碼示例

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


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

示例1: testAppendData

import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
@Test
public void testAppendData() throws Exception {
    CharacterData cd = createCharacterData("DOM");
    cd.appendData("2");
    assertEquals(cd.getData(), "DOM2");

}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:8,代碼來源:AbstractCharacterDataTest.java

示例2: characters

import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
public void characters (char ch [], int start, int length)
throws SAXException
{
    // we can't create populated entity ref nodes using
    // only public DOM APIs (they've got to be readonly
    // at creation time)
    if (currentEntity != null)
        return;

    Node        lastChild = top.getLastChild ();

    // merge consecutive text or CDATA nodes if appropriate.
    if (lastChild instanceof Text) {
        if (consumer.isHidingCDATA ()
                // consecutive Text content ... always merge
                || (!inCDATA
                    && !(lastChild instanceof CDATASection))
                // consecutive CDATASection content ... don't
                // merge between sections, only within them
                || (inCDATA && mergeCDATA
                    && lastChild instanceof CDATASection)
                    ) {
            CharacterData       last = (CharacterData) lastChild;
            String              value = new String (ch, start, length);

            last.appendData (value);
            return;
        }
    }
    if (inCDATA && !consumer.isHidingCDATA ()) {
        top.appendChild (createText (true, ch, start, length));
        mergeCDATA = true;
    } else
        top.appendChild (createText (false, ch, start, length));
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:36,代碼來源:DomConsumer.java

示例3: characters

import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
public void characters (char ch [], int start, int length)
throws SAXException
{
    // we can't create populated entity ref nodes using
    // only public DOM APIs (they've got to be readonly
    // at creation time)
    if (currentEntity != null)
	return;

    Node	lastChild = top.getLastChild ();

    // merge consecutive text or CDATA nodes if appropriate.
    if (lastChild instanceof Text) {
	if (consumer.isHidingCDATA ()
		// consecutive Text content ... always merge
		|| (!inCDATA
		    && !(lastChild instanceof CDATASection))
		// consecutive CDATASection content ... don't
		// merge between sections, only within them
		|| (inCDATA && mergeCDATA
		    && lastChild instanceof CDATASection)
		    ) {
	    CharacterData	last = (CharacterData) lastChild;
	    String		value = new String (ch, start, length);
	    
	    last.appendData (value);
	    return;
	}
    }
    if (inCDATA && !consumer.isHidingCDATA ()) {
	top.appendChild (createText (true, ch, start, length));
	mergeCDATA = true;
    } else
	top.appendChild (createText (false, ch, start, length));
}
 
開發者ID:nmldiegues,項目名稱:jvm-stm,代碼行數:36,代碼來源:DomConsumer.java


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