use of org.pentaho.metaverse.api.model.kettle.HopInfo in project pentaho-metaverse by pentaho.
the class TransMetaJsonDeserializer method deserializeHops.
protected void deserializeHops(TransMeta transMeta, JsonNode root, ObjectMapper mapper) {
ArrayNode hopsArray = (ArrayNode) root.get(TransMetaJsonSerializer.JSON_PROPERTY_HOPS);
for (int i = 0; i < hopsArray.size(); i++) {
JsonNode hopNode = hopsArray.get(i);
try {
HopInfo hop = mapper.readValue(hopNode.toString(), HopInfo.class);
if (hop != null) {
TransHopMeta hopMeta = new TransHopMeta();
hopMeta.setFromStep(transMeta.findStep(hop.getFromStepName()));
hopMeta.setToStep(transMeta.findStep(hop.getToStepName()));
hopMeta.setEnabled(hop.isEnabled());
transMeta.addTransHop(hopMeta);
}
} catch (IOException e) {
LOGGER.warn(Messages.getString("WARNING.Deserialization.Trans.Hops"), e);
}
}
}
use of org.pentaho.metaverse.api.model.kettle.HopInfo in project pentaho-metaverse by pentaho.
the class JobMetaJsonSerializer method serializeHops.
@Override
protected void serializeHops(JobMeta meta, JsonGenerator json) throws IOException {
// Hops
json.writeArrayFieldStart(JSON_PROPERTY_HOPS);
int numberOfHops = meta.nrJobHops();
for (int i = 0; i < numberOfHops; i++) {
JobHopMeta hopMeta = meta.getJobHop(i);
HopInfo hopInfo = new HopInfo(hopMeta);
json.writeObject(hopInfo);
}
json.writeEndArray();
}
use of org.pentaho.metaverse.api.model.kettle.HopInfo in project pentaho-metaverse by pentaho.
the class TransMetaJsonSerializer method serializeHops.
@Override
protected void serializeHops(TransMeta meta, JsonGenerator json) throws IOException {
// Hops
json.writeArrayFieldStart(JSON_PROPERTY_HOPS);
int numberOfHops = meta.nrTransHops();
for (int i = 0; i < numberOfHops; i++) {
TransHopMeta hopMeta = meta.getTransHop(i);
HopInfo hopInfo = new HopInfo(hopMeta);
json.writeObject(hopInfo);
}
json.writeEndArray();
}
Aggregations