本文整理汇总了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();
}
}
示例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);
}
}
示例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);
}
}
示例4: clearNdrInfo
import org.dom4j.Element; //导入方法依赖的package包/类
/** Clear the ndrInfo element */
public void clearNdrInfo() {
Element ndrInfo = getNdrInfo();
if (ndrInfo != null) {
ndrInfo.clearContent();
}
}
示例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");
}