当前位置: 首页>>代码示例>>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;未经允许,请勿转载。