use of org.apache.nifi.annotation.behavior.DynamicRelationship in project nifi by apache.
the class HtmlProcessorDocumentationWriter method writeDynamicRelationships.
private void writeDynamicRelationships(final Processor processor, final XMLStreamWriter xmlStreamWriter) throws XMLStreamException {
List<DynamicRelationship> dynamicRelationships = getDynamicRelationships(processor);
if (dynamicRelationships.size() > 0) {
writeSimpleElement(xmlStreamWriter, "h3", "Dynamic Relationships: ");
xmlStreamWriter.writeStartElement("p");
xmlStreamWriter.writeCharacters("A Dynamic Relationship may be created based on how the user configures the Processor.");
xmlStreamWriter.writeStartElement("table");
xmlStreamWriter.writeAttribute("id", "dynamic-relationships");
xmlStreamWriter.writeStartElement("tr");
writeSimpleElement(xmlStreamWriter, "th", "Name");
writeSimpleElement(xmlStreamWriter, "th", "Description");
xmlStreamWriter.writeEndElement();
for (DynamicRelationship dynamicRelationship : dynamicRelationships) {
xmlStreamWriter.writeStartElement("tr");
writeSimpleElement(xmlStreamWriter, "td", dynamicRelationship.name());
writeSimpleElement(xmlStreamWriter, "td", dynamicRelationship.description());
xmlStreamWriter.writeEndElement();
}
xmlStreamWriter.writeEndElement();
xmlStreamWriter.writeEndElement();
}
}
use of org.apache.nifi.annotation.behavior.DynamicRelationship in project nifi by apache.
the class HtmlProcessorDocumentationWriter method getDynamicRelationships.
private List<DynamicRelationship> getDynamicRelationships(Processor processor) {
List<DynamicRelationship> results = new ArrayList<>();
DynamicRelationship dynamicRelationships = processor.getClass().getAnnotation(DynamicRelationship.class);
if (dynamicRelationships != null) {
results.add(dynamicRelationships);
}
return results;
}
Aggregations