use of org.apache.nifi.annotation.documentation.Tags in project nifi by apache.
the class HtmlDocumentationWriter method writeTags.
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();
}
use of org.apache.nifi.annotation.documentation.Tags in project nifi by apache.
the class DtoFactory method getTags.
/**
* 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);
}
}
if (cls.isAnnotationPresent(Restricted.class)) {
tags.add("restricted");
}
return tags;
}
Aggregations