Search in sources :

Example 1 with CapabilityDescription

use of org.apache.nifi.annotation.documentation.CapabilityDescription in project nifi by apache.

the class StandardProcessorNode method getProcessorDescription.

/**
 * @return the value of the processor's {@link CapabilityDescription}
 *         annotation, if one exists, else <code>null</code>.
 */
public String getProcessorDescription() {
    final Processor processor = processorRef.get().getProcessor();
    final CapabilityDescription capDesc = processor.getClass().getAnnotation(CapabilityDescription.class);
    String description = null;
    if (capDesc != null) {
        description = capDesc.value();
    }
    return description;
}
Also used : CapabilityDescription(org.apache.nifi.annotation.documentation.CapabilityDescription) Processor(org.apache.nifi.processor.Processor)

Example 2 with CapabilityDescription

use of org.apache.nifi.annotation.documentation.CapabilityDescription in project nifi by apache.

the class HtmlDocumentationWriter method getDescription.

/**
 * Gets a description of the ConfigurableComponent using the
 * CapabilityDescription annotation.
 *
 * @param configurableComponent the component to describe
 * @return a description of the configurableComponent
 */
protected String getDescription(final ConfigurableComponent configurableComponent) {
    final CapabilityDescription capabilityDescription = configurableComponent.getClass().getAnnotation(CapabilityDescription.class);
    final String description;
    if (capabilityDescription != null) {
        description = capabilityDescription.value();
    } else {
        description = "No description provided.";
    }
    return description;
}
Also used : CapabilityDescription(org.apache.nifi.annotation.documentation.CapabilityDescription)

Aggregations

CapabilityDescription (org.apache.nifi.annotation.documentation.CapabilityDescription)2 Processor (org.apache.nifi.processor.Processor)1