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


Java XMLHandler.getSubNodeByNr方法代碼示例

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


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

示例1: loadXML

import org.pentaho.di.core.xml.XMLHandler; //導入方法依賴的package包/類
@Override public void loadXML(Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore)
    throws KettleXMLException {
    super.loadXML(stepnode, databases, metaStore);
    String truncateStr = XMLHandler.getTagValue(stepnode, "truncate");
    if (truncateStr.equals("true")) {
        setTruncate(true);
    } else {
        setTruncate(false);
    }

    int nrStreamFields = XMLHandler.countNodes(stepnode, "stream_fields");
    streamFields = new ArrayList<String>(nrStreamFields);
    for (int i = 0; i < nrStreamFields; i++) {
        Node fieldNode = XMLHandler.getSubNodeByNr(stepnode, "stream_fields", i);
        streamFields.add(XMLHandler.getTagValue(fieldNode, "name"));
    }
}
 
開發者ID:aliyun,項目名稱:aliyun-maxcompute-data-collectors,代碼行數:18,代碼來源:OdpsOutputMeta.java

示例2: loadXML

import org.pentaho.di.core.xml.XMLHandler; //導入方法依賴的package包/類
@Override public void loadXML(Node stepnode, List<DatabaseMeta> databases, IMetaStore metaStore)
    throws KettleXMLException {
    setEndpoint(XMLHandler.getTagValue(stepnode, "endpoint"));
    setTunnelEndpoint(XMLHandler.getTagValue(stepnode, "tunnelEndpoint"));
    setAccessId(XMLHandler.getTagValue(stepnode, "accessId"));
    setAccessKey(XMLHandler.getTagValue(stepnode, "accessKey"));
    setProjectName(XMLHandler.getTagValue(stepnode, "projectName"));
    setTableName(XMLHandler.getTagValue(stepnode, "tableName"));
    setPartition(XMLHandler.getTagValue(stepnode, "partition"));

    int nrFields = XMLHandler.countNodes(stepnode, "fields");
    odpsFields = new ArrayList<OdpsField>(nrFields);
    for (int i = 0; i < nrFields; i++) {
        Node fieldNode = XMLHandler.getSubNodeByNr(stepnode, "fields", i);
        OdpsField field = new OdpsField();
        field.setName(XMLHandler.getTagValue(fieldNode, "name"));
        field.setType(XMLHandler.getTagValue(fieldNode, "type"));
        field.setComment(XMLHandler.getTagValue(fieldNode, "comment"));
        odpsFields.add(field);
    }
}
 
開發者ID:aliyun,項目名稱:aliyun-maxcompute-data-collectors,代碼行數:22,代碼來源:OdpsMeta.java

示例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$
    includeSubfolders = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "include_subfolders")); //$NON-NLS-1$ //$NON-NLS-2$

    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];
    filemasks = 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$
      filemasks[i] = XMLHandler.getTagValue(fnode, "filemask"); //$NON-NLS-1$
    }
  } catch (KettleXMLException xe) {
    throw new KettleXMLException(Messages.getString("JobEntryDeleteFiles.UnableToLoadFromXml"), xe); //$NON-NLS-1$
  }
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:25,代碼來源:JobEntryDeleteFiles.java

示例4: readData

import org.pentaho.di.core.xml.XMLHandler; //導入方法依賴的package包/類
private void readData( Node step ) throws KettleXMLException {
  try {
    setCreatePaths( "Y".equalsIgnoreCase( XMLHandler.getTagValue( step, "createPaths" ) ) );
    Node fieldsNode = XMLHandler.getSubNode( step, "fields" );

    int nrfields = XMLHandler.countNodes( fieldsNode, "field" );

    fields = new ArrayList<ZooKeeperField>( nrfields );

    for ( int i = 0; i < nrfields; i++ ) {
      Node line = XMLHandler.getSubNodeByNr( fieldsNode, "field", i );
      String name = XMLHandler.getTagValue( line, "name" );
      String path = XMLHandler.getTagValue( line, "path" );
      ValueMetaInterface type = ValueMetaFactory.createValueMeta(
        ValueMetaFactory.getIdForValueMeta( XMLHandler.getTagValue( line, "type" ) ) );

      fields.add( new ZooKeeperField( name, path, type ) );
    }

  } catch ( Exception e ) {
    throw new KettleXMLException( BaseMessages.getString(
      PKG, "ZooKeeperOutputMeta.Exception.UnableToReadStepInfoFromXML" ), e );
  }
}
 
