public class LoggingPropertyValidationHandler extends Object implements PropertyValidationHandler
Constructor and Description |
---|
LoggingPropertyValidationHandler()
Default constructor, no system exit will be performed if
PropertyIO or any Property is invalid. |
LoggingPropertyValidationHandler(boolean doSystemExitIfAnythingIsInvalid)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
afterValidation(org.apache.commons.logging.Log logger,
boolean isAllValid)
Method called after validation of the PropertyIO and all the Property's.
|
void |
invalidProperty(org.apache.commons.logging.Log logger,
Property<?> property,
Exception exception)
A handle of a property which is INVALID.
|
void |
invalidPropertyIO(org.apache.commons.logging.Log logger,
PropertyIO io,
Exception exception)
If the propertyIO was INVALID (aka it could NOT find the property file etc.)
|
boolean |
isDoSystemExitIfAnythingIsInvalid() |
protected void |
logError(org.apache.commons.logging.Log logger,
String message) |
protected void |
logInfo(org.apache.commons.logging.Log logger,
String message) |
void |
validProperty(org.apache.commons.logging.Log logger,
Property<?> property)
A handle of a property that is valid
|
void |
validPropertyIO(org.apache.commons.logging.Log logger,
PropertyIO io)
A handle of a property IO that is valid.
|
public LoggingPropertyValidationHandler()
PropertyIO
or any Property
is invalid.public LoggingPropertyValidationHandler(boolean doSystemExitIfAnythingIsInvalid)
doSystemExitIfAnythingIsInvalid
- if true
an System.exit(42);
will be performed if either the PropertyIO
or any Property
is invalid.public boolean isDoSystemExitIfAnythingIsInvalid()
public void invalidProperty(org.apache.commons.logging.Log logger, Property<?> property, Exception exception)
PropertyValidationHandler
invalidProperty
in interface PropertyValidationHandler
logger
- the logger, if null
than System.err
is used.property
- the property which is INVALID, can be null
.exception
- the exceptionpublic void validProperty(org.apache.commons.logging.Log logger, Property<?> property)
PropertyValidationHandler
validProperty
in interface PropertyValidationHandler
logger
- the logger, if null
than System.out
is used.property
- the property which is VALID.public void invalidPropertyIO(org.apache.commons.logging.Log logger, PropertyIO io, Exception exception)
PropertyValidationHandler
invalidPropertyIO
in interface PropertyValidationHandler
logger
- the logger, if null
than System.err
is used.io
- the IO usedexception
- the exceptionpublic void validPropertyIO(org.apache.commons.logging.Log logger, PropertyIO io)
PropertyValidationHandler
validPropertyIO
in interface PropertyValidationHandler
logger
- the logger, if null
than System.out
is used.io
- the IO used.public void afterValidation(org.apache.commons.logging.Log logger, boolean isAllValid)
PropertyValidationHandler
afterValidation
in interface PropertyValidationHandler
logger
- the logger, if null
than System.err
or System.out
is usedisAllValid
- true
if PropertyIO and all Property's is valid, otherwise false
.protected void logInfo(org.apache.commons.logging.Log logger, String message)
protected void logError(org.apache.commons.logging.Log logger, String message)