本文整理了Java中org.apache.nifi.annotation.documentation.Tags.value()
方法的一些代码示例,展示了Tags.value()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tags.value()
方法的具体详情如下:
包路径:org.apache.nifi.annotation.documentation.Tags
类名称:Tags
方法名:value
暂无
代码示例来源:origin: apache/nifi
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);
}
代码示例来源:origin: apache/nifi
/**
* 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;
}
代码示例来源:origin: apache/nifi
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();
}
内容来源于网络,如有侵权,请联系作者删除!