開發者ID:mattyb149,項目名稱:pdi-zookeeper,代碼行數:25,代碼來源:ZooKeeperOutputMeta.java

示例5: 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$
       }

}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:18,代碼來源:InjectorMeta.java

示例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(BaseMessages.getString(PKG, "FlattenerMeta.Exception.UnableToLoadStepInfoFromXML"), e); //$NON-NLS-1$
    }
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:23,代碼來源:FlattenerMeta.java

示例7: loadXML

import org.pentaho.di.core.xml.XMLHandler; //導入方法依賴的package包/類
public void loadXML(Node stepnode, List<DatabaseMeta> databases, Map<String, Counter> counters) throws KettleXMLException {
  try {

    includeRowNumber = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "rownum"));
    rowNumberField = XMLHandler.getTagValue(stepnode, "rownum_field");

    Node filenode = XMLHandler.getSubNode(stepnode, "file");
    int nrfiles = XMLHandler.countNodes(filenode, "directory");

    allocate(nrfiles);

    for (int i = 0; i < nrfiles; i++) {
      Node filenamenode = XMLHandler.getSubNodeByNr(filenode, "directory", i);
      Node filemasknode = XMLHandler.getSubNodeByNr(filenode, "name_mask", i);
      Node excludefilemasknode = XMLHandler.getSubNodeByNr(filenode, "exclude_name_mask", i);
      Node includeSubFoldersnode = XMLHandler.getSubNodeByNr(filenode, "include_subfolders", i);
      directory[i] = XMLHandler.getNodeValue(filenamenode);
      nameMask[i] = XMLHandler.getNodeValue(filemasknode);
      excludeNameMask[i] = XMLHandler.getNodeValue(excludefilemasknode);
      includeSubFolders[i] = "Y".equalsIgnoreCase( XMLHandler.getNodeValue(includeSubFoldersnode) );
    }
  } catch (Exception e) {
    throw new KettleXMLException("Unable to load step info from XML", e);
  }
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:26,代碼來源:GetRepositoryNamesMeta.java

示例8: 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);
}
 
開發者ID:griddynamics,項目名稱:xml-dom-kettle-etl-plugin,代碼行數:36,代碼來源:DOMConcatFieldsMeta.java

示例9: 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);
		
		arg_from_previous   = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "arg_from_previous") );
		include_subfolders = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "include_subfolders") );

		nr_errors_less_than          = XMLHandler.getTagValue(entrynode, "nr_errors_less_than");
		success_condition          = XMLHandler.getTagValue(entrynode, "success_condition");
		resultfilenames          = XMLHandler.getTagValue(entrynode, "resultfilenames");
		
		
		Node fields = XMLHandler.getSubNode(entrynode, "fields");
		
		// How many field arguments?
		int nrFields = XMLHandler.countNodes(fields, "field");	
		source_filefolder = new String[nrFields];
		wildcard = new String[nrFields];
		
		// Read them all...
		for (int i = 0; i < nrFields; i++)
		{
			Node fnode = XMLHandler.getSubNodeByNr(fields, "field", i);
			
			source_filefolder[i] = XMLHandler.getTagValue(fnode, "source_filefolder");
			wildcard[i] = XMLHandler.getTagValue(fnode, "wildcard");
		}
	}

	catch(KettleXMLException xe)
	{
		
		throw new KettleXMLException(BaseMessages.getString(PKG, "JobXMLWellFormed.Error.Exception.UnableLoadXML"), xe);
	}
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:38,代碼來源:JobEntryXMLWellFormed.java

示例10: Row

import org.pentaho.di.core.xml.XMLHandler; //導入方法依賴的package包/類
public Row(Node rowNode)
{
    int nrValues = XMLHandler.countNodes(rowNode, Value.XML_TAG);
    for (int i=0;i<nrValues;i++)
    {
        Node valueNode = XMLHandler.getSubNodeByNr(rowNode, Value.XML_TAG, i);
        addValue(new Value(valueNode));
    }
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:10,代碼來源:Row.java

示例11: readData

import org.pentaho.di.core.xml.XMLHandler; //導入方法依賴的package包/類
private void readData(Node stepnode)
	throws KettleXMLException
{
	try
	{
	    storeValues = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "store_values")); //$NON-NLS-1$ //$NON-NLS-2$
		rejectDuplicateRow = "Y".equalsIgnoreCase(XMLHandler.getTagValue(stepnode, "reject_duplicate_row"));
		errorDescription = XMLHandler.getTagValue(stepnode, "error_description"); //$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$
			
			compareFields[i] = XMLHandler.getTagValue(fnode, "name"); //$NON-NLS-1$
		}

	}
	catch(Exception e)
	{
		throw new KettleXMLException(BaseMessages.getString(PKG, "UniqueRowsByHashSetMeta.Exception.UnableToLoadStepInfoFromXML"), e); //$NON-NLS-1$
	}
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:28,代碼來源:UniqueRowsByHashSetMeta.java

示例12: readData

import org.pentaho.di.core.xml.XMLHandler; //導入方法依賴的package包/類
private void readData(Node stepnode)
	throws KettleXMLException
{
	try
	{
           fieldToUse      = XMLHandler.getTagValue(stepnode, "field_to_use"); //$NON-NLS-1$
           targetField     = XMLHandler.getTagValue(stepnode, "target_field"); //$NON-NLS-1$
           nonMatchDefault = XMLHandler.getTagValue(stepnode, "non_match_default"); //$NON-NLS-1$
           
		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$
			
			sourceValue[i] = XMLHandler.getTagValue(fnode, "source_value"); //$NON-NLS-1$
			targetValue[i] = XMLHandler.getTagValue(fnode, "target_value"); //$NON-NLS-1$
		}
	}
	catch(Exception e)
	{
		throw new KettleXMLException(Messages.getString("ValueMapperMeta.RuntimeError.UnableToReadXML.VALUEMAPPER0004"), e); //$NON-NLS-1$
	}
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:28,代碼來源:ValueMapperMeta.java

示例13: readData

