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 Stringprotected StringgetName()protected StringsanitizeComment(String 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
- 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
- Overrides:
sanitizeCommentin classAbstractFileHeader
-
getCommentBlockStart
- Overrides:
getCommentBlockStartin classAbstractFileHeader
-
getCommentBlockEnd
- Overrides:
getCommentBlockEndin classAbstractFileHeader
-
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.
-