org.apache.ws.jaxme.impl
Class JMValidatorImpl

java.lang.Object
  extended by org.apache.ws.jaxme.impl.JMControllerImpl
      extended by org.apache.ws.jaxme.impl.JMValidatorImpl
All Implemented Interfaces:
Validator, JMValidator

public class JMValidatorImpl
extends JMControllerImpl
implements JMValidator

Simple validator implementation. Works by creating a Marshaller, which generates SAX events. The SAX events are piped into an instance of UnmarshallerHandler.


Field Summary
 
Fields inherited from class org.apache.ws.jaxme.impl.JMControllerImpl
eventHandler, JAXME_DATATYPE_CONVERTER, JAXME_FORMAT_DATE, JAXME_FORMAT_DATETIME, JAXME_FORMAT_TIME, JAXME_PRIVATE
 
Constructor Summary
JMValidatorImpl()
           
 
Method Summary
 boolean validate(java.lang.Object pObject)
          Validates the given JAXB object, invoking its error handler for any problems it detects.
 boolean validateRoot(java.lang.Object pObject)
          Validates the given JAXB object, but not its child elements.
 
Methods inherited from class org.apache.ws.jaxme.impl.JMControllerImpl
getDatatypeConverter, getDateFormat, getDateTimeFormat, getEventHandler, getJAXBContextImpl, getProperty, getTimeFormat, setDatatypeConverter, setDateFormat, setDateTimeFormat, setEventHandler, setJAXBContextImpl, setProperty, setTimeFormat
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.ws.jaxme.JMValidator
getJAXBContextImpl, setJAXBContextImpl
 
Methods inherited from interface javax.xml.bind.Validator
getEventHandler, getProperty, setEventHandler, setProperty
 

Constructor Detail

JMValidatorImpl

public JMValidatorImpl()
Method Detail

validate

public boolean validate(java.lang.Object pObject)
                 throws JAXBException
Description copied from interface: Validator

Validates the given JAXB object, invoking its error handler for any problems it detects. Detected problems may cause exceptions, for example, if the event handlers ValidationEventHandler.handleEvent(ValidationEvent) method returns false.

Specified by:
validate in interface Validator
Parameters:
pObject - The JAXB object being validated.
Throws:
JAXBException - An unexpected problem occurred during validation
ValidationException - It was detected, that the object is invalid.
See Also:
Validator.validateRoot(Object)

validateRoot

public boolean validateRoot(java.lang.Object pObject)
                     throws JAXBException
Description copied from interface: Validator

Validates the given JAXB object, but not its child elements.

Specified by:
validateRoot in interface Validator
Parameters:
pObject - The JAXB object being validated.
Throws:
JAXBException - An unexpected problem occurred during validation
ValidationException - It was detected, that the object is invalid.
See Also:
Validator.validate(Object)