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


Java Element.clearContent方法代碼示例

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


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

示例1: DcsDataRecord

import org.dom4j.Element; //導入方法依賴的package包/類
/**
 *  Constructor for DcsDataRecord.
 *
 * @param  dcsDataFile       file on disk containing xml source
 * @param  framework         this record's framework
 * @param  collectionConfig  this record's collection
 * @param  dcsDataManager    manager for all dcsDataRecords
 */
public DcsDataRecord(File dcsDataFile, MetaDataFramework framework, CollectionConfig collectionConfig, DcsDataManager dcsDataManager) {
	this.dcsDataManager = dcsDataManager;
	this.collectionConfig = collectionConfig;
	this.source = dcsDataFile;
	this.framework = framework;
	try {
		this.doc = getDocument();
	} catch (Throwable e) {
		prtlnErr("failed to create document: " + e.getMessage());
	}
	if (!source.exists()) { // this is a new DcsDataRecord
		setValidationReport(Constants.UNKNOWN_VALIDITY);
		// an empty or null value means the record is valid
		String dateString = RepositoryService.getDateString();
		setLastTouchDate(dateString);

		// clear the currentStatusEntry - it is initialized when the record is indexed
		// (in RepositoryService.saveNewRecord)
		Element currentEntry = (Element) getNode("/dcsDataRecord/statusEntries");
		currentEntry.clearContent();
	}
	else {
		normalizeStatus();
	}
}
 
開發者ID:NCAR,項目名稱:joai-project,代碼行數:34,代碼來源:DcsDataRecord.java

示例2: setStatusMap

import org.dom4j.Element; //導入方法依賴的package包/類
/**
 *  NOTE: if we edit the config record via schemedit, the record is
 *  automatically updated and then we have to reload it. But if we edit the
 *  statusMap via another editor, then this method is necessary to update the
 *  config file
 *
 * @param  sMap           The new statusMap value
 * @exception  Exception  NOT YET DOCUMENTED
 */
public void setStatusMap(Map sMap) throws Exception {
	// prtln ("setStatusMap()");
	Node statusFlagsNode = getNode(statusFlagsPath);
	if (statusFlagsNode == null) {
		statusFlagsNode = getDocMap().createNewNode(statusFlagsPath);
		if (statusFlagsNode == null)
			throw new Exception("statusMap node could not found or created");
	}
	Element statusFlagsElement = (Element) statusFlagsNode;
	statusFlagsElement.clearContent();
	statusMap = null;

	for (Iterator i = sMap.keySet().iterator(); i.hasNext(); ) {
		String status = (String) i.next();
		String description = (String) sMap.get(status);

		Element statusFlag = statusFlagsElement.addElement("statusFlag");

		Element statusElement = statusFlag.addElement("status");
		statusElement.setText(status);

		Element descriptionElement = statusFlag.addElement("description");
		descriptionElement.setText(description);
	}
}
 
開發者ID:NCAR,項目名稱:joai-project,代碼行數:35,代碼來源:CollectionConfigReader.java

示例3: setTupleMap

import org.dom4j.Element; //導入方法依賴的package包/類
/**
 *  Sets the tupleMap attribute of the CollectionConfigReader object
 *
 * @param  tMap           The new tupleMap value
 * @exception  Exception  NOT YET DOCUMENTED
 */
public void setTupleMap(Map tMap) throws Exception {
	Node tuplesNode = getNode(tuplesPath);
	if (tuplesNode == null) {
		tuplesNode = getDocMap().createNewNode(tuplesPath);
		if (tuplesNode == null)
			throw new Exception("tupleMap node could not found or created");
	}
	Element tuplesElement = (Element) tuplesNode;
	tuplesElement.clearContent();
	tupleMap = null;

	for (Iterator i = tMap.keySet().iterator(); i.hasNext(); ) {
		String name = (String) i.next();
		String value = (String) tMap.get(name);

		Element tuple = tuplesElement.addElement("tuple");

		Element statusElement = tuple.addElement("name");
		statusElement.setText(name);

		Element descriptionElement = tuple.addElement("value");
		descriptionElement.setText(value);
	}
}
 
開發者ID:NCAR,項目名稱:joai-project,代碼行數:31,代碼來源:CollectionConfigReader.java

示例4: clearNdrInfo

import org.dom4j.Element; //導入方法依賴的package包/類
/**  Clear the ndrInfo element  */
public void clearNdrInfo() {
	Element ndrInfo = getNdrInfo();
	if (ndrInfo != null) {
		ndrInfo.clearContent();
	}
}
 
開發者ID:NCAR,項目名稱:joai-project,代碼行數:8,代碼來源:DcsDataRecord.java

示例5: clearNdrInfo

import org.dom4j.Element; //導入方法依賴的package包/類
/**  
* Remove all ndrInfo from the CollectionConfig and set "authority" to "dcs".
*/
public void clearNdrInfo() {
	Element ndrInfo = (Element) getNode(ndrInfoPath);
	if (ndrInfo != null) {
		ndrInfo.clearContent();
	}
	setAuthority("dcs");
}
 
開發者ID:NCAR,項目名稱:joai-project,代碼行數:11,代碼來源:CollectionConfigReader.java


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