本文整理匯總了Java中org.pentaho.di.core.row.RowMetaInterface.setValueMeta方法的典型用法代碼示例。如果您正苦於以下問題:Java RowMetaInterface.setValueMeta方法的具體用法?Java RowMetaInterface.setValueMeta怎麽用?Java RowMetaInterface.setValueMeta使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.pentaho.di.core.row.RowMetaInterface
的用法示例。
在下文中一共展示了RowMetaInterface.setValueMeta方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getFields
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields( RowMetaInterface inputRowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,
VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
if ( !Const.isEmpty( this.valueFieldName ) ) {
// Add value field meta if not found, else set it
ValueMetaInterface v;
try {
v = ValueMetaFactory.createValueMeta( this.valueFieldName, ValueMeta.getType( this.valueTypeName ) );
} catch ( KettlePluginException e ) {
throw new KettleStepException( BaseMessages.getString( PKG,
"HazelcastInputMeta.Exception.ValueTypeNameNotFound" ), e );
}
v.setOrigin( origin );
int valueFieldIndex = inputRowMeta.indexOfValue( this.valueFieldName );
if ( valueFieldIndex < 0 ) {
inputRowMeta.addValueMeta( v );
} else {
inputRowMeta.setValueMeta( valueFieldIndex, v );
}
} else {
throw new KettleStepException( BaseMessages
.getString( PKG, "HazelcastInputMeta.Exception.ValueFieldNameNotFound" ) );
}
}
示例2: getFields
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields( RowMetaInterface inputRowMeta, String origin, RowMetaInterface[] info, StepMeta nextStep,
VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
if ( !Const.isEmpty( this.valueFieldName ) ) {
// Add value field meta if not found, else set it
ValueMetaInterface v;
try {
v = ValueMetaFactory.createValueMeta( this.valueFieldName, ValueMeta.getType( this.valueTypeName ) );
} catch ( KettlePluginException e ) {
throw new KettleStepException( BaseMessages.getString( PKG,
"MemcachedInputMeta.Exception.ValueTypeNameNotFound" ), e );
}
v.setOrigin( origin );
int valueFieldIndex = inputRowMeta.indexOfValue( this.valueFieldName );
if ( valueFieldIndex < 0 ) {
inputRowMeta.addValueMeta( v );
} else {
inputRowMeta.setValueMeta( valueFieldIndex, v );
}
} else {
throw new KettleStepException( BaseMessages
.getString( PKG, "MemcachedInputMeta.Exception.ValueFieldNameNotFound" ) );
}
}
示例3: getFields
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface info[], StepMeta nextStep,
VariableSpace space) throws KettleStepException
{
for(int i=0;i<fieldOutStream.length;i++) {
ValueMetaInterface valueMeta = new ValueMeta(space.environmentSubstitute(fieldOutStream[i]), ValueMeta.TYPE_STRING);
valueMeta.setLength(100, -1);
valueMeta.setOrigin(name);
if (!Const.isEmpty(fieldOutStream[i])){
inputRowMeta.addValueMeta(valueMeta);
} else {
int index = inputRowMeta.indexOfValue(fieldInStream[i]);
if (index>=0) {
valueMeta.setName(fieldInStream[i]);
inputRowMeta.setValueMeta(index, valueMeta);
}
}
}
}
示例4: getFields
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
@Override
public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException {
String outputField = space.environmentSubstitute(getOutputIDFieldName());
ValueMetaInterface outputInterface = null;
try {
outputInterface = ValueMetaFactory.createValueMeta(outputField, ValueMetaInterface.TYPE_STRING);
} catch (KettlePluginException e) {
throw new KettleStepException(e);
}
boolean fieldFound = false;
for (int i = 0; i < inputRowMeta.size(); i++) {
ValueMetaInterface valueMetaInterface = inputRowMeta.getValueMeta(i);
String interfaceName = valueMetaInterface.getName();
if (outputField.equals(interfaceName)) {
fieldFound = true;
inputRowMeta.setValueMeta(i, outputInterface);
break;
}
}
if (!fieldFound) {
inputRowMeta.addValueMeta(outputInterface);
}
}
示例5: getFields
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields(RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space)
{
// Remove the field to split
int idx = r.indexOfValue(splitField);
if (idx<0) //not found
{
throw new RuntimeException(Messages.getString("FieldSplitter.Log.CouldNotFindFieldToSplit",splitField)); //$NON-NLS-1$ //$NON-NLS-2$
}
// Add the new fields at the place of the index --> replace!
for (int i = 0; i < fieldName.length; i++)
{
final ValueMetaInterface v = new ValueMeta(fieldName[i], fieldType[i]);
v.setLength(fieldLength[i], fieldPrecision[i]);
v.setOrigin(name);
v.setConversionMask(fieldFormat[i]);
v.setDecimalSymbol(fieldDecimal[i]);
v.setGroupingSymbol(fieldGroup[i]);
v.setCurrencySymbol(fieldCurrency[i]);
v.setTrimType(fieldTrimType[i]);
// TODO when implemented in UI
// v.setDateFormatLenient(dateFormatLenient);
// TODO when implemented in UI
// v.setDateFormatLocale(dateFormatLocale);
if(i==0 && idx>=0)
{
//the first valueMeta (splitField) will be replaced
r.setValueMeta(idx, v);
}
else
{
//other valueMeta will be added
if (idx>=r.size()) r.addValueMeta(v);
r.addValueMeta(idx+i, v);
}
}
}
示例6: getFields
import org.pentaho.di.core.row.RowMetaInterface; //導入方法依賴的package包/類
public void getFields(RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space)
{
// Remove the field to split
int idx = r.indexOfValue(splitField);
if (idx<0) //not found
{
throw new RuntimeException(BaseMessages.getString(PKG, "FieldSplitter.Log.CouldNotFindFieldToSplit",splitField)); //$NON-NLS-1$ //$NON-NLS-2$
}
// Add the new fields at the place of the index --> replace!
for (int i = 0; i < fieldName.length; i++)
{
final ValueMetaInterface v = new ValueMeta(fieldName[i], fieldType[i]);
v.setLength(fieldLength[i], fieldPrecision[i]);
v.setOrigin(name);
v.setConversionMask(fieldFormat[i]);
v.setDecimalSymbol(fieldDecimal[i]);
v.setGroupingSymbol(fieldGroup[i]);
v.setCurrencySymbol(fieldCurrency[i]);
v.setTrimType(fieldTrimType[i]);
// TODO when implemented in UI
// v.setDateFormatLenient(dateFormatLenient);
// TODO when implemented in UI
// v.setDateFormatLocale(dateFormatLocale);
if(i==0 && idx>=0)
{
//the first valueMeta (splitField) will be replaced
r.setValueMeta(idx, v);
}
else
{
//other valueMeta will be added
if (idx>=r.size()) r.addValueMeta(v);
r.addValueMeta(idx+i, v);
}
}
}