Java源码示例:org.apache.nifi.annotation.documentation.SeeAlso
示例1
protected void writeBody(final ConfigurableComponent component, Map<String,ServiceAPI> propertyServices) throws IOException {
writeExtensionName(component.getClass().getName());
writeExtensionType(getExtensionType(component));
writeDeprecationNotice(component.getClass().getAnnotation(DeprecationNotice.class));
writeDescription(getDescription(component));
writeTags(getTags(component));
writeProperties(component.getPropertyDescriptors(), propertyServices);
writeDynamicProperties(getDynamicProperties(component));
if (component instanceof Processor) {
final Processor processor = (Processor) component;
writeRelationships(processor.getRelationships());
writeDynamicRelationship(getDynamicRelationship(processor));
writeReadsAttributes(getReadsAttributes(processor));
writeWritesAttributes(getWritesAttributes(processor));
}
writeStatefulInfo(component.getClass().getAnnotation(Stateful.class));
writeRestrictedInfo(component.getClass().getAnnotation(Restricted.class));
writeInputRequirementInfo(getInputRequirement(component));
writeSystemResourceConsiderationInfo(getSystemResourceConsiderations(component));
writeSeeAlso(component.getClass().getAnnotation(SeeAlso.class));
}
示例2
@Override
protected void writeSeeAlso(final SeeAlso seeAlso) throws IOException {
if (seeAlso == null) {
writeEmptyElement("seeAlso");
return;
}
final Class[] classes = seeAlso.value();
final String[] classNames = seeAlso.classNames();
final Set<String> toSee = new LinkedHashSet<>();
if (classes != null) {
for (final Class classToSee : classes) {
toSee.add(classToSee.getName());
}
}
if (classNames != null) {
Collections.addAll(toSee, classNames);
}
writeTextArray("seeAlso", "see", toSee);
}
示例3
/**
* Writes the list of components that may be linked from this component.
*
* @param configurableComponent the component to describe
* @param xmlStreamWriter the stream writer to use
* @throws XMLStreamException thrown if there was a problem writing the XML
*/
private void writeSeeAlso(ConfigurableComponent configurableComponent, XMLStreamWriter xmlStreamWriter)
throws XMLStreamException {
final SeeAlso seeAlso = configurableComponent.getClass().getAnnotation(SeeAlso.class);
if (seeAlso != null) {
writeSimpleElement(xmlStreamWriter, "h3", "See Also:");
xmlStreamWriter.writeStartElement("p");
Class<? extends ConfigurableComponent>[] componentNames = seeAlso.value();
String[] classNames = seeAlso.classNames();
if (componentNames.length > 0 || classNames.length > 0) {
// Write alternatives
iterateAndLinkComponents(xmlStreamWriter, componentNames, classNames, ", ", configurableComponent.getClass().getSimpleName());
} else {
xmlStreamWriter.writeCharacters("No tags provided.");
}
xmlStreamWriter.writeEndElement();
}
}
示例4
protected abstract void writeSeeAlso(SeeAlso seeAlso) throws IOException;