public class ValidationOverrides extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ValidationOverrides.Allow
A validation override which allows a particular change.
|
static class |
ValidationOverrides.ValidationException
A deployment validation exception.
|
Modifier and Type | Field and Description |
---|---|
static ValidationOverrides |
empty |
Constructor and Description |
---|
ValidationOverrides(List<ValidationOverrides.Allow> overrides)
Creates a validation overrides which does not have an xml form
|
Modifier and Type | Method and Description |
---|---|
boolean |
allows(String validationIdString,
Instant now) |
boolean |
allows(ValidationId validationId,
Instant now)
Returns whether the given (assumed invalid) change is allowed by this at the moment
|
static ValidationOverrides |
fromXml(Reader reader)
Returns a ValidationOverrides instance with the content of the given Reader.
|
static ValidationOverrides |
fromXml(String xmlForm)
Returns a ValidationOverrides instance with the content of the given XML string.
|
void |
invalid(ValidationId validationId,
String message,
Instant now)
Throws a ValidationException unless this validation is overridden at this time
|
static String |
toAllowMessage(ValidationId id) |
String |
xmlForm()
Returns the XML form of this, or null if it was not created by fromXml, nor is empty
|
public static final ValidationOverrides empty
public ValidationOverrides(List<ValidationOverrides.Allow> overrides)
public void invalid(ValidationId validationId, String message, Instant now)
public boolean allows(ValidationId validationId, Instant now)
public static String toAllowMessage(ValidationId id)
public String xmlForm()
public static ValidationOverrides fromXml(Reader reader)
reader
- the reader containing a validation-overrides XML structureIllegalArgumentException
- if the validation-allows.xml file exists but is invalidpublic static ValidationOverrides fromXml(String xmlForm)
xmlForm
- the string which optionally contains a validation-overrides XML structureIllegalArgumentException
- if the validation-allows.xml file exists but is invalidCopyright © 2018. All rights reserved.