Class JsonFileHeader
java.lang.Object
io.wcm.devops.conga.generator.plugins.fileheader.AbstractFileHeader
io.wcm.devops.conga.generator.plugins.fileheader.JsonFileHeader
- All Implemented Interfaces:
FileHeaderPlugin,FilePlugin<FileHeaderContext,,Void> Plugin
Adds file headers to JSON files.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaccepts(FileContext file, FileHeaderContext context) Checks if the plugin can be applied to the given file.extract(FileContext file) Extract comment lines from file header.protected StringGets comment block end.protected StringGets comment block start.getName()Gets plugin name.protected StringsanitizeComment(String line) Sanitizes comment line.Methods inherited from class io.wcm.devops.conga.generator.plugins.fileheader.AbstractFileHeader
apply, extractFileHeaderBetweenBlockStartEnd, extractFileHeaderWithLinePrefixes, getBlockSuffix, getCommentLinePrefix, getInsertPosition, getLineBreakMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.wcm.devops.conga.generator.spi.FileHeaderPlugin
implicitApply
-
Field Details
-
NAME
Plugin name- See Also:
-
-
Constructor Details
-
JsonFileHeader
public JsonFileHeader()
-
-
Method Details
-
getName
Description copied from interface:PluginGets plugin name.- Returns:
- Plugin name to be referenced in definition file
-
accepts
Description copied from interface:FilePluginChecks if the plugin can be applied to the given file.- Parameters:
file- Context filecontext- Context objects- Returns:
- true when the plugin can be applied to the given file.
-
sanitizeComment
Description copied from class:AbstractFileHeaderSanitizes comment line.- Overrides:
sanitizeCommentin classAbstractFileHeader- Parameters:
line- Comment line- Returns:
- Sanitized comment line
-
getCommentBlockStart
Description copied from class:AbstractFileHeaderGets comment block start.- Overrides:
getCommentBlockStartin classAbstractFileHeader- Returns:
- Comment block start string
-
getCommentBlockEnd
Description copied from class:AbstractFileHeaderGets comment block end.- Overrides:
getCommentBlockEndin classAbstractFileHeader- Returns:
- Comment block end string
-
extract
Description copied from interface:FileHeaderPluginExtract comment lines from file header.- Parameters:
file- Context file- Returns:
- File header context with comment lines. Returns null if extraction not possible or no comments present.
-