org.eclipse.persistence.jaxb
Class JAXBValidator

java.lang.Object
  extended by org.eclipse.persistence.jaxb.JAXBValidator
All Implemented Interfaces:
Validator

public class JAXBValidator
extends Object
implements Validator

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()
           
 Object getProperty(String key)
           
 void setEventHandler(ValidationEventHandler newValidationEventHandler)
           
 void setProperty(String key, Object value)
           
 boolean validate(Object object)
          Validate a non-root object against a schema.
 boolean validateRoot(Object rootObject)
          Validate a root object against a schema.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JAXBValidator

public JAXBValidator(XMLValidator newValidator)
This constructor creates a DefaultValidationEventHandlervalidation instance, and sets the XMLMarshaller instance to the one provided.

Parameters:
newXMLMarshaller -
Method Detail

validateRoot

public boolean validateRoot(Object rootObject)
                     throws JAXBException
Validate a root object against a schema.

Specified by:
validateRoot in interface Validator
Parameters:
rootObject - - the root object to be validated
Returns:
true if a valid root object, false otherwise
Throws:
JAXBException

validate

public boolean validate(Object object)
                 throws JAXBException
Validate a non-root object against a schema.

Specified by:
validate in interface Validator
Parameters:
object - - the object to be validated
Returns:
true if a valid object, false otherwise
Throws:
JAXBException

setEventHandler

public void setEventHandler(ValidationEventHandler newValidationEventHandler)
                     throws JAXBException
Specified by:
setEventHandler in interface Validator
Throws:
JAXBException

getEventHandler

public ValidationEventHandler getEventHandler()
                                       throws JAXBException
Specified by:
getEventHandler in interface Validator
Throws:
JAXBException

setProperty

public void setProperty(String key,
                        Object value)
                 throws PropertyException
Specified by:
setProperty in interface Validator
Throws:
PropertyException

getProperty

public Object getProperty(String key)
                   throws PropertyException
Specified by:
getProperty in interface Validator
Throws:
PropertyException