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.
  • Field Details

  • Constructor Details

    • JsonFileHeader

      public JsonFileHeader()
  • Method Details

    • getName

      public String getName()
      Description copied from interface: Plugin
      Gets plugin name.
      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 file
      context - Context objects
      Returns:
      true when the plugin can be applied to the given file.
    • sanitizeComment

      protected String sanitizeComment(String line)
      Description copied from class: AbstractFileHeader
      Sanitizes comment line.
      Overrides:
      sanitizeComment in class AbstractFileHeader
      Parameters:
      line - Comment line
      Returns:
      Sanitized comment line
    • getCommentBlockStart

      protected String getCommentBlockStart()
      Description copied from class: AbstractFileHeader
      Gets comment block start.
      Overrides:
      getCommentBlockStart in class AbstractFileHeader
      Returns:
      Comment block start string
    • getCommentBlockEnd

      protected String getCommentBlockEnd()
      Description copied from class: AbstractFileHeader
      Gets comment block end.
      Overrides:
      getCommentBlockEnd in class AbstractFileHeader
      Returns:
      Comment block end string
    • 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.