Module com.github.rvesse.airline
Class VersionSection
- java.lang.Object
-
- com.github.rvesse.airline.help.sections.common.VersionSection
-
- All Implemented Interfaces:
HelpHint
,HelpSection
public class VersionSection extends java.lang.Object implements HelpSection
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
VersionSection.VersionInfo
-
Field Summary
Fields Modifier and Type Field Description private boolean
tabular
private java.lang.String[]
titles
private java.util.List<VersionSection.VersionInfo>
versions
-
Constructor Summary
Constructors Constructor Description VersionSection(java.lang.String[] dataSources, ResourceLocator[] resourceLocators, java.lang.String componentProperty, java.lang.String versionProperty, java.lang.String buildProperty, java.lang.String dateProperty, java.lang.String[] additionalProperties, java.lang.String[] additionalTitles, boolean suppressErrors, boolean tabular)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]
getContentBlock(int blockNumber)
Gets the content block with the given numberHelpFormat
getFormat()
Gets the format of the provided help informationjava.lang.String
getPostamble()
Gets the post-amble text that should be included at the end of the sectionjava.lang.String
getPreamble()
Gets the preamble text that should be includedjava.lang.String
getTitle()
Gets the title for the sectionprivate java.util.Properties
loadDataSource(ResourceLocator[] resourceLocators, java.lang.String source)
int
numContentBlocks()
Gets the number of content blocks providedprivate void
sourceNotFound(java.lang.String dataSource)
int
suggestedOrder()
Gets an integer indicating the suggested order that a help generator should include this section in
-
-
-
Field Detail
-
versions
private java.util.List<VersionSection.VersionInfo> versions
-
tabular
private final boolean tabular
-
titles
private final java.lang.String[] titles
-
-
Constructor Detail
-
VersionSection
public VersionSection(java.lang.String[] dataSources, ResourceLocator[] resourceLocators, java.lang.String componentProperty, java.lang.String versionProperty, java.lang.String buildProperty, java.lang.String dateProperty, java.lang.String[] additionalProperties, java.lang.String[] additionalTitles, boolean suppressErrors, boolean tabular)
-
-
Method Detail
-
sourceNotFound
private void sourceNotFound(java.lang.String dataSource)
-
loadDataSource
private java.util.Properties loadDataSource(ResourceLocator[] resourceLocators, java.lang.String source) throws java.io.IOException
- Throws:
java.io.IOException
-
getPreamble
public java.lang.String getPreamble()
Description copied from interface:HelpHint
Gets the preamble text that should be included- Specified by:
getPreamble
in interfaceHelpHint
- Returns:
- Preamble text
-
getFormat
public HelpFormat getFormat()
Description copied from interface:HelpHint
Gets the format of the provided help information
-
numContentBlocks
public int numContentBlocks()
Description copied from interface:HelpHint
Gets the number of content blocks providedHelp generators should consult the
HelpHint.getFormat()
return value to determine how to format the content blocks but they are not required to do so- Specified by:
numContentBlocks
in interfaceHelpHint
- Returns:
- Number of content blocks
-
getContentBlock
public java.lang.String[] getContentBlock(int blockNumber)
Description copied from interface:HelpHint
Gets the content block with the given number- Specified by:
getContentBlock
in interfaceHelpHint
- Parameters:
blockNumber
- Block number- Returns:
- Content Block
-
getTitle
public java.lang.String getTitle()
Description copied from interface:HelpSection
Gets the title for the section- Specified by:
getTitle
in interfaceHelpSection
- Returns:
- Section title
-
getPostamble
public java.lang.String getPostamble()
Description copied from interface:HelpSection
Gets the post-amble text that should be included at the end of the section- Specified by:
getPostamble
in interfaceHelpSection
- Returns:
-
suggestedOrder
public int suggestedOrder()
Description copied from interface:HelpSection
Gets an integer indicating the suggested order that a help generator should include this section inA value of zero indicates that the help generator can decide where to place this section, a positive value indicates it should be placed after the default sections while a negative value indicates it should be placed before the default sections. There is however no guarantee that a help generator will honour the order given.
- Specified by:
suggestedOrder
in interfaceHelpSection
- Returns:
- Suggested order
-
-