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


Java CharacterData.getData方法代碼示例

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


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

示例1: getDataFromElement

import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
/**
 * getDataFromElement - Make XML parsing a bit easier 
 * @param e XML Element
 * @return XML data as a String
 */
public static String getDataFromElement(Element e) {
	try {
		Node child = e.getFirstChild();
		if (child instanceof CharacterData) {
			CharacterData cd = (CharacterData) child;
			return cd.getData();
		}
	}
	
	catch (Exception ex) {
		logger.debug("Error in getDataFromElement");
		logger.debug(ex.getMessage());
		logger.debug(ex.getStackTrace());
	}
	return "";
}
 
開發者ID:swift-lang,項目名稱:swift-k,代碼行數:22,代碼來源:QueuePoller.java

示例2: getCharacterDataFromElement

import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
public static String getCharacterDataFromElement(Element e) {
  Node child = e.getFirstChild();
  if (child instanceof CharacterData) {
    CharacterData cd = (CharacterData) child;
    return cd.getData();
  }
  return "";
}
 
開發者ID:iurigodoy,項目名稱:Monsters_Portal,代碼行數:9,代碼來源:CalculoFreteCorreio.java

示例3: convertToSoapText

import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
protected TextImpl convertToSoapText(CharacterData characterData) {
        final Node soapNode = getSoapDocument().findIfPresent(characterData);
        if (soapNode instanceof TextImpl) {
            return (TextImpl) soapNode;
        } else {
            TextImpl t = null;
            switch (characterData.getNodeType()) {
                case CDATA_SECTION_NODE:
                    t = new CDATAImpl(getSoapDocument(), characterData.getData());
                    break;
                case COMMENT_NODE:
                    t = new SOAPCommentImpl(getSoapDocument(), characterData.getData());
                    break;
                case TEXT_NODE:
                    t = new SOAPTextImpl(getSoapDocument(), characterData.getData());
                    break;
            }
            Node parent = getSoapDocument().find(characterData.getParentNode());
            if (parent != null) {
                parent.replaceChild(t, characterData);
            } // XXX else throw an exception?

            return t;

//            return replaceElementWithSOAPElement(
//                element,
//                (ElementImpl) createElement(NameImpl.copyElementName(element)));
        }
    }
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:30,代碼來源:ElementImpl.java

示例4: getCharacterDataFromElement

import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
private String getCharacterDataFromElement(Element e) {
    try {
        Node child = e.getFirstChild();
        if (child instanceof CharacterData) {
            CharacterData cd = (CharacterData) child;
            return cd.getData();
        }
    } catch (Exception ex) {
        ex.printStackTrace();
    }
    return "";
}
 
開發者ID:tekrei,項目名稱:JavaExamples,代碼行數:13,代碼來源:CurrencyReader.java

示例5: getCharacterDataFromElement

import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
/**
 * Retrieve character data from an element if it exists
 * 
 * @param e is the DOM Element to retrieve character data from
 * @return the character data as String [possibly empty String]
 */
private static String getCharacterDataFromElement (Element e) {
	Node child = e.getFirstChild();
    if (child instanceof CharacterData) {
        CharacterData cd = (CharacterData) child;
        return cd.getData();
      }
      return "";
}
 
開發者ID:king-jam,項目名稱:cs509,代碼行數:15,代碼來源:Flights.java

示例6: getCharacterDataFromElement

import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
public static String getCharacterDataFromElement(Element e) {
  Node child = e.getFirstChild();
  if (child instanceof CharacterData) {
     CharacterData cd = (CharacterData) child;
     return cd.getData();
  }
   
  return"" ;
}
 
開發者ID:csc-egov,項目名稱:BridgePG-Java,代碼行數:10,代碼來源:ApiCall.java

示例7: getCharacterDataFromElement