import org.pentaho.di.core.xml.XMLHandler; //導入方法依賴的package包/類
private void readData(Node stepnode, List<? extends SharedObjectInterface> databases)
	throws KettleXMLException
{
	try
	{
		String con     = XMLHandler.getTagValue(stepnode, "connection");   //$NON-NLS-1$
		databaseMeta   = DatabaseMeta.findDatabase(databases, con);

		String serror   = XMLHandler.getTagValue(stepnode, "errors");       //$NON-NLS-1$
		maxErrors      = Const.toInt(serror, 0);      // default to 0.
           
		bufferSize = XMLHandler.getTagValue(stepnode, "buffer_size");       //$NON-NLS-1$

           schemaName     = XMLHandler.getTagValue(stepnode, "schema");       //$NON-NLS-1$
		tableName      = XMLHandler.getTagValue(stepnode, "table");        //$NON-NLS-1$

		fifoDirectory  = XMLHandler.getTagValue(stepnode, "fifo_directory");        //$NON-NLS-1$
		fifoServerName = XMLHandler.getTagValue(stepnode, "fifo_server_name");        //$NON-NLS-1$

		encoding       = XMLHandler.getTagValue(stepnode, "encoding");         //$NON-NLS-1$

		int nrvalues = XMLHandler.countNodes(stepnode, "mapping");      //$NON-NLS-1$
		allocate(nrvalues);

		for (int i=0;i<nrvalues;i++)
		{
			Node vnode = XMLHandler.getSubNodeByNr(stepnode, "mapping", i);    //$NON-NLS-1$

			fieldTable[i]      = XMLHandler.getTagValue(vnode, "stream_name"); //$NON-NLS-1$
			fieldStream[i]     = XMLHandler.getTagValue(vnode, "field_name");  //$NON-NLS-1$
			if (fieldStream[i]==null) fieldStream[i]=fieldTable[i];            // default: the same name!
			fieldFormatOk[i]  = "Y".equalsIgnoreCase(XMLHandler.getTagValue(vnode, "field_format_ok"));  //$NON-NLS-1$
		}
	}
	catch(Exception e)
	{
		throw new KettleXMLException(BaseMessages.getString(PKG, "LucidDBBulkLoaderMeta.Exception.UnableToReadStepInfoFromXML"), e); //$NON-NLS-1$
	}
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:40,代碼來源:LucidDBBulkLoaderMeta.java

示例14: 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);
		copy_empty_folders      = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "copy_empty_folders")); //$NON-NLS-1$ //$NON-NLS-2$
		arg_from_previous   = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "arg_from_previous") ); //$NON-NLS-1$ //$NON-NLS-2$
		overwrite_files      = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "overwrite_files") ); //$NON-NLS-1$ //$NON-NLS-2$
		include_subfolders = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "include_subfolders") ); //$NON-NLS-1$ //$NON-NLS-2$
		remove_source_files = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "remove_source_files") ); //$NON-NLS-1$ //$NON-NLS-2$
		add_result_filesname = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "add_result_filesname") ); //$NON-NLS-1$ //$NON-NLS-2$
		destination_is_a_file = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "destination_is_a_file") ); //$NON-NLS-1$ //$NON-NLS-2$
		create_destination_folder = "Y".equalsIgnoreCase(XMLHandler.getTagValue(entrynode, "create_destination_folder") ); //$NON-NLS-1$ //$NON-NLS-2$
				
		Node fields = XMLHandler.getSubNode(entrynode, "fields"); //$NON-NLS-1$
		
		// How many field arguments?
		int nrFields = XMLHandler.countNodes(fields, "field");	//$NON-NLS-1$ 
		source_filefolder = new String[nrFields];
		destination_filefolder = new String[nrFields];
		wildcard = new String[nrFields];
		
		// Read them all...
		for (int i = 0; i < nrFields; i++)
		{
			Node fnode = XMLHandler.getSubNodeByNr(fields, "field", i);//$NON-NLS-1$ 
			
			source_filefolder[i] = XMLHandler.getTagValue(fnode, "source_filefolder");//$NON-NLS-1$ 
			destination_filefolder[i] = XMLHandler.getTagValue(fnode, "destination_filefolder");//$NON-NLS-1$ 
			wildcard[i] = XMLHandler.getTagValue(fnode, "wildcard");//$NON-NLS-1$ 
		}
	}

	catch(KettleXMLException xe)
	{
		
		throw new KettleXMLException(BaseMessages.getString(PKG, "JobCopyFiles.Error.Exception.UnableLoadXML"), xe);
	}
}
 
開發者ID:yintaoxue,項目名稱:read-open-source-code,代碼行數:40,代碼來源:JobEntryCopyFiles.java

示例15: loadXML

import org.pentaho.di.core.xml.XMLHandler; //導入方法依賴的package包/類
public void loadXML(Node stepnode, List<DatabaseMeta> databases,  Map<String, Counter> counters) throws KettleXMLException
{
       int nrCalcs   = XMLHandler.countNodes(stepnode,   JaninoMetaFunction.XML_TAG);
       allocate(nrCalcs);
       for (int i=0;i<nrCalcs;i++)
       {
           Node calcnode = XMLHandler.getSubNodeByNr(stepnode, JaninoMetaFunction.XML_TAG, i);
           formula[i] = new JaninoMetaFunction(calcnode);
       }
}
 
開發者ID:icholy,項目名稱:geokettle-2.0,代碼行數:11,代碼來源:JaninoMeta.java


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