use of org.pentaho.metaverse.api.analyzer.kettle.step.IStepExternalResourceConsumerProvider in project pentaho-metaverse by pentaho.
the class AbstractStepMetaJsonSerializer method writeExternalResources.
protected void writeExternalResources(T meta, JsonGenerator json, SerializerProvider serializerProvider) throws IOException, JsonGenerationException {
Set<Class<?>> metaClassSet = new HashSet<Class<?>>(1);
metaClassSet.add(meta.getClass());
IStepExternalResourceConsumerProvider stepExternalResourceConsumerProvider = getStepExternalResourceConsumerProvider();
List<IStepExternalResourceConsumer> resourceConsumers = null;
if (stepExternalResourceConsumerProvider != null) {
resourceConsumers = stepExternalResourceConsumerProvider.getExternalResourceConsumers(metaClassSet);
}
json.writeArrayFieldStart(JSON_PROPERTY_EXTERNAL_RESOURCES);
if (resourceConsumers != null) {
for (IStepExternalResourceConsumer resourceConsumer : resourceConsumers) {
Collection<IExternalResourceInfo> infos = resourceConsumer.getResourcesFromMeta(meta);
for (IExternalResourceInfo info : infos) {
json.writeObject(info);
}
}
}
json.writeEndArray();
}
Aggregations