本文整理汇总了Java中org.pentaho.di.core.xml.XMLHandler.getSubNode方法的典型用法代码示例。如果您正苦于以下问题:Java XMLHandler.getSubNode方法的具体用法?Java XMLHandler.getSubNode怎么用?Java XMLHandler.getSubNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.core.xml.XMLHandler
的用法示例。
在下文中一共展示了XMLHandler.getSubNode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readData
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
private void readData(Node stepnode) throws KettleXMLException
{
try
{
int i, nrfields;
String type;
Node fields = XMLHandler.getSubNode(stepnode, "fields"); //$NON-NLS-1$
nrfields= XMLHandler.countNodes(fields, "field"); //$NON-NLS-1$
allocate(nrfields);
for (i=0;i<nrfields;i++)
{
Node fnode = XMLHandler.getSubNodeByNr(fields, "field", i); //$NON-NLS-1$
fieldName[i] = XMLHandler.getTagValue(fnode, "name"); //$NON-NLS-1$
fieldNewName[i] = XMLHandler.getTagValue(fnode, "rename"); //$NON-NLS-1$
type = XMLHandler.getTagValue(fnode, "type"); //$NON-NLS-1$
aggregateType[i] = getType(type);
}
}
catch(Exception e)
{
throw new KettleXMLException(Messages.getString("AggregateRowsMeta.Exception.UnableToLoadStepInfo"), e); //$NON-NLS-1$
}
}
示例2: readData
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
private void readData(Node stepnode) throws KettleXMLException
{
try
{
loglevel = XMLHandler.getTagValue(stepnode, "loglevel");
displayHeader = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "displayHeader"));
Node fields = XMLHandler.getSubNode(stepnode, "fields");
int nrfields = XMLHandler.countNodes(fields, "field");
allocate(nrfields);
for (int i = 0; i < nrfields; i++)
{
Node fnode = XMLHandler.getSubNodeByNr(fields, "field", i);
fieldName[i] = XMLHandler.getTagValue(fnode, "name");
}
}
catch (Exception e)
{
throw new KettleXMLException("Unable to load step info from XML", e);
}
}
示例3: loadXML
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
public void loadXML(Node entrynode, List<DatabaseMeta> databases, List<SlaveServer> slaveServers, Repository rep) throws KettleXMLException {
try {
super.loadXML(entrynode, databases, slaveServers);
argFromPrevious = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "arg_from_previous")); //$NON-NLS-1$ //$NON-NLS-2$
success_condition = XMLHandler.getTagValue(entrynode, "success_condition");
limit_folders = XMLHandler.getTagValue(entrynode, "limit_folders");
Node fields = XMLHandler.getSubNode(entrynode, "fields"); //$NON-NLS-1$
// How many field arguments?
int nrFields = XMLHandler.countNodes(fields, "field"); //$NON-NLS-1$
arguments = new String[nrFields];
// Read them all...
for (int i = 0; i < nrFields; i++) {
Node fnode = XMLHandler.getSubNodeByNr(fields, "field", i); //$NON-NLS-1$
arguments[i] = XMLHandler.getTagValue(fnode, "name"); //$NON-NLS-1$
}
} catch (KettleXMLException xe) {
throw new KettleXMLException(Messages.getString("JobEntryDeleteFolders.UnableToLoadFromXml"), xe); //$NON-NLS-1$
}
}
示例4: readData
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
private void readData(Node stepnode)
throws KettleXMLException
{
try
{
Node fields = XMLHandler.getSubNode(stepnode, "fields"); //$NON-NLS-1$
int count= XMLHandler.countNodes(fields, "field"); //$NON-NLS-1$
allocate(count);
for (int i=0;i<count;i++)
{
Node fnode = XMLHandler.getSubNodeByNr(fields, "field", i); //$NON-NLS-1$
fieldName[i] = XMLHandler.getTagValue(fnode, "name"); //$NON-NLS-1$
fieldValue[i] = XMLHandler.getTagValue(fnode, "value"); //$NON-NLS-1$
}
}
catch(Exception e)
{
throw new KettleXMLException(BaseMessages.getString(PKG, "NullIfMeta.Exception.UnableToReadStepInfoFromXML"), e); //$NON-NLS-1$
}
}
示例5: readData
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
private void readData(Node stepnode) throws KettleXMLException
{
try
{
fieldName = XMLHandler.getTagValue(stepnode, "field_name"); //$NON-NLS-1$
Node fields = XMLHandler.getSubNode(stepnode, "fields"); //$NON-NLS-1$
int nrfields = XMLHandler.countNodes(fields, "field"); //$NON-NLS-1$
allocate(nrfields);
for (int i = 0; i < nrfields; i++)
{
Node fnode = XMLHandler.getSubNodeByNr(fields, "field", i); //$NON-NLS-1$
targetField[i] = XMLHandler.getTagValue(fnode, "name"); //$NON-NLS-1$
}
}
catch (Exception e)
{
throw new KettleXMLException(BaseMessages.getString(PKG, "FlattenerMeta.Exception.UnableToLoadStepInfoFromXML"), e); //$NON-NLS-1$
}
}
示例6: readData
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
private void readData(Node stepnode) throws KettleXMLException
{
try
{
fieldName = XMLHandler.getTagValue(stepnode, "field_name"); //$NON-NLS-1$
Node fields = XMLHandler.getSubNode(stepnode, "fields"); //$NON-NLS-1$
int nrfields = XMLHandler.countNodes(fields, "field"); //$NON-NLS-1$
allocate(nrfields);
for (int i = 0; i < nrfields; i++)
{
Node fnode = XMLHandler.getSubNodeByNr(fields, "field", i); //$NON-NLS-1$
targetField[i] = XMLHandler.getTagValue(fnode, "name"); //$NON-NLS-1$
}
}
catch (Exception e)
{
throw new KettleXMLException(Messages.getString("FlattenerMeta.Exception.UnableToLoadStepInfoFromXML"), e); //$NON-NLS-1$
}
}
示例7: readData
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
private void readData(Node stepnode) throws KettleXMLException {
try {
Node fields = XMLHandler.getSubNode(stepnode, "fields");
int count = XMLHandler.countNodes(fields, "field");
allocate(count);
for (int i = 0; i < count; i++) {
Node fnode = XMLHandler.getSubNodeByNr(fields, "field", i);
algorithm[i] = XMLHandler.getTagValue(fnode, "algorithm");
scheme[i] = XMLHandler.getTagValue(fnode, "scheme");
secretKeyLength[i] = XMLHandler.getTagValue(fnode, "secretKeyLen");
secretKeyCount[i] = XMLHandler.getTagValue(fnode, "secretKeyCount");
}
secretKeyFieldName=XMLHandler.getTagValue(stepnode, "secretKeyFieldName");
secretKeyLengthFieldName=XMLHandler.getTagValue(stepnode, "secretKeyLengthFieldName");
algorithmFieldName=XMLHandler.getTagValue(stepnode, "algorithmFieldName");
outputKeyInBinary="Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "outputKeyInBinary"));
} catch (Exception e) {
throw new KettleXMLException("Unable to read step information from XML", e);
}
}
示例8: readData
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
private void readData(Node stepnode)
{
Node fields = XMLHandler.getSubNode(stepnode, "fields"); //$NON-NLS-1$
int nrfields = XMLHandler.countNodes(fields, "field"); //$NON-NLS-1$
allocate(nrfields);
for (int i=0;i<nrfields;i++)
{
Node line = XMLHandler.getSubNodeByNr(fields, "field", i); //$NON-NLS-1$
name [i] = XMLHandler.getTagValue(line, "name"); //$NON-NLS-1$
type [i] = ValueMeta.getType(XMLHandler.getTagValue(line, "type")); //$NON-NLS-1$
length [i] = Const.toInt(XMLHandler.getTagValue(line, "length"), -2); //$NON-NLS-1$
precision[i] = Const.toInt(XMLHandler.getTagValue(line, "precision"), -2); //$NON-NLS-1$
}
}
示例9: readData
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
private void readData(Node stepnode)
{
Node fields = XMLHandler.getSubNode(stepnode, "fields"); //$NON-NLS-1$
int nrfields = XMLHandler.countNodes(fields, "field"); //$NON-NLS-1$
allocate(nrfields);
for (int i=0;i<nrfields;i++)
{
Node line = XMLHandler.getSubNodeByNr(fields, "field", i); //$NON-NLS-1$
fieldname [i] = XMLHandler.getTagValue(line, "name"); //$NON-NLS-1$
type [i] = ValueMeta.getType(XMLHandler.getTagValue(line, "type")); //$NON-NLS-1$
length [i] = Const.toInt(XMLHandler.getTagValue(line, "length"), -2); //$NON-NLS-1$
precision[i] = Const.toInt(XMLHandler.getTagValue(line, "precision"), -2); //$NON-NLS-1$
}
}
示例10: loadXML
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
@Override
public void loadXML(Node node, List<DatabaseMeta> databases, IMetaStore metaStore) throws KettleXMLException {
super.loadXML( node, databases, metaStore );
try {
Node arguments = XMLHandler.getSubNode(node, XML_TAG);
command = XMLHandler.getTagValue(arguments, XML_KEY_COMMAND);
logBasic("load config: command=" + command);
url = XMLHandler.getTagValue(arguments, XML_KEY_URL);
logBasic("load config: url=" + url);
} catch ( Exception e ) {
throw new KettleXMLException("Redis plugin unable to read step info from XML node", e);
}
}
示例11: loadXML
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
@Override public void loadXML( Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore )
throws KettleXMLException {
try {
broker = XMLHandler.getTagValue( stepnode, "BROKER" );
topic = XMLHandler.getTagValue( stepnode, "TOPIC" );
String topicFromField = XMLHandler.getTagValue( stepnode, "TOPIC_IS_FROM_FIELD" );
if ( !Const.isEmpty( topicFromField ) ) {
m_topicIsFromField = topicFromField.equalsIgnoreCase( "Y" );
}
field = XMLHandler.getTagValue( stepnode, "FIELD" );
clientId = XMLHandler.getTagValue( stepnode, "CLIENT_ID" );
timeout = XMLHandler.getTagValue( stepnode, "TIMEOUT" );
qos = XMLHandler.getTagValue( stepnode, "QOS" );
requiresAuth = Boolean.parseBoolean( XMLHandler.getTagValue( stepnode, "REQUIRES_AUTH" ) );
username = XMLHandler.getTagValue( stepnode, "USERNAME" );
password = XMLHandler.getTagValue( stepnode, "PASSWORD" );
if ( !Const.isEmpty( password ) ) {
password = Encr.decryptPasswordOptionallyEncrypted( password );
}
Node sslNode = XMLHandler.getSubNode( stepnode, "SSL" );
if ( sslNode != null ) {
sslCaFile = XMLHandler.getTagValue( sslNode, "CA_FILE" );
sslCertFile = XMLHandler.getTagValue( sslNode, "CERT_FILE" );
sslKeyFile = XMLHandler.getTagValue( sslNode, "KEY_FILE" );
sslKeyFilePass = XMLHandler.getTagValue( sslNode, "KEY_FILE_PASS" );
}
} catch ( Exception e ) {
throw new KettleXMLException( BaseMessages.getString( PKG, "MQTTClientMeta.Exception.loadXml" ), e );
}
}
示例12: loadXML
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
@Override
public void loadXML(Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore) throws KettleXMLException {
Node inputRowMetaNode = XMLHandler.getSubNode(stepnode, INPUT_ROW_META);
if (inputRowMetaNode != null) {
try {
inputRowMeta = new RowMeta(inputRowMetaNode);
} catch (KettleException e) {
throw new KettleXMLException(e);
}
}
}
示例13: loadXML
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
@Override
public void loadXML(Node stepnode, List<DatabaseMeta> databases,
IMetaStore metaStore) throws KettleXMLException {
Node fields = XMLHandler.getSubNode(stepnode, "fields");
int nrfields = XMLHandler.countNodes(fields, "field");
allocate(nrfields);
for (int i = 0; i < nrfields; i++) {
Node fnode = XMLHandler.getSubNodeByNr(fields, "field", i);
outputFields[i] = new TextFileField();
outputFields[i].setName(XMLHandler.getTagValue(fnode, "name"));
outputFields[i].setType(XMLHandler.getTagValue(fnode, "type"));
outputFields[i].setFormat(XMLHandler.getTagValue(fnode, "format"));
outputFields[i].setCurrencySymbol(XMLHandler.getTagValue(fnode,
"currency"));
outputFields[i].setDecimalSymbol(XMLHandler.getTagValue(fnode,
"decimal"));
outputFields[i].setGroupingSymbol(XMLHandler.getTagValue(fnode,
"group"));
outputFields[i].setTrimType(ValueMeta.getTrimTypeByCode(XMLHandler
.getTagValue(fnode, "trim_type")));
outputFields[i].setNullString(XMLHandler.getTagValue(fnode,
"nullif"));
outputFields[i].setLength(Const.toInt(
XMLHandler.getTagValue(fnode, "length"), -1));
outputFields[i].setPrecision(Const.toInt(
XMLHandler.getTagValue(fnode, "precision"), -1));
}
targetFieldName = XMLHandler.getTagValue(stepnode,
ConcatFieldsNodeNameSpace, "targetFieldName");
targetFieldLength = Const.toInt(XMLHandler.getTagValue(stepnode,
ConcatFieldsNodeNameSpace, "targetFieldLength"), 0);
}
示例14: readData
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
private void readData(Node stepnode) throws KettleXMLException
{
try
{
fieldname = XMLHandler.getTagValue(stepnode, "fieldname"); //$NON-NLS-1$
isContains = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "use_contains")); //$NON-NLS-1$
caseValueType = ValueMeta.getType(XMLHandler.getTagValue(stepnode, "case_value_type")); //$NON-NLS-1$
caseValueFormat = XMLHandler.getTagValue(stepnode, "case_value_format"); //$NON-NLS-1$
caseValueDecimal = XMLHandler.getTagValue(stepnode, "case_value_decimal"); //$NON-NLS-1$
caseValueGroup = XMLHandler.getTagValue(stepnode, "case_value_group"); //$NON-NLS-1$
defaultTargetStepname = XMLHandler.getTagValue(stepnode, "default_target_step"); // $NON-NLS-1$
Node casesNode = XMLHandler.getSubNode(stepnode, XML_TAG_CASE_VALUES);
int nrCases = XMLHandler.countNodes(casesNode, XML_TAG_CASE_VALUE);
allocate(nrCases);
for (int i=0;i<nrCases;i++) {
Node caseNode = XMLHandler.getSubNodeByNr(casesNode, XML_TAG_CASE_VALUE, i);
caseValues[i] = XMLHandler.getTagValue(caseNode, "value");
caseTargetStepnames[i] = XMLHandler.getTagValue(caseNode, "target_step");
}
}
catch(Exception e)
{
throw new KettleXMLException(Messages.getString("SwitchCaseMeta.Exception..UnableToLoadStepInfoFromXML"), e); //$NON-NLS-1$
}
}
示例15: readData
import org.pentaho.di.core.xml.XMLHandler; //导入方法依赖的package包/类
private void readData(Node stepnode, List<DatabaseMeta> databases)
throws KettleXMLException
{
try
{
String con = XMLHandler.getTagValue(stepnode, "connection"); //$NON-NLS-1$
databaseMeta = DatabaseMeta.findDatabase(databases, con);
sql = XMLHandler.getTagValue(stepnode, "sql"); //$NON-NLS-1$
outerJoin = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "outer_join")); //$NON-NLS-1$ //$NON-NLS-2$
replacevars = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "replace_vars"));
rowLimit = Const.toInt(XMLHandler.getTagValue(stepnode, "rowlimit"), 0); //$NON-NLS-1$
Node param = XMLHandler.getSubNode(stepnode, "parameter"); //$NON-NLS-1$
int nrparam = XMLHandler.countNodes(param, "field"); //$NON-NLS-1$
allocate(nrparam);
for (int i=0;i<nrparam;i++)
{
Node pnode = XMLHandler.getSubNodeByNr(param, "field", i); //$NON-NLS-1$
parameterField [i] = XMLHandler.getTagValue(pnode, "name"); //$NON-NLS-1$
String ptype = XMLHandler.getTagValue(pnode, "type"); //$NON-NLS-1$
parameterType [i] = ValueMeta.getType(ptype);
}
}
catch(Exception e)
{
throw new KettleXMLException(Messages.getString("DatabaseJoinMeta.Exception.UnableToLoadStepInfo"), e); //$NON-NLS-1$
}
}