|
EclipseLink 2.1.2, build 'v20101206-r8635' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.persistence.jaxb.JAXBValidator
public class JAXBValidator
Facilitates JAXBValidation.
Constructor Summary | |
---|---|
JAXBValidator(XMLValidator newValidator)
This constructor creates a DefaultValidationEventHandlervalidation instance, and sets the XMLMarshaller instance to the one provided. |
Method Summary | |
---|---|
ValidationEventHandler |
getEventHandler()
Return the current event handler or the default event handler if one hasn't been set. |
java.lang.Object |
getProperty(java.lang.String key)
Get the particular property in the underlying implementation of Validator. |
void |
setEventHandler(ValidationEventHandler newValidationEventHandler)
Allow an application to register a validation event handler. |
void |
setProperty(java.lang.String key,
java.lang.Object value)
Set the particular property in the underlying implementation of Validator. |
boolean |
validate(java.lang.Object object)
Validate a non-root object against a schema. |
boolean |
validateRoot(java.lang.Object rootObject)
Validate a root object against a schema. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JAXBValidator(XMLValidator newValidator)
newXMLMarshaller
- Method Detail |
---|
public boolean validateRoot(java.lang.Object rootObject) throws JAXBException
validateRoot
in interface Validator
rootObject
- - the root object to be validated
JAXBException
ValidationException
- If the ValidationEventHandler
returns false from its handleEvent method or the
Validator is unable to validate the content tree rooted
at rootObjpublic boolean validate(java.lang.Object object) throws JAXBException
validate
in interface Validator
object
- - the object to be validated
JAXBException
ValidationException
- If the ValidationEventHandler
returns false from its handleEvent method or the
Validator is unable to validate the content tree rooted
at subrootObjpublic void setEventHandler(ValidationEventHandler newValidationEventHandler) throws JAXBException
Validator
The validation event handler will be called by the JAXB Provider if any
validation errors are encountered during calls to
validate
. If the client application does not
register a validation event handler before invoking the validate method,
then validation events will be handled by the default event handler which
will terminate the validate operation after the first error or fatal error
is encountered.
Calling this method with a null parameter will cause the Validator to revert back to the default default event handler.
setEventHandler
in interface Validator
newValidationEventHandler
- the validation event handler
JAXBException
- if an error was encountered while setting the
event handlerpublic ValidationEventHandler getEventHandler() throws JAXBException
Validator
getEventHandler
in interface Validator
JAXBException
- if an error was encountered while getting the
current event handlerpublic void setProperty(java.lang.String key, java.lang.Object value) throws PropertyException
Validator
setProperty
in interface Validator
key
- the name of the property to be set. This value can either
be specified using one of the constant fields or a user
supplied string.value
- the value of the property to be set
PropertyException
- when there is an error processing the given
property or valuepublic java.lang.Object getProperty(java.lang.String key) throws PropertyException
Validator
getProperty
in interface Validator
key
- the name of the property to retrieve
PropertyException
- when there is an error retrieving the given property or value
property name
|
EclipseLink 2.1.2, build 'v20101206-r8635' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |