public class HtmlDocumentationWriter extends Object implements DocumentationWriter
| Modifier and Type | Field and Description |
|---|---|
static String |
ADDITIONAL_DETAILS_HTML
The filename where additional user specified information may be stored.
|
private ExtensionManager |
extensionManager |
static org.slf4j.Logger |
LOGGER |
| Constructor and Description |
|---|
HtmlDocumentationWriter(ExtensionManager extensionManager) |
| Modifier and Type | Method and Description |
|---|---|
private boolean |
containsExpressionLanguage(ConfigurableComponent component)
Indicates whether or not the component contains at least one property that supports Expression Language.
|
private String |
getDefaultValue(PropertyDescriptor propertyDescriptor) |
protected String |
getDescription(ConfigurableComponent configurableComponent)
Gets a description of the ConfigurableComponent using the
CapabilityDescription annotation.
|
private List<DynamicProperty> |
getDynamicProperties(ConfigurableComponent configurableComponent) |
protected String |
getTitle(ConfigurableComponent configurableComponent)
Gets the class name of the component.
|
protected void |
iterateAndLinkComponents(XMLStreamWriter xmlStreamWriter,
Class<? extends ConfigurableComponent>[] linkedComponents,
String[] classNames,
String separator,
String sourceContextName)
Writes a link to another configurable component
|
(package private) static String |
join(Object[] objects) |
private Class<? extends ControllerService>[] |
lookupControllerServiceImpls(Class<? extends ControllerService> parent)
Uses the
ExtensionManager to discover any ControllerService implementations that implement a specific
ControllerService API. |
void |
write(ConfigurableComponent configurableComponent,
OutputStream streamToWriteTo,
boolean includesAdditionalDocumentation) |
protected void |
writeAdditionalBodyInfo(ConfigurableComponent configurableComponent,
XMLStreamWriter xmlStreamWriter)
This method may be overridden by sub classes to write additional
information to the body of the documentation.
|
private void |
writeBody(ConfigurableComponent configurableComponent,
XMLStreamWriter xmlStreamWriter,
boolean hasAdditionalDetails)
Writes the body section of the documentation, this consists of the
component description, the tags, and the PropertyDescriptors.
|
private void |
writeDeprecationWarning(ConfigurableComponent configurableComponent,
XMLStreamWriter xmlStreamWriter)
Writes a warning about the deprecation of a component.
|
protected void |
writeDescription(ConfigurableComponent configurableComponent,
XMLStreamWriter xmlStreamWriter,
boolean hasAdditionalDetails)
Writes a description of the configurable component.
|
private void |
writeDynamicProperties(ConfigurableComponent configurableComponent,
XMLStreamWriter xmlStreamWriter) |
protected void |
writeHead(ConfigurableComponent configurableComponent,
XMLStreamWriter xmlStreamWriter)
Writes the head portion of the HTML documentation.
|
private void |
writeHeader(ConfigurableComponent configurableComponent,
XMLStreamWriter xmlStreamWriter)
Write the header to be displayed when loaded outside an iframe.
|
private void |
writeInputRequirementInfo(ConfigurableComponent configurableComponent,
XMLStreamWriter xmlStreamWriter)
Add in the documentation information regarding the component whether it accepts an
incoming relationship or not.
|
protected void |
writeLink(XMLStreamWriter xmlStreamWriter,
String text,
String location)
A helper method to write a link
|
protected void |
writeProperties(ConfigurableComponent configurableComponent,
XMLStreamWriter xmlStreamWriter)
Writes the PropertyDescriptors out as a table.
|
private void |
writeRestrictedInfo(ConfigurableComponent configurableComponent,
XMLStreamWriter xmlStreamWriter)
Write the description of the Restricted annotation if provided in this component.
|
private void |
writeSeeAlso(ConfigurableComponent configurableComponent,
XMLStreamWriter xmlStreamWriter)
Writes the list of components that may be linked from this component.
|
protected static void |
writeSimpleElement(XMLStreamWriter writer,
String elementName,
String characters)
Writes a begin element, then text, then end element for the element of a
users choosing.
|
protected static void |
writeSimpleElement(XMLStreamWriter writer,
String elementName,
String characters,
String id)
Writes a begin element, an id attribute(if specified), then text, then
end element for element of the users choosing.
|
private void |
writeStatefulInfo(ConfigurableComponent configurableComponent,
XMLStreamWriter xmlStreamWriter)
Write the description of the Stateful annotation if provided in this component.
|
private void |
writeSupportsSensitiveDynamicProperties(ConfigurableComponent configurableComponent,
XMLStreamWriter writer) |
private void |
writeSystemResourceConsiderationInfo(ConfigurableComponent configurableComponent,
XMLStreamWriter xmlStreamWriter)
Writes all the system resource considerations for this component
|
private void |
writeTags(ConfigurableComponent configurableComponent,
XMLStreamWriter xmlStreamWriter) |
private void |
writeValidValueDescription(XMLStreamWriter xmlStreamWriter,
String description) |
protected void |
writeValidValues(XMLStreamWriter xmlStreamWriter,
PropertyDescriptor property)
Interrogates a PropertyDescriptor to get a list of AllowableValues, if
there are none, nothing is written to the stream.
|
public static final org.slf4j.Logger LOGGER
public static final String ADDITIONAL_DETAILS_HTML
private final ExtensionManager extensionManager
public HtmlDocumentationWriter(ExtensionManager extensionManager)
public void write(ConfigurableComponent configurableComponent, OutputStream streamToWriteTo, boolean includesAdditionalDocumentation) throws IOException
write in interface DocumentationWriterIOExceptionprotected void writeHead(ConfigurableComponent configurableComponent, XMLStreamWriter xmlStreamWriter) throws XMLStreamException
configurableComponent - the component to describexmlStreamWriter - the stream to write toXMLStreamException - thrown if there was a problem writing to the
streamprotected String getTitle(ConfigurableComponent configurableComponent)
configurableComponent - the component to describeprivate void writeBody(ConfigurableComponent configurableComponent, XMLStreamWriter xmlStreamWriter, boolean hasAdditionalDetails) throws XMLStreamException
configurableComponent - the component to describexmlStreamWriter - the stream writerhasAdditionalDetails - whether there are additional details present
or notXMLStreamException - thrown if there was a problem writing to the
XML streamprivate void writeHeader(ConfigurableComponent configurableComponent, XMLStreamWriter xmlStreamWriter) throws XMLStreamException
configurableComponent - the component to describexmlStreamWriter - the stream writer to useXMLStreamException - thrown if there was a problem writing the XMLprivate void writeInputRequirementInfo(ConfigurableComponent configurableComponent, XMLStreamWriter xmlStreamWriter) throws XMLStreamException
configurableComponent - the component to describexmlStreamWriter - the stream writer to useXMLStreamException - thrown if there was a problem writing the XMLprivate void writeStatefulInfo(ConfigurableComponent configurableComponent, XMLStreamWriter xmlStreamWriter) throws XMLStreamException
configurableComponent - the component to describexmlStreamWriter - the stream writer to useXMLStreamException - thrown if there was a problem writing the XMLprivate void writeRestrictedInfo(ConfigurableComponent configurableComponent, XMLStreamWriter xmlStreamWriter) throws XMLStreamException
configurableComponent - the component to describexmlStreamWriter - the stream writer to useXMLStreamException - thrown if there was a problem writing the XMLprivate void writeDeprecationWarning(ConfigurableComponent configurableComponent, XMLStreamWriter xmlStreamWriter) throws XMLStreamException
configurableComponent - the component to describexmlStreamWriter - the stream writerXMLStreamException - thrown if there was a problem writing to the
XML streamprivate void writeSeeAlso(ConfigurableComponent configurableComponent, XMLStreamWriter xmlStreamWriter) throws XMLStreamException
configurableComponent - the component to describexmlStreamWriter - the stream writer to useXMLStreamException - thrown if there was a problem writing the XMLprotected void writeAdditionalBodyInfo(ConfigurableComponent configurableComponent, XMLStreamWriter xmlStreamWriter) throws XMLStreamException
configurableComponent - the component to describexmlStreamWriter - the stream writerXMLStreamException - thrown if there was a problem writing to the
XML streamprivate void writeTags(ConfigurableComponent configurableComponent, XMLStreamWriter xmlStreamWriter) throws XMLStreamException
XMLStreamExceptionprotected void writeDescription(ConfigurableComponent configurableComponent, XMLStreamWriter xmlStreamWriter, boolean hasAdditionalDetails) throws XMLStreamException
configurableComponent - the component to describexmlStreamWriter - the stream writerhasAdditionalDetails - whether there are additional details
available as 'additionalDetails.html'XMLStreamException - thrown if there was a problem writing to the
XML streamprotected String getDescription(ConfigurableComponent configurableComponent)
configurableComponent - the component to describeprotected void writeProperties(ConfigurableComponent configurableComponent, XMLStreamWriter xmlStreamWriter) throws XMLStreamException
configurableComponent - the component to describexmlStreamWriter - the stream writerXMLStreamException - thrown if there was a problem writing to the
XML Streamprivate String getDefaultValue(PropertyDescriptor propertyDescriptor)
private boolean containsExpressionLanguage(ConfigurableComponent component)
component - the component to interrogateprivate void writeDynamicProperties(ConfigurableComponent configurableComponent, XMLStreamWriter xmlStreamWriter) throws XMLStreamException
XMLStreamExceptionprivate void writeSupportsSensitiveDynamicProperties(ConfigurableComponent configurableComponent, XMLStreamWriter writer) throws XMLStreamException
XMLStreamExceptionprivate List<DynamicProperty> getDynamicProperties(ConfigurableComponent configurableComponent)
private void writeValidValueDescription(XMLStreamWriter xmlStreamWriter, String description) throws XMLStreamException
XMLStreamExceptionprotected void writeValidValues(XMLStreamWriter xmlStreamWriter, PropertyDescriptor property) throws XMLStreamException
xmlStreamWriter - the stream writer to useproperty - the property to describeXMLStreamException - thrown if there was a problem writing to the
XML Streamprotected static void writeSimpleElement(XMLStreamWriter writer, String elementName, String characters, String id) throws XMLStreamException
writer - the stream writer to useelementName - the name of the elementcharacters - the text of the elementid - the id of the element. specifying null will cause no element to
be written.XMLStreamException - xseprotected static void writeSimpleElement(XMLStreamWriter writer, String elementName, String characters) throws XMLStreamException
writer - the stream writer to useelementName - the name of the elementcharacters - the characters to insert into the elementXMLStreamExceptionprotected void writeLink(XMLStreamWriter xmlStreamWriter, String text, String location) throws XMLStreamException
xmlStreamWriter - the stream to write totext - the text of the linklocation - the location of the linkXMLStreamException - thrown if there was a problem writing to the
streamprivate void writeSystemResourceConsiderationInfo(ConfigurableComponent configurableComponent, XMLStreamWriter xmlStreamWriter) throws XMLStreamException
configurableComponent - the component to describexmlStreamWriter - the xml stream writer to useXMLStreamException - thrown if there was a problem writing the XMLprivate Class<? extends ControllerService>[] lookupControllerServiceImpls(Class<? extends ControllerService> parent)
ExtensionManager to discover any ControllerService implementations that implement a specific
ControllerService API.parent - the controller service APIprotected void iterateAndLinkComponents(XMLStreamWriter xmlStreamWriter, Class<? extends ConfigurableComponent>[] linkedComponents, String[] classNames, String separator, String sourceContextName) throws XMLStreamException
xmlStreamWriter - the xml stream writerlinkedComponents - the array of configurable component to link toclassNames - the array of class names in string format to link toseparator - a separator used to split the values (in case more than 1. If the separator is enclosed in
between "<" and ">" (.e.g "sourceContextName - the source context/name of the item being linkedXMLStreamException - thrown if there is a problem writing the XMLCopyright © 2023 Apache NiFi Project. All rights reserved.