本文整理汇总了Java中org.dom4j.tree.AbstractNode类的典型用法代码示例。如果您正苦于以下问题:Java AbstractNode类的具体用法?Java AbstractNode怎么用?Java AbstractNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AbstractNode类属于org.dom4j.tree包,在下文中一共展示了AbstractNode类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: applyXPath
import org.dom4j.tree.AbstractNode; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private boolean applyXPath()
{
try{
XPath xpath = data.document.createXPath(data.PathValue);
if(meta.isNamespaceAware())
{
xpath = data.document.createXPath(addNSPrefix(data.PathValue, data.PathValue));
xpath.setNamespaceURIs(data.NAMESPACE);
}
// get nodes list
data.an = (List<AbstractNode>) xpath.selectNodes(data.document);
data.nodesize=data.an.size();
data.nodenr=0;
}catch (Exception e)
{
log.logError(toString(),Messages.getString("GetXMLData.Log.ErrorApplyXPath",e.getMessage()));
return false;
}
return true;
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:22,代码来源:GetXMLData.java
示例2: applyXPath
import org.dom4j.tree.AbstractNode; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private boolean applyXPath()
{
try{
XPath xpath = data.document.createXPath(data.PathValue);
if(meta.isNamespaceAware())
{
xpath = data.document.createXPath(addNSPrefix(data.PathValue, data.PathValue));
xpath.setNamespaceURIs(data.NAMESPACE);
}
// get nodes list
data.an = (List<AbstractNode>) xpath.selectNodes(data.document);
data.nodesize=data.an.size();
data.nodenr=0;
}catch (Exception e)
{
logError(BaseMessages.getString(PKG, "GetXMLData.Log.ErrorApplyXPath",e.getMessage()));
return false;
}
return true;
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:22,代码来源:GetXMLData.java
示例3: getXMLRowPutRowWithErrorhandling
import org.dom4j.tree.AbstractNode; //导入依赖的package包/类
private Object[] getXMLRowPutRowWithErrorhandling() throws KettleException
{
// Build an empty row based on the meta-data
Object[] r=null;
data.errorInRowButContinue=false;
try{
if(meta.isInFields())
{
while ((data.nodenr>=data.nodesize || data.readrow==null))
{
if(!ReadNextString())
{
return null;
}
if(data.readrow==null)
{
return null;
}
}
}
if(meta.isInFields())
r= processPutRow(data.readrow,(AbstractNode)data.an.get(data.nodenr));
else
r= processPutRow(null,(AbstractNode)data.an.get(data.nodenr));
}
catch (Exception e)
{
throw new KettleException(Messages.getString("GetXMLData.Error.UnableReadFile"), e);
}
return r;
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:35,代码来源:GetXMLData.java
示例4: getXMLRowPutRowWithErrorhandling
import org.dom4j.tree.AbstractNode; //导入依赖的package包/类
private Object[] getXMLRowPutRowWithErrorhandling() throws KettleException
{
// Build an empty row based on the meta-data
Object[] r=null;
data.errorInRowButContinue=false;
try{
if(meta.isInFields())
{
while ((data.nodenr>=data.nodesize || data.readrow==null))
{
if(!ReadNextString())
{
return null;
}
if(data.readrow==null)
{
return null;
}
}
}
r= processPutRow((AbstractNode)data.an.get(data.nodenr));
}
catch (Exception e)
{
throw new KettleException(BaseMessages.getString(PKG, "GetXMLData.Error.UnableReadFile"), e);
}
return r;
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:32,代码来源:GetXMLData.java
示例5: flat
import org.dom4j.tree.AbstractNode; //导入依赖的package包/类
/**
* Document to Flat
*/
public void flat() {
XPath loopXpath = null;
if(!defineNS) {
loopXpath = doc.createXPath(namespaceTool.addDefaultNSPrefix(currentLoop, currentLoop));
} else {
loopXpath = doc.createXPath(currentLoop);
}
loopXpath.setNamespaceURIs(xmlNameSpaceMap);
nodes = loopXpath.selectNodes(doc);
if(this.isOptional && nodes.size() == 0 && !top) {
setParentAsLoop();
flat();
} else if (nodes !=null ) {
//reset relative paths
if(currentLoop != originalLoop) {//not point to the same string
for(int i=0;i<currentRelativePathMappings.length;i++) {
currentRelativePathMappings[i] = resetRelativeXPath(currentRelativePathMappings[i]);
}
}
for(AbstractNode node : nodes) {
//init row
Map<String,String> row = new HashMap<String,String>();
resultSet.add(row);
//init columns for one row
for(int i=0;i<currentRelativePathMappings.length;i++) {
String relativePath = currentRelativePathMappings[i];
XPath xpath = null;
if(!defineNS) {
xpath = node.createXPath(namespaceTool.addDefaultNSPrefix(relativePath, currentLoop));
} else {
xpath = node.createXPath(relativePath);
}
xpath.setNamespaceURIs(xmlNameSpaceMap);
Object obj = xpath.evaluate(node);
if(obj instanceof String || obj instanceof Number){
row.put(absolutePathMappings[i], String.valueOf(obj));
}else{
row.put(absolutePathMappings[i], xpath.selectSingleNode(node)!=null ? xpath.valueOf(node) : null);
}
}
}
doc = null;
nodes = null;
}
}
开发者ID:bio2rdf,项目名称:bio2rdf-rest,代码行数:50,代码来源:DocumentToFlat.java
示例6: getNodes
import org.dom4j.tree.AbstractNode; //导入依赖的package包/类
public List<AbstractNode> getNodes() {
return nodes;
}
开发者ID:bio2rdf,项目名称:bio2rdf-rest,代码行数:4,代码来源:DocumentToFlat.java
注:本文中的org.dom4j.tree.AbstractNode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论