Package org.apache.nifi.documentation
Class AbstractDocumentationWriter
java.lang.Object
org.apache.nifi.documentation.AbstractDocumentationWriter
- All Implemented Interfaces:
ExtensionDocumentationWriter
- Direct Known Subclasses:
XmlDocumentationWriter
public abstract class AbstractDocumentationWriter
extends Object
implements ExtensionDocumentationWriter
Base class for DocumentationWriter that simplifies iterating over all information for a component, creating a separate method
for each, to ensure that implementations properly override all methods and therefore properly account for all information about
a component.
Please note that while this class lives within the nifi-api, it is provided primarily as a means for documentation components within
the NiFi NAR Maven Plugin. Its home is the nifi-api, however, because the API is needed in order to extract the relevant information and
the NAR Maven Plugin cannot have a direct dependency on nifi-api (doing so would cause a circular dependency). By having this homed within
the nifi-api, the Maven plugin is able to discover the class dynamically and invoke the one or two methods necessary to create the documentation.
This is a new capability in 1.9.0 in preparation for the Extension Registry and therefore, you should
NOTE WELL: At this time, while this class is part of nifi-api, it is still evolving and may change in a non-backward-compatible manner or even be
removed from one incremental release to the next. Use at your own risk!
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringgetDescription(ConfigurableComponent component) protected List<DynamicProperty> getDynamicProperties(ConfigurableComponent configurableComponent) private DynamicRelationshipgetDynamicRelationship(Processor processor) protected ExtensionTypegetExtensionType(ConfigurableComponent component) private InputRequirement.RequirementgetInputRequirement(ConfigurableComponent component) private List<MultiProcessorUseCase> getMultiProcessorUseCases(ConfigurableComponent component) private List<ReadsAttribute> getReadsAttributes(Processor processor) private List<SystemResourceConsideration> getTags(ConfigurableComponent component) getUseCases(ConfigurableComponent component) private List<WritesAttribute> getWritesAttributes(Processor processor) voidinitialize(ConfigurableComponent component) Calls initialize on the component.protected voidinitialize(ControllerService service) protected voidinitialize(FlowAnalysisRule flowAnalysisRule) protected voidinitialize(ParameterProvider parameterProvider) protected voidinitialize(Processor processor) protected voidinitialize(ReportingTask reportingTask) final voidwrite(ConfigurableComponent component) Write the documentation for the given component.final voidwrite(ConfigurableComponent component, Collection<ServiceAPI> providedServices, Map<String, ServiceAPI> propertyServices) Writes the documentation for the given component.protected voidwriteBody(ConfigurableComponent component, Map<String, ServiceAPI> propertyServices) protected abstract voidwriteDefaultSchedule(DefaultSchedule defaultSchedule) protected abstract voidwriteDefaultSettings(DefaultSettings defaultSettings) protected abstract voidwriteDeprecationNotice(DeprecationNotice deprecationNotice) protected abstract voidwriteDescription(String description) protected abstract voidwriteDynamicProperties(List<DynamicProperty> dynamicProperties) protected abstract voidwriteDynamicRelationship(DynamicRelationship dynamicRelationship) protected abstract voidwriteExtensionName(String extensionName) protected abstract voidwriteExtensionType(ExtensionType extensionType) protected abstract voidwriteFooter(ConfigurableComponent component) protected abstract voidwriteHeader(ConfigurableComponent component) protected abstract voidwriteInputRequirementInfo(InputRequirement.Requirement requirement) protected abstract voidwriteMultiProcessorUseCases(List<MultiProcessorUseCase> useCases) protected abstract voidwritePrimaryNodeOnly(PrimaryNodeOnly primaryNodeOnly) protected abstract voidwriteProperties(List<PropertyDescriptor> properties, Map<String, ServiceAPI> propertyServices) protected abstract voidwriteProvidedServices(Collection<ServiceAPI> providedServices) protected abstract voidwriteReadsAttributes(List<ReadsAttribute> attributes) protected abstract voidwriteRelationships(Set<Relationship> relationships) protected abstract voidwriteRestrictedInfo(Restricted restricted) protected abstract voidwriteSeeAlso(SeeAlso seeAlso) protected abstract voidwriteSideEffectFree(SideEffectFree sideEffectFree) protected abstract voidwriteStatefulInfo(Stateful stateful) protected abstract voidwriteSupportsBatching(SupportsBatching supportsBatching) protected abstract voidwriteSupportsSensitiveDynamicProperties(SupportsSensitiveDynamicProperties supportsSensitiveDynamicProperties) protected abstract voidwriteSystemResourceConsiderationInfo(List<SystemResourceConsideration> considerations) protected abstract voidprotected abstract voidwriteTriggerSerially(TriggerSerially triggerSerially) protected abstract voidwriteTriggerWhenAnyDestinationAvailable(TriggerWhenAnyDestinationAvailable triggerWhenAnyDestinationAvailable) protected abstract voidwriteTriggerWhenEmpty(TriggerWhenEmpty triggerWhenEmpty) protected abstract voidwriteUseCases(List<UseCase> useCases) protected abstract voidwriteWritesAttributes(List<WritesAttribute> attributes)
-
Constructor Details
-
AbstractDocumentationWriter
public AbstractDocumentationWriter()
-
-
Method Details
-
initialize
Description copied from interface:ExtensionDocumentationWriterCalls initialize on the component. Must be called before calling any write methods.- Specified by:
initializein interfaceExtensionDocumentationWriter- Parameters:
component- the component to initialize
-
initialize
-
initialize
- Throws:
InitializationException
-
initialize
- Throws:
InitializationException
-
initialize
- Throws:
InitializationException
-
initialize
- Throws:
InitializationException
-
write
Description copied from interface:ExtensionDocumentationWriterWrite the documentation for the given component.- Specified by:
writein interfaceExtensionDocumentationWriter- Parameters:
component- the component to document- Throws:
IOException- if an error occurs writing the documentation
-
write
public final void write(ConfigurableComponent component, Collection<ServiceAPI> providedServices, Map<String, ServiceAPI> propertyServices) throws IOExceptionDescription copied from interface:ExtensionDocumentationWriterWrites the documentation for the given component.- Specified by:
writein interfaceExtensionDocumentationWriter- Parameters:
component- the component to documentprovidedServices- the service APIs implemented by the componentpropertyServices- the service APIs required by the property descriptors of the component- Throws:
IOException- if an error occurs writing the documentation
-
writeBody
protected void writeBody(ConfigurableComponent component, Map<String, ServiceAPI> propertyServices) throws IOException- Throws:
IOException
-
getDescription
-
getTags
-
getDynamicProperties
-
getDynamicRelationship
-
getReadsAttributes
-
getWritesAttributes
-
getInputRequirement
-
getSystemResourceConsiderations
private List<SystemResourceConsideration> getSystemResourceConsiderations(ConfigurableComponent component) -
getUseCases
-
getMultiProcessorUseCases
-
getExtensionType
-
writeHeader
- Throws:
IOException
-
writeExtensionName
- Throws:
IOException
-
writeExtensionType
- Throws:
IOException
-
writeDeprecationNotice
protected abstract void writeDeprecationNotice(DeprecationNotice deprecationNotice) throws IOException - Throws:
IOException
-
writeDescription
- Throws:
IOException
-
writeTags
- Throws:
IOException
-
writeProperties
protected abstract void writeProperties(List<PropertyDescriptor> properties, Map<String, ServiceAPI> propertyServices) throws IOException- Throws:
IOException
-
writeDynamicProperties
protected abstract void writeDynamicProperties(List<DynamicProperty> dynamicProperties) throws IOException - Throws:
IOException
-
writeStatefulInfo
- Throws:
IOException
-
writeRestrictedInfo
- Throws:
IOException
-
writeInputRequirementInfo
protected abstract void writeInputRequirementInfo(InputRequirement.Requirement requirement) throws IOException - Throws:
IOException
-
writeSystemResourceConsiderationInfo
protected abstract void writeSystemResourceConsiderationInfo(List<SystemResourceConsideration> considerations) throws IOException - Throws:
IOException
-
writeSeeAlso
- Throws:
IOException
-
writeUseCases
- Throws:
IOException
-
writeMultiProcessorUseCases
protected abstract void writeMultiProcessorUseCases(List<MultiProcessorUseCase> useCases) throws IOException - Throws:
IOException
-
writeDefaultSchedule
- Throws:
IOException
-
writeRelationships
- Throws:
IOException
-
writeDynamicRelationship
protected abstract void writeDynamicRelationship(DynamicRelationship dynamicRelationship) throws IOException - Throws:
IOException
-
writeReadsAttributes
- Throws:
IOException
-
writeWritesAttributes
- Throws:
IOException
-
writeTriggerSerially
- Throws:
IOException
-
writeTriggerWhenEmpty
- Throws:
IOException
-
writeTriggerWhenAnyDestinationAvailable
protected abstract void writeTriggerWhenAnyDestinationAvailable(TriggerWhenAnyDestinationAvailable triggerWhenAnyDestinationAvailable) throws IOException - Throws:
IOException
-
writeSupportsBatching
- Throws:
IOException
-
writeSupportsSensitiveDynamicProperties
protected abstract void writeSupportsSensitiveDynamicProperties(SupportsSensitiveDynamicProperties supportsSensitiveDynamicProperties) throws IOException - Throws:
IOException
-
writePrimaryNodeOnly
- Throws:
IOException
-
writeSideEffectFree
- Throws:
IOException
-
writeDefaultSettings
- Throws:
IOException
-
writeProvidedServices
protected abstract void writeProvidedServices(Collection<ServiceAPI> providedServices) throws IOException - Throws:
IOException
-