use of org.pentaho.di.trans.steps.dummytrans.DummyTrans in project pdi-dataservice-server-plugin by pentaho.
the class AnnotationsQueryServiceTest method createPseudoAnnotate.
private DummyTransMeta createPseudoAnnotate(final ModelAnnotationGroup mag) {
final String magicKey = "KEY_MODEL_ANNOTATIONS";
DummyTransMeta annot1Meta = new DummyTransMeta() {
@Override
public StepInterface getStep(StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta tr, final Trans trans) {
return new DummyTrans(stepMeta, stepDataInterface, cnr, tr, trans) {
@Override
public boolean init(StepMetaInterface smi, StepDataInterface sdi) {
ModelAnnotationGroup existing = (ModelAnnotationGroup) trans.getExtensionDataMap().get(magicKey);
if (existing == null) {
trans.getExtensionDataMap().put(magicKey, mag);
} else {
existing.addAll(mag);
}
return true;
}
};
}
};
return annot1Meta;
}
Aggregations