本文整理汇总了Java中org.pentaho.di.core.row.ValueMetaInterface.TYPE_STRING属性的典型用法代码示例。如果您正苦于以下问题:Java ValueMetaInterface.TYPE_STRING属性的具体用法?Java ValueMetaInterface.TYPE_STRING怎么用?Java ValueMetaInterface.TYPE_STRING使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.pentaho.di.core.row.ValueMetaInterface
的用法示例。
在下文中一共展示了ValueMetaInterface.TYPE_STRING属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFields
/**
* This method is called to determine the changes the step is making to the row-stream.
* To that end a RowMetaInterface object is passed in, containing the row-stream structure as it is when entering
* the step. This method must apply any changes the step makes to the row stream. Usually a step adds fields to the
* row-stream.
*
* @param inputRowMeta the row structure coming in to the step
* @param name the name of the step making the changes
* @param info row structures of any info steps coming in
* @param nextStep the description of a step this step is passing rows to
* @param space the variable space for resolving variables
* @param repository the repository instance optionally read from
* @param metaStore the metaStore to optionally read from
*/
@Override
public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore) throws KettleStepException{
for ( int i = 0; i < fields.length; i++ ) {
int type = fields[i].getType();
if ( type == ValueMetaInterface.TYPE_NONE) type = ValueMetaInterface.TYPE_STRING;
try {
ValueMetaInterface v = ValueMetaFactory.createValueMeta( fields[i].getName(), type );
v.setConversionMask( fields[i].getFormat() );
v.setLength( fields[i].getLength() );
v.setPrecision( fields[i].getPrecision() );
v.setCurrencySymbol( fields[i].getCurrencySymbol() );
v.setDecimalSymbol( fields[i].getDecimalSymbol() );
v.setGroupingSymbol( fields[i].getGroupSymbol() );
v.setTrimType( fields[i].getTrimType() );
v.setOrigin( name );
inputRowMeta.addValueMeta( v );
} catch (KettlePluginException e) {
throw new KettleStepException( e );
}
}
}
示例2: getFields
@Override
public void getFields(RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info,
StepMeta nextStep, VariableSpace space) throws KettleStepException {
for (int i = 0; i < odpsFields.size(); i++) {
ValueMetaInterface v = new ValueMeta(odpsFields.get(i).getName().toLowerCase(),
ValueMetaInterface.TYPE_STRING);
v.setOrigin(name);
inputRowMeta.addValueMeta(v);
}
}
示例3: convertDataType
public static int convertDataType(DataType type) {
switch (type.getName()) {
case SMALLINT:
case INT:
case BIGINT:
case COUNTER:
case TIME:
return ValueMetaInterface.TYPE_INTEGER; // 5 > java.lang.Long
case ASCII:
case TEXT:
case VARCHAR:
case UUID:
case TIMEUUID:
return ValueMetaInterface.TYPE_STRING; // 2 > java.lang.String
case INET:
return ValueMetaInterface.TYPE_INET; // 10 >
case BOOLEAN:
return ValueMetaInterface.TYPE_BOOLEAN; // 4 > java.lang.Boolean
case DECIMAL:
case FLOAT:
case DOUBLE:
return ValueMetaInterface.TYPE_NUMBER; // 1 > java.lang.Double
case VARINT:
return ValueMetaInterface.TYPE_BIGNUMBER; // 6 > java.math.BigDecimal
case TIMESTAMP:
return ValueMetaInterface.TYPE_DATE; // 3 > java.util.Date
case BLOB:
return ValueMetaInterface.TYPE_BINARY; // 8 > java.lang.byte[]
case LIST:
case MAP:
case SET:
return ValueMetaInterface.TYPE_SERIALIZABLE; // 0
default:
return ValueMetaInterface.TYPE_STRING;
}
}
示例4: SdmxInputField
public SdmxInputField(String fieldName, int length) {
this.name = fieldName;
this.length = length;
this.type = ValueMetaInterface.TYPE_STRING;
this.format = "";
this.precision = -1;
this.currencySymbol = "";
this.decimalSymbol = "";
this.groupSymbol = "";
this.trimType = ValueMetaInterface.TRIM_TYPE_NONE;
this.repeat = false;
}
示例5: setMinimalWidth
private void setMinimalWidth() {
int nrNonEmptyFields = wFields.nrNonEmpty();
for (int i = 0; i < nrNonEmptyFields; i++) {
TableItem item = wFields.getNonEmpty(i);
item.setText(4, "");
item.setText(5, "");
item.setText(9, ValueMeta.getTrimTypeDesc(ValueMetaInterface.TRIM_TYPE_BOTH));
int type = ValueMeta.getType(item.getText(2));
switch (type) {
case ValueMetaInterface.TYPE_STRING:
item.setText(3, "");
break;
case ValueMetaInterface.TYPE_INTEGER:
item.setText(3, "0");
break;
case ValueMetaInterface.TYPE_NUMBER:
item.setText(3, "0.#####");
break;
case ValueMetaInterface.TYPE_DATE:
break;
default:
break;
}
}
for (int i = 0; i < input.getOutputFields().length; i++) {
input.getOutputFields()[i].setTrimType(ValueMetaInterface.TRIM_TYPE_BOTH);
}
wFields.optWidth(true);
}
示例6: setMinimalWidth
/**
* Sets the output width to minimal width...
*
*/
public void setMinimalWidth() {
int nrNonEmptyFields = wFields.nrNonEmpty();
for ( int i = 0; i < nrNonEmptyFields; i++ ) {
TableItem item = wFields.getNonEmpty( i );
item.setText( 4, "" );
item.setText( 5, "" );
item.setText( 9, ValueMeta.getTrimTypeDesc( ValueMetaInterface.TRIM_TYPE_BOTH ) );
int type = ValueMeta.getType( item.getText( 2 ) );
switch ( type ) {
case ValueMetaInterface.TYPE_STRING:
item.setText( 3, "" );
break;
case ValueMetaInterface.TYPE_INTEGER:
item.setText( 3, "0" );
break;
case ValueMetaInterface.TYPE_NUMBER:
item.setText( 3, "0.#####" );
break;
case ValueMetaInterface.TYPE_DATE:
break;
default:
break;
}
}
for ( int i = 0; i < input.getOutputFields().length; i++ ) {
input.getOutputFields()[i].setTrimType( ValueMetaInterface.TRIM_TYPE_BOTH );
}
wFields.optWidth( true );
}
示例7: setMinimalWidth
/**
* Sets the output width to minimal width...
*
*/
public void setMinimalWidth() {
int nrNonEmptyFields = wFields.nrNonEmpty();
for ( int i = 0; i < nrNonEmptyFields; i++ ) {
TableItem item = wFields.getNonEmpty( i );
item.setText( 5, "" );
item.setText( 6, "" );
int type = ValueMeta.getType( item.getText( 2 ) );
switch ( type ) {
case ValueMetaInterface.TYPE_STRING:
item.setText( 4, "" );
break;
case ValueMetaInterface.TYPE_INTEGER:
item.setText( 4, "0" );
break;
case ValueMetaInterface.TYPE_NUMBER:
item.setText( 4, "0.#####" );
break;
case ValueMetaInterface.TYPE_DATE:
break;
default:
break;
}
}
wFields.optWidth( true );
}
示例8: FastJsonInputField
public FastJsonInputField(String fieldname) {
this.name = fieldname;
this.path = "";
this.length = -1;
this.type = ValueMetaInterface.TYPE_STRING;
this.format = "";
this.trimtype = TYPE_TRIM_NONE;
this.groupSymbol = "";
this.decimalSymbol = "";
this.currencySymbol = "";
this.precision = -1;
this.repeat = false;
}
示例9: LDAPInputField
public LDAPInputField(String fieldname)
{
this.name = fieldname;
this.attribute = "";
this.length = -1;
this.type = ValueMetaInterface.TYPE_STRING;
this.format = "";
this.trimtype = TYPE_TRIM_NONE;
this.groupSymbol = "";
this.decimalSymbol = "";
this.currencySymbol = "";
this.precision = -1;
this.repeat = false;
}
示例10: ColumnInfo
/**
* Creates a column info class for use with the TableView class.
*
* @param colname The column name
* @param coltype The column type (see: COLUMN_TYPE_...)
*/
public ColumnInfo(String colname, int coltype)
{
name=colname;
type=coltype;
combovals=null;
numeric=false;
tooltip=null;
allignement=SWT.LEFT;
readonly=false;
hide_negative=false;
valueMeta=new ValueMeta(colname, ValueMetaInterface.TYPE_STRING);
}
示例11: readRep
public void readRep(Repository rep, long id_step, List<DatabaseMeta> databases, Map<String, Counter> counters)
throws KettleException
{
try
{
int nrfields = rep.countNrStepAttributes(id_step, "field_name");
allocate(nrfields);
for (int i=0;i<nrfields;i++)
{
fieldName[i] = rep.getStepAttributeString(id_step, i, "field_name");
variableString[i] = rep.getStepAttributeString(id_step, i, "field_variable");
fieldType[i] = ValueMeta.getType(rep.getStepAttributeString (id_step, i, "field_type"));
fieldFormat[i] = rep.getStepAttributeString (id_step, i, "field_format");
currency[i] = rep.getStepAttributeString (id_step, i, "field_currency");
decimal[i] = rep.getStepAttributeString (id_step, i, "field_decimal");
group[i] = rep.getStepAttributeString (id_step, i, "field_group");
fieldLength[i] = (int)rep.getStepAttributeInteger(id_step, i, "field_length");
fieldPrecision[i] = (int)rep.getStepAttributeInteger(id_step, i, "field_precision");
trimType[i] = ValueMeta.getTrimTypeByCode(rep.getStepAttributeString(id_step, i, "field_trim_type"));
// Backward compatibility
//
if (fieldType[i]==ValueMetaInterface.TYPE_NONE) {
fieldType[i] = ValueMetaInterface.TYPE_STRING;
}
}
}
catch(Exception e)
{
throw new KettleException("Unexpected error reading step information from the repository", e);
}
}
示例12: setValueMeta
private void setValueMeta(ValueMetaInterface v, int i, String name){
int type = fieldType[i];
if (type == ValueMetaInterface.TYPE_NONE) type = ValueMetaInterface.TYPE_STRING;
v.setType(type);
v.setLength(fieldLength[i]);
v.setPrecision(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]);
}
示例13: YamlInputField
public YamlInputField(String fieldname)
{
this.name = fieldname;
this.path = "";
this.length = -1;
this.type = ValueMetaInterface.TYPE_STRING;
this.format = "";
this.trimtype = TYPE_TRIM_NONE;
this.groupSymbol = "";
this.decimalSymbol = "";
this.currencySymbol = "";
this.precision = -1;
}
示例14: loadXML
public void loadXML( Node stepNode, List<DatabaseMeta> databases, IMetaStore metaStore ) 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 fieldNode = XMLHandler.getSubNodeByNr( fields, "field", i );
fieldName[ i ] = XMLHandler.getTagValue( fieldNode, "name" );
variableName[ i ] = XMLHandler.getTagValue( fieldNode, "variable" );
fieldType[ i ] = ValueMeta.getType( XMLHandler.getTagValue( fieldNode, "type" ) );
fieldFormat[ i ] = XMLHandler.getTagValue( fieldNode, "format" );
currency[ i ] = XMLHandler.getTagValue( fieldNode, "currency" );
decimal[ i ] = XMLHandler.getTagValue( fieldNode, "decimal" );
group[ i ] = XMLHandler.getTagValue( fieldNode, "group" );
fieldLength[ i ] = Const.toInt( XMLHandler.getTagValue( fieldNode, "length" ), -1 );
fieldPrecision[ i ] = Const.toInt( XMLHandler.getTagValue( fieldNode, "precision" ), -1 );
trimType[ i ] = ValueMeta.getTrimTypeByCode( XMLHandler.getTagValue( fieldNode, "trim_type" ) );
defaultValue[ i ] = XMLHandler.getTagValue( fieldNode, "default_value" );
// backward compatibility
if ( fieldType[ i ] == ValueMetaInterface.TYPE_NONE ) {
fieldType[ i ] = ValueMetaInterface.TYPE_STRING;
}
}
} catch ( Exception e ) {
throw new KettleXMLException(
BaseMessages.getString( PKG, "GetSessionVariable.RuntimeError.UnableToReadXML" ), e );
}
}
示例15: addValueMeta
/**
* Adds <code>String</code> value meta with given name if not present and returns index
* @param rowMeta
* @param fieldName
* @return Index in row meta of value meta with <code>fieldName</code>
*/
private int addValueMeta(RowMetaInterface rowMeta, String fieldName) {
ValueMetaInterface valueMeta = new ValueMeta(fieldName, ValueMetaInterface.TYPE_STRING);
valueMeta.setOrigin(getStepname());
//add if doesn't exist
int index = -1;
if(!rowMeta.exists(valueMeta)){
index = rowMeta.size();
rowMeta.addValueMeta(valueMeta);
}
else{
index = rowMeta.indexOfValue(fieldName);
}
return index;
}