Search in sources :

Example 1 with WritesAttributes

use of org.apache.nifi.annotation.behavior.WritesAttributes in project nifi by apache.

the class HtmlProcessorDocumentationWriter method getWritesAttributes.

/**
 * Collects the attributes that a processor is writing to.
 *
 * @param processor the processor to describe
 * @return the list of attributes the processor is writing
 */
private List<WritesAttribute> getWritesAttributes(Processor processor) {
    List<WritesAttribute> attributes = new ArrayList<>();
    WritesAttributes writesAttributes = processor.getClass().getAnnotation(WritesAttributes.class);
    if (writesAttributes != null) {
        attributes.addAll(Arrays.asList(writesAttributes.value()));
    }
    WritesAttribute writeAttribute = processor.getClass().getAnnotation(WritesAttribute.class);
    if (writeAttribute != null) {
        attributes.add(writeAttribute);
    }
    return attributes;
}
Also used : ArrayList(java.util.ArrayList) WritesAttribute(org.apache.nifi.annotation.behavior.WritesAttribute) WritesAttributes(org.apache.nifi.annotation.behavior.WritesAttributes)

Aggregations

ArrayList (java.util.ArrayList)1 WritesAttribute (org.apache.nifi.annotation.behavior.WritesAttribute)1 WritesAttributes (org.apache.nifi.annotation.behavior.WritesAttributes)1