Class XmlFileHeader
- java.lang.Object
-
- io.wcm.devops.conga.generator.plugins.fileheader.XmlFileHeader
-
- All Implemented Interfaces:
FileHeaderPlugin
,FilePlugin<FileHeaderContext,Void>
,Plugin
public final class XmlFileHeader extends Object implements FileHeaderPlugin
Adds file headers to XML files.
-
-
Constructor Summary
Constructors Constructor Description XmlFileHeader()
Constructor.
-
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.Void
apply(FileContext file, FileHeaderContext context)
Applies the comment file header.FileHeaderContext
extract(FileContext file)
Extract comment lines from file header.String
getName()
-
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()
-
accepts
public boolean accepts(FileContext file, FileHeaderContext context)
Description copied from interface:FilePlugin
Checks if the plugin can be applied to the given file.- Specified by:
accepts
in interfaceFilePlugin<FileHeaderContext,Void>
- Parameters:
file
- Context filecontext
- Context objects- Returns:
- true when the plugin can be applied to the given file.
-
apply
public Void apply(FileContext file, FileHeaderContext context)
Description copied from interface:FileHeaderPlugin
Applies the comment file header.- Specified by:
apply
in interfaceFileHeaderPlugin
- Specified by:
apply
in interfaceFilePlugin<FileHeaderContext,Void>
- Parameters:
file
- Context filecontext
- Context objects- Returns:
- nothing
-
extract
public FileHeaderContext extract(FileContext file)
Description copied from interface:FileHeaderPlugin
Extract comment lines from file header.- Specified by:
extract
in interfaceFileHeaderPlugin
- Parameters:
file
- Context file- Returns:
- File header context with comment lines. Returns null if extraction not possible or no comments present.
-
-