Search in sources :

Example 1 with ReadsAttributes

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

the class HtmlProcessorDocumentationWriter method getReadsAttributes.

/**
 * Collects the attributes that a processor is reading from.
 *
 * @param processor the processor to describe
 * @return the list of attributes that processor is reading
 */
private List<ReadsAttribute> getReadsAttributes(Processor processor) {
    List<ReadsAttribute> attributes = new ArrayList<>();
    ReadsAttributes readsAttributes = processor.getClass().getAnnotation(ReadsAttributes.class);
    if (readsAttributes != null) {
        attributes.addAll(Arrays.asList(readsAttributes.value()));
    }
    ReadsAttribute readsAttribute = processor.getClass().getAnnotation(ReadsAttribute.class);
    if (readsAttribute != null) {
        attributes.add(readsAttribute);
    }
    return attributes;
}
Also used : ReadsAttribute(org.apache.nifi.annotation.behavior.ReadsAttribute) ArrayList(java.util.ArrayList) ReadsAttributes(org.apache.nifi.annotation.behavior.ReadsAttributes)

Aggregations

ArrayList (java.util.ArrayList)1 ReadsAttribute (org.apache.nifi.annotation.behavior.ReadsAttribute)1 ReadsAttributes (org.apache.nifi.annotation.behavior.ReadsAttributes)1