import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
private String getCharacterDataFromElement(Element e) {
	Node child = e.getFirstChild();
	if (child instanceof CharacterData) {
		CharacterData cd = (CharacterData) child;
		return cd.getData();
	}
	return "?";
}
 
開發者ID:DiscourseDB,項目名稱:discoursedb-core,代碼行數:9,代碼來源:HabworldsConverterService.java

示例8: getCharacterDataFromElement

import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
public static String getCharacterDataFromElement(Element e) {
   Node child = e.getFirstChild();
   if (child instanceof CharacterData) {
     CharacterData cd = (CharacterData) child;
     return cd.getData();
   }
   return "";
}
 
開發者ID:bucaojit,項目名稱:RealEstate-Streaming,代碼行數:9,代碼來源:ProcessXMLTest.java

示例9: getCharacterDataFromElement

import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
/**
 * convert the value of a given XML element to a string for further processing
 * 
 * @param e
 *            XML Element
 * @return the elements value converted to string
 */
private static String getCharacterDataFromElement(Element e) {
	final Node child = e.getFirstChild();
	if (child instanceof CharacterData) {
		final CharacterData cd = (CharacterData) child;
		return cd.getData();
	}
	return "";
}
 
開發者ID:andrey-desman,項目名稱:openhab-hdl,代碼行數:16,代碼來源:FrontierSiliconRadioApiResult.java

示例10: getCharacterDataFromElement

import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
public static String getCharacterDataFromElement(Element e) {
    org.w3c.dom.Node child = e.getFirstChild();
    if (child instanceof CharacterData) {
        CharacterData cd = (CharacterData) child;
        return cd.getData();
    }
    return "?";
}
 
開發者ID:AnyObject,項目名稱:OAT,代碼行數:9,代碼來源:XMLUtil.java

示例11: getCharacterDataFromElement

import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
public static String getCharacterDataFromElement(Element e) {
	Node child = e.getFirstChild();
	if (child instanceof CharacterData) {
		CharacterData cd = (CharacterData) child;
		return cd.getData();
	} else {
		return "?";
	}
}
 
開發者ID:telefonicaid,項目名稱:netphony-gmpls-emulator,代碼行數:10,代碼來源:ParametersPrueba.java

示例12: getCharacterDataFromElement

import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
public static String getCharacterDataFromElement(Element e) {
	org.w3c.dom.Node child = e.getFirstChild();
	if (child instanceof CharacterData) {
		CharacterData cd = (CharacterData) child;
		return cd.getData();
	} else {
		return "?";
	}
}
 
開發者ID:telefonicaid,項目名稱:netphony-gmpls-emulator,代碼行數:10,代碼來源:VNTMGraph.java

示例13: getCharacterDataFromElement

import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
public static String getCharacterDataFromElement(Element e) {
    Node child = e.getFirstChild();

    if (child instanceof CharacterData) {
        CharacterData cd = (CharacterData) child;
        return cd.getData();
    }
    return "?";
}
 
開發者ID:Frenk44,項目名稱:sphinx,代碼行數:10,代碼來源:Stimulator.java

示例14: getCharacterDataFromElement

import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
String getCharacterDataFromElement(Element element)
{
    Node child = element.getFirstChild();
    if (child instanceof CharacterData) {
        CharacterData characterData = (CharacterData) child;
        return characterData.getData();
    }
    return "";
}
 
開發者ID:mcruncher,項目名稱:worshipsongs-android,代碼行數:10,代碼來源:SongParser.java

示例15: getCharacterDataFromElement

import org.w3c.dom.CharacterData; //導入方法依賴的package包/類
private String getCharacterDataFromElement(Element e) {
	Node child = e.getFirstChild();
	if (child instanceof CharacterData) {
		CharacterData cd = (CharacterData) child;
		return cd.getData();
	} else {
		return "?";
	}
}
 
開發者ID:telefonicaid,項目名稱:netphony-topology,代碼行數:10,代碼來源:TEDUpdaterODL.java


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