Class AbstractFileHeader
java.lang.Object
io.wcm.devops.conga.generator.plugins.fileheader.AbstractFileHeader
- All Implemented Interfaces:
FileHeaderPlugin,FilePlugin<FileHeaderContext,,Void> Plugin
- Direct Known Subclasses:
ConfFileHeader,JsonFileHeader,UnixShellScriptFileHeader,WindowsShellScriptFileHeader
Generic file header plugin implementation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Voidapply(FileContext file, FileHeaderContext context) Applies the comment file header.protected final FileHeaderContextExtract file header from the beginning of file between comment block start and end symbol.protected final FileHeaderContextExtract file header from the beginning of file with all lines starting with line prefix.protected StringGets block suffix.protected StringGets comment block end.protected StringGets comment block start.protected StringGets comment line prefix.protected intgetInsertPosition(String content) Gets insert position for file header.protected StringGets line break character(s).protected StringsanitizeComment(String line) Sanitizes comment line.Methods 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
extract, implicitApplyMethods inherited from interface io.wcm.devops.conga.generator.spi.FilePlugin
accepts
-
Constructor Details
-
AbstractFileHeader
public AbstractFileHeader()
-
-
Method Details
-
apply
Description copied from interface:FileHeaderPluginApplies the comment file header.- Specified by:
applyin interfaceFileHeaderPlugin- Specified by:
applyin interfaceFilePlugin<FileHeaderContext,Void> - Parameters:
file- Context filecontext- Context objects- Returns:
- nothing
-
sanitizeComment
Sanitizes comment line.- Parameters:
line- Comment line- Returns:
- Sanitized comment line
-
getLineBreak
Gets line break character(s).- Returns:
- Line break character(s)
-
getCommentBlockStart
Gets comment block start.- Returns:
- Comment block start string
-
getCommentBlockEnd
Gets comment block end.- Returns:
- Comment block end string
-
getCommentLinePrefix
Gets comment line prefix.- Returns:
- Comment line prefix string
-
getBlockSuffix
Gets block suffix.- Returns:
- Block suffix string
-
getInsertPosition
Gets insert position for file header.- Parameters:
content- File content- Returns:
- Insert position
-
extractFileHeaderBetweenBlockStartEnd
Extract file header from the beginning of file between comment block start and end symbol.- Parameters:
file- File- Returns:
- File header or null
-
extractFileHeaderWithLinePrefixes
Extract file header from the beginning of file with all lines starting with line prefix.- Parameters:
file- File File- Returns:
- File header or null
-