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 String
getDescription
(ConfigurableComponent component) protected List
<DynamicProperty> getDynamicProperties
(ConfigurableComponent configurableComponent) private DynamicRelationship
getDynamicRelationship
(Processor processor) protected ExtensionType
getExtensionType
(ConfigurableComponent component) private InputRequirement.Requirement
getInputRequirement
(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) void
initialize
(ConfigurableComponent component) Calls initialize on the component.protected void
initialize
(ControllerService service) protected void
initialize
(FlowAnalysisRule flowAnalysisRule) protected void
initialize
(ParameterProvider parameterProvider) protected void
initialize
(Processor processor) protected void
initialize
(ReportingTask reportingTask) final void
write
(ConfigurableComponent component) Write the documentation for the given component.final void
write
(ConfigurableComponent component, Collection<ServiceAPI> providedServices, Map<String, ServiceAPI> propertyServices) Writes the documentation for the given component.protected void
writeBody
(ConfigurableComponent component, Map<String, ServiceAPI> propertyServices) protected abstract void
writeDefaultSchedule
(DefaultSchedule defaultSchedule) protected abstract void
writeDefaultSettings
(DefaultSettings defaultSettings) protected abstract void
writeDeprecationNotice
(DeprecationNotice deprecationNotice) protected abstract void
writeDescription
(String description) protected abstract void
writeDynamicProperties
(List<DynamicProperty> dynamicProperties) protected abstract void
writeDynamicRelationship
(DynamicRelationship dynamicRelationship) protected abstract void
writeExtensionName
(String extensionName) protected abstract void
writeExtensionType
(ExtensionType extensionType) protected abstract void
writeFooter
(ConfigurableComponent component) protected abstract void
writeHeader
(ConfigurableComponent component) protected abstract void
writeInputRequirementInfo
(InputRequirement.Requirement requirement) protected abstract void
writeMultiProcessorUseCases
(List<MultiProcessorUseCase> useCases) protected abstract void
writePrimaryNodeOnly
(PrimaryNodeOnly primaryNodeOnly) protected abstract void
writeProperties
(List<PropertyDescriptor> properties, Map<String, ServiceAPI> propertyServices) protected abstract void
writeProvidedServices
(Collection<ServiceAPI> providedServices) protected abstract void
writeReadsAttributes
(List<ReadsAttribute> attributes) protected abstract void
writeRelationships
(Set<Relationship> relationships) protected abstract void
writeRestrictedInfo
(Restricted restricted) protected abstract void
writeSeeAlso
(SeeAlso seeAlso) protected abstract void
writeSideEffectFree
(SideEffectFree sideEffectFree) protected abstract void
writeStatefulInfo
(Stateful stateful) protected abstract void
writeSupportsBatching
(SupportsBatching supportsBatching) protected abstract void
writeSupportsSensitiveDynamicProperties
(SupportsSensitiveDynamicProperties supportsSensitiveDynamicProperties) protected abstract void
writeSystemResourceConsiderationInfo
(List<SystemResourceConsideration> considerations) protected abstract void
protected abstract void
writeTriggerSerially
(TriggerSerially triggerSerially) protected abstract void
writeTriggerWhenAnyDestinationAvailable
(TriggerWhenAnyDestinationAvailable triggerWhenAnyDestinationAvailable) protected abstract void
writeTriggerWhenEmpty
(TriggerWhenEmpty triggerWhenEmpty) protected abstract void
writeUseCases
(List<UseCase> useCases) protected abstract void
writeWritesAttributes
(List<WritesAttribute> attributes)
-
Constructor Details
-
AbstractDocumentationWriter
public AbstractDocumentationWriter()
-
-
Method Details
-
initialize
Description copied from interface:ExtensionDocumentationWriter
Calls initialize on the component. Must be called before calling any write methods.- Specified by:
initialize
in 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:ExtensionDocumentationWriter
Write the documentation for the given component.- Specified by:
write
in 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:ExtensionDocumentationWriter
Writes the documentation for the given component.- Specified by:
write
in 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
-