本文整理汇总了Java中org.pentaho.di.trans.steps.rules.RulesAccumulatorMeta类的典型用法代码示例。如果您正苦于以下问题:Java RulesAccumulatorMeta类的具体用法?Java RulesAccumulatorMeta怎么用?Java RulesAccumulatorMeta使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RulesAccumulatorMeta类属于org.pentaho.di.trans.steps.rules包,在下文中一共展示了RulesAccumulatorMeta类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadMeta
import org.pentaho.di.trans.steps.rules.RulesAccumulatorMeta; //导入依赖的package包/类
/**
* Load data into the MetaMapper from the RulesMeta
* @param meta
*/
public void loadMeta(RulesAccumulatorMeta meta) {
setRuleFile(meta.getRuleFile());
setRuleDefinition(meta.getRuleDefinition());
setKeepInputFields(Boolean.toString(meta.isKeepInputFields()));
for(ValueMetaInterface vm : meta.getRuleResultColumns()) {
Column c = new Column();
c.setName(vm.getName());
c.setType(vm.getTypeDesc());
getColumnList().add(c);
}
}
示例2: init
import org.pentaho.di.trans.steps.rules.RulesAccumulatorMeta; //导入依赖的package包/类
public void init() {
workingStepname = stepname;
metaMapper = new RulesAccumulatorMetaMapper();
metaMapper.loadMeta((RulesAccumulatorMeta)baseStepMeta);
// Set dialog values
((XulTextbox)document.getElementById("step-name")).setValue(getStepName());
((XulTextbox)document.getElementById("rule-file")).setValue(metaMapper.getRuleFile());
((XulTextbox)document.getElementById("rule-definition")).setValue(metaMapper.getRuleDefinition());
((XulTree)document.getElementById("fields-table")).setElements(metaMapper.getColumnList());
// Set the initial dialog state
if(metaMapper.getRuleDefinition() != null && !metaMapper.getRuleDefinition().equals("")) {
setRuleSource("definition");
((XulRadio)document.getElementById("rule-definition-radio-button")).setSelected(true);
} else {
setRuleSource("file");
((XulRadio)document.getElementById("rule-file-radio-button")).setSelected(true);
}
// Bind data objects to UI
bf.setBindingType(Binding.Type.ONE_WAY);
try {
bf.createBinding("step-name", "value", this, "stepName");
bf.createBinding("rule-file", "value", metaMapper, "ruleFile");
bf.createBinding("rule-definition", "value", metaMapper, "ruleDefinition");
bf.createBinding(metaMapper.getColumnList(), "children", "fields-table", "elements").fireSourceChanged();
// TODO: Add converter to clear out opposing text box
bf.createBinding("rule-file-radio-button", "selected", "rule-file", "!disabled").fireSourceChanged();
bf.createBinding("rule-file-radio-button", "selected", "rule-definition", "disabled").fireSourceChanged();
bf.createBinding("rule-definition-radio-button", "selected", "rule-definition", "!disabled").fireSourceChanged();
bf.createBinding("rule-definition-radio-button", "selected", "rule-file", "disabled").fireSourceChanged();
} catch (Exception e) {
e.printStackTrace();
}
}
示例3: onAccept
import org.pentaho.di.trans.steps.rules.RulesAccumulatorMeta; //导入依赖的package包/类
@Override
public void onAccept() {
if(!workingStepname.equals(stepname)) {
stepname = workingStepname;
baseStepMeta.setChanged();
}
metaMapper.saveMeta((RulesAccumulatorMeta)baseStepMeta);
dispose();
}
示例4: loadMeta
import org.pentaho.di.trans.steps.rules.RulesAccumulatorMeta; //导入依赖的package包/类
/**
* Load data into the MetaMapper from the RulesMeta
*
* @param meta
*/
public void loadMeta( RulesAccumulatorMeta meta ) {
setRuleFile( meta.getRuleFile() );
setRuleDefinition( meta.getRuleDefinition() );
setKeepInputFields( Boolean.toString( meta.isKeepInputFields() ) );
for ( ValueMetaInterface vm : meta.getRuleResultColumns() ) {
Column c = new Column();
c.setName( vm.getName() );
c.setType( vm.getTypeDesc() );
getColumnList().add( c );
}
}
示例5: init
import org.pentaho.di.trans.steps.rules.RulesAccumulatorMeta; //导入依赖的package包/类
public void init() {
workingStepname = stepname;
metaMapper = new RulesAccumulatorMetaMapper();
metaMapper.loadMeta( (RulesAccumulatorMeta) baseStepMeta );
// Set dialog values
( (XulTextbox) document.getElementById( "step-name" ) ).setValue( getStepName() );
( (XulTextbox) document.getElementById( "rule-file" ) ).setValue( metaMapper.getRuleFile() );
( (XulTextbox) document.getElementById( "rule-definition" ) ).setValue( metaMapper.getRuleDefinition() );
( (XulTree) document.getElementById( "fields-table" ) ).setElements( metaMapper.getColumnList() );
// Set the initial dialog state
if ( metaMapper.getRuleDefinition() != null && !metaMapper.getRuleDefinition().equals( "" ) ) {
setRuleSource( "definition" );
( (XulRadio) document.getElementById( "rule-definition-radio-button" ) ).setSelected( true );
} else {
setRuleSource( "file" );
( (XulRadio) document.getElementById( "rule-file-radio-button" ) ).setSelected( true );
}
// Bind data objects to UI
bf.setBindingType( Binding.Type.ONE_WAY );
try {
bf.createBinding( "step-name", "value", this, "stepName" );
bf.createBinding( "rule-file", "value", metaMapper, "ruleFile" );
bf.createBinding( "rule-definition", "value", metaMapper, "ruleDefinition" );
bf.createBinding( metaMapper.getColumnList(), "children", "fields-table", "elements" ).fireSourceChanged();
// TODO: Add converter to clear out opposing text box
bf.createBinding( "rule-file-radio-button", "selected", "rule-file", "!disabled" ).fireSourceChanged();
bf.createBinding( "rule-file-radio-button", "selected", "rule-definition", "disabled" ).fireSourceChanged();
bf
.createBinding( "rule-definition-radio-button", "selected", "rule-definition", "!disabled" )
.fireSourceChanged();
bf.createBinding( "rule-definition-radio-button", "selected", "rule-file", "disabled" ).fireSourceChanged();
} catch ( Exception e ) {
e.printStackTrace();
}
}
示例6: onAccept
import org.pentaho.di.trans.steps.rules.RulesAccumulatorMeta; //导入依赖的package包/类
@Override
public void onAccept() {
if ( !workingStepname.equals( stepname ) ) {
stepname = workingStepname;
baseStepMeta.setChanged();
}
metaMapper.saveMeta( (RulesAccumulatorMeta) baseStepMeta );
dispose();
}
示例7: saveMeta
import org.pentaho.di.trans.steps.rules.RulesAccumulatorMeta; //导入依赖的package包/类
/**
* Save data from the MetaMapper into the RulesMeta
* @param meta
*/
public void saveMeta(RulesAccumulatorMeta meta) {
if(ruleSource != null && ruleSource.equalsIgnoreCase("file")) {
if(meta.getRuleFile() != null && !meta.getRuleFile().equals(getRuleFile())
|| (meta.getRuleFile() != getRuleFile())
|| meta.getRuleDefinition() != null) {
meta.setRuleFile(getRuleFile());
meta.setRuleDefinition(null);
meta.setChanged();
}
} else if(ruleSource != null && ruleSource.equalsIgnoreCase("definition")) {
if(meta.getRuleDefinition() != null && !meta.getRuleDefinition().equals(getRuleDefinition())
|| (meta.getRuleDefinition() != getRuleDefinition())
|| meta.getRuleFile() != null) {
meta.setRuleDefinition(getRuleDefinition());
meta.setRuleFile(null);
meta.setChanged();
}
}
ValueMetaInterface vm = null;
Column c = null;
for(int i = 0; i < getColumnList().size(); i++) {
vm = i < meta.getRuleResultColumns().size() ? meta.getRuleResultColumns().get(i) : null;
c = getColumnList().get(i);
if(c != null) {
if(c.getName() != null) {
// The column has a name and is valid for insertion
if(vm == null) {
vm = new ValueMeta();
meta.getRuleResultColumns().add(vm);
meta.setChanged();
}
if(!c.getName().equals(vm.getName())) {
vm.setName(c.getName());
meta.setChanged();
}
if(c.getType() != null && !c.getType().equals(vm.getTypeDesc())
|| (c.getType() != vm.getTypeDesc())) {
vm.setType(ValueMeta.getType(c.getType()));
meta.setChanged();
}
} else {
// The column does not have a name and should be removed or skipped over
if(vm != null) {
// This item exists in the meta; remove it
if(i < meta.getRuleResultColumns().size()) {
meta.getRuleResultColumns().remove(i);
}
}
// Remove the item from column list table
getColumnList().remove(i);
// All items have shifted after the removal; Process this position again
i--;
}
}
}
}
示例8: saveMeta
import org.pentaho.di.trans.steps.rules.RulesAccumulatorMeta; //导入依赖的package包/类
/**
* Save data from the MetaMapper into the RulesMeta
*
* @param meta
*/
@SuppressWarnings( "deprecation" )
public void saveMeta( RulesAccumulatorMeta meta ) {
if ( ruleSource != null && ruleSource.equalsIgnoreCase( "file" ) ) {
if ( meta.getRuleFile() != null
&& !meta.getRuleFile().equals( getRuleFile() ) || ( meta.getRuleFile() != getRuleFile() )
|| meta.getRuleDefinition() != null ) {
meta.setRuleFile( getRuleFile() );
meta.setRuleDefinition( null );
meta.setChanged();
}
} else if ( ruleSource != null && ruleSource.equalsIgnoreCase( "definition" ) ) {
if ( meta.getRuleDefinition() != null
&& !meta.getRuleDefinition().equals( getRuleDefinition() )
|| ( meta.getRuleDefinition() != getRuleDefinition() ) || meta.getRuleFile() != null ) {
meta.setRuleDefinition( getRuleDefinition() );
meta.setRuleFile( null );
meta.setChanged();
}
}
ValueMetaInterface vm = null;
Column c = null;
for ( int i = 0; i < getColumnList().size(); i++ ) {
vm = i < meta.getRuleResultColumns().size() ? meta.getRuleResultColumns().get( i ) : null;
c = getColumnList().get( i );
if ( c != null ) {
if ( c.getName() != null ) {
// The column has a name and is valid for insertion
if ( vm == null ) {
vm = new ValueMeta();
meta.getRuleResultColumns().add( vm );
meta.setChanged();
}
if ( !c.getName().equals( vm.getName() ) ) {
vm.setName( c.getName() );
meta.setChanged();
}
if ( c.getType() != null
&& !c.getType().equals( vm.getTypeDesc() ) || ( c.getType() != vm.getTypeDesc() ) ) {
vm.setType( ValueMeta.getType( c.getType() ) );
meta.setChanged();
}
} else {
// The column does not have a name and should be removed or skipped over
if ( vm != null ) {
// This item exists in the meta; remove it
if ( i < meta.getRuleResultColumns().size() ) {
meta.getRuleResultColumns().remove( i );
}
}
// Remove the item from column list table
getColumnList().remove( i );
// All items have shifted after the removal; Process this position again
i--;
}
}
}
}