use of org.pentaho.metaverse.api.analyzer.kettle.step.StepAnalyzer in project pentaho-metaverse by pentaho.
the class AbstractStepMetaJsonSerializer method getFieldLineageMetadataProvider.
protected IFieldLineageMetadataProvider getFieldLineageMetadataProvider(T meta) {
IStepAnalyzerProvider provider = getStepAnalyzerProvider();
if (provider == null) {
// try to get it from PentahoSystem
provider = PentahoSystem.get(IStepAnalyzerProvider.class);
}
if (provider != null) {
Set<Class<?>> types = new HashSet<Class<?>>();
types.add(meta.getClass());
List<IStepAnalyzer> analyzers = provider.getAnalyzers(types);
if (analyzers != null) {
for (IStepAnalyzer analyzer : analyzers) {
// try to set up the analyzer with parent step & trans meta
if (analyzer instanceof StepAnalyzer) {
StepAnalyzer bsa = (StepAnalyzer) analyzer;
try {
bsa.validateState(null, meta);
bsa.loadInputAndOutputStreamFields(meta);
} catch (MetaverseAnalyzerException e) {
// eat it
}
}
if (analyzer instanceof IFieldLineageMetadataProvider) {
return (IFieldLineageMetadataProvider) analyzer;
}
}
}
}
return new GenericStepMetaAnalyzer();
}
Aggregations