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
public final class JsonFileHeader extends AbstractFileHeader
Adds file headers to JSON files.
-
-
Constructor Summary
Constructors Constructor Description JsonFileHeader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accepts(FileContext file, FileHeaderContext context)
Checks if the plugin can be applied to the given file.FileHeaderContext
extract(FileContext file)
Extract comment lines from file header.protected String
getCommentBlockEnd()
protected String
getCommentBlockStart()
String
getName()
protected String
sanitizeComment(String line)
-
Methods inherited from class io.wcm.devops.conga.generator.plugins.fileheader.AbstractFileHeader
apply, extractFileHeaderBetweenBlockStartEnd, extractFileHeaderWithLinePrefixes, getBlockSuffix, getCommentLinePrefix, getInsertPosition, getLineBreak
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.wcm.devops.conga.generator.spi.FileHeaderPlugin
implicitApply
-
-
-
-
Field Detail
-
NAME
public static final String NAME
Plugin name- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
public String getName()
- Returns:
- Plugin name to be referenced in definition file
-
accepts
public boolean accepts(FileContext file, FileHeaderContext context)
Description copied from interface:FilePlugin
Checks 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
protected String sanitizeComment(String line)
- Overrides:
sanitizeComment
in classAbstractFileHeader
-
getCommentBlockStart
protected String getCommentBlockStart()
- Overrides:
getCommentBlockStart
in classAbstractFileHeader
-
getCommentBlockEnd
protected String getCommentBlockEnd()
- Overrides:
getCommentBlockEnd
in classAbstractFileHeader
-
extract
public FileHeaderContext extract(FileContext file)
Description copied from interface:FileHeaderPlugin
Extract 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.
-
-