org.apache.nifi.annotation.documentation.Tags Java Examples

The following examples show how to use org.apache.nifi.annotation.documentation.Tags. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HtmlDocumentationWriter.java    From localization_nifi with Apache License 2.0 5 votes vote down vote up
private void writeTags(final ConfigurableComponent configurableComponent,
        final XMLStreamWriter xmlStreamWriter) throws XMLStreamException {
    final Tags tags = configurableComponent.getClass().getAnnotation(Tags.class);
    xmlStreamWriter.writeStartElement("h3");
    xmlStreamWriter.writeCharacters("Tags: ");
    xmlStreamWriter.writeEndElement();
    xmlStreamWriter.writeStartElement("p");
    if (tags != null) {
        final String tagString = join(tags.value(), ", ");
        xmlStreamWriter.writeCharacters(tagString);
    } else {
        xmlStreamWriter.writeCharacters("None.");
    }
    xmlStreamWriter.writeEndElement();
}
 
Example #2
Source File: DtoFactory.java    From localization_nifi with Apache License 2.0 5 votes vote down vote up
/**
 * Gets the tags from the specified class.
 */
private Set<String> getTags(final Class<?> cls) {
    final Set<String> tags = new HashSet<>();
    final Tags tagsAnnotation = cls.getAnnotation(Tags.class);
    if (tagsAnnotation != null) {
        for (final String tag : tagsAnnotation.value()) {
            tags.add(tag);
        }
    }

    return tags;
}
 
Example #3
Source File: AbstractDocumentationWriter.java    From nifi with Apache License 2.0 5 votes vote down vote up
protected List<String> getTags(final ConfigurableComponent component) {
    final Tags tags = component.getClass().getAnnotation(Tags.class);
    if (tags == null) {
        return Collections.emptyList();
    }

    final String[] tagValues = tags.value();
    return tagValues == null ? Collections.emptyList() : Arrays.asList(tagValues);
}
 
Example #4
Source File: HtmlDocumentationWriter.java    From nifi with Apache License 2.0 5 votes vote down vote up
private void writeTags(final ConfigurableComponent configurableComponent,
        final XMLStreamWriter xmlStreamWriter) throws XMLStreamException {
    final Tags tags = configurableComponent.getClass().getAnnotation(Tags.class);
    xmlStreamWriter.writeStartElement("h3");
    xmlStreamWriter.writeCharacters("Tags: ");
    xmlStreamWriter.writeEndElement();
    xmlStreamWriter.writeStartElement("p");
    if (tags != null) {
        final String tagString = join(tags.value(), ", ");
        xmlStreamWriter.writeCharacters(tagString);
    } else {
        xmlStreamWriter.writeCharacters("No tags provided.");
    }
    xmlStreamWriter.writeEndElement();
}