Class JsonValidator
- java.lang.Object
-
- io.wcm.devops.conga.generator.plugins.validator.JsonValidator
-
- All Implemented Interfaces:
FilePlugin<ValidatorContext,Void>
,Plugin
,ValidatorPlugin
public final class JsonValidator extends Object implements ValidatorPlugin
Validates JSON syntax.
-
-
Constructor Summary
Constructors Constructor Description JsonValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accepts(FileContext file, ValidatorContext context)
Checks if the plugin can be applied to the given file.Void
apply(FileContext file, ValidatorContext context)
Validates the given fileString
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.ValidatorPlugin
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, ValidatorContext context)
Description copied from interface:FilePlugin
Checks if the plugin can be applied to the given file.- Specified by:
accepts
in interfaceFilePlugin<ValidatorContext,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, ValidatorContext context) throws ValidationException
Description copied from interface:ValidatorPlugin
Validates the given file- Specified by:
apply
in interfaceFilePlugin<ValidatorContext,Void>
- Specified by:
apply
in interfaceValidatorPlugin
- Parameters:
file
- Context filecontext
- Context objects- Returns:
- nothing
- Throws:
ValidationException
- when the validation fails.
-
-