|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.castor.xml.ValidationContext
public class ValidationContext
A class which can be used to hold validation information, used by the TypeValidator interface.
Constructor Summary | |
---|---|
ValidationContext()
Creates a new ValidationContext. |
Method Summary | |
---|---|
void |
addID(java.lang.String id)
Adds current ID (as seen during (un)marshalling) to the ID cache. |
protected void |
addValidated(java.lang.Object object)
Adds the specified object to the cache of already validated objects. |
boolean |
checkIdRef(java.lang.String id)
Checks an ID Reference, returning true if the provided ID is known. |
void |
cleanup()
Life-cycle method for proper 'shutdown operations'. |
Configuration |
getConfiguration()
Returns the Configuration to use during validation. |
XMLClassDescriptorResolver |
getResolver()
Returns the ClassDescriptorResolver to use during validation. |
java.util.Set |
getUnresolvedIdRefs()
Returns the Set of unresolved ID references. |
boolean |
isFailFast()
Returns true if the validation process should fail upon first error encountered, otherwise the validation processs will attempt to validate as much as possible (even after the first error is encountered) and collect as many errors before either returning (no errors) or throwing a validationException containing the list of errors. |
protected boolean |
isValidated(java.lang.Object object)
Checks whether an object has already been validated. |
protected void |
removeValidated(java.lang.Object object)
Removes the specified object from the cache of already validated objects. |
void |
setConfiguration(Configuration config)
Sets the Configuration used during validation. |
void |
setFailFast(boolean failFast)
Sets the fail-fast flag. |
void |
setResolver(XMLClassDescriptorResolver resolver)
Sets the ClassDescriptorResolver to use during validation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ValidationContext()
Method Detail |
---|
public Configuration getConfiguration()
public XMLClassDescriptorResolver getResolver()
public boolean isFailFast()
NOTE: DISABLING OF FAIL-FAST IS NOT YET ENABLED.
public void setConfiguration(Configuration config)
config
- the Configuration to usepublic void setFailFast(boolean failFast)
NOTE: DISABLING FAIL-FAST IS NOT YET ENABLED.
failFast
- a boolean that when true enables fail-fast validation,
otherwise the validator will attempt to validate as much as it can
reporting as many errors as possible before returning.public void setResolver(XMLClassDescriptorResolver resolver)
resolver
- the ClassDescriptorResolver to use.protected boolean isValidated(java.lang.Object object)
object
- The object for which the check should be performed
protected void addValidated(java.lang.Object object)
object
- Object about to be validated.protected void removeValidated(java.lang.Object object)
object
- The object to be removed from the cache.public void addID(java.lang.String id) throws ValidationException
id
- The current ID
ValidationException
- If an ID is used more than once.getUnresolvedIdRefs()
public boolean checkIdRef(java.lang.String id)
id
- The ID to check.
getUnresolvedIdRefs()
public java.util.Set getUnresolvedIdRefs()
public void cleanup()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |