net.sf.jour.rt.view.config.impl.runtime
Class ValidationContext

java.lang.Object
  extended bynet.sf.jour.rt.view.config.impl.runtime.ValidationContext

class ValidationContext
extends java.lang.Object

Maintains information that needs to be stored across validations of multiple objects. Specifically, this object is responsible for:

  1. detecting a cycle in a content tree by keeping track of objects that were validated.
  2. keeping an instance of NamespaceContextImpl, which is shared by all MSVValidators.
  3. keeping a reference to ValidationErrorHandler. MSVValidators should use this error handler to report any error.


Field Summary
(package private)  DefaultJAXBContextImpl jaxbContext
           
 
Constructor Summary
(package private) ValidationContext(DefaultJAXBContextImpl _context, javax.xml.bind.ValidationEventHandler _eventHandler, boolean validateID)
           
 
Method Summary
 NamespaceContextImpl getNamespaceContext()
           
 java.lang.String onID(XMLSerializable owner, java.lang.String value)
           
 java.lang.String onIDREF(XMLSerializable referer, java.lang.String value)
           
protected  void reconcileIDs()
          Tests if all IDREFs have corresponding IDs.
 void reportEvent(ValidatableObject source, java.lang.Exception nestedException)
          Reports an error to the client.
 void reportEvent(ValidatableObject source, java.lang.String formattedMessage)
          Reports an error to the application.
 void reportEvent(ValidatableObject source, javax.xml.bind.ValidationEvent event)
           
 void validate(ValidatableObject vo)
          Validates the sub-tree rooted at vo and reports any errors/warnings to the error handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jaxbContext

final DefaultJAXBContextImpl jaxbContext
Constructor Detail

ValidationContext

ValidationContext(DefaultJAXBContextImpl _context,
                  javax.xml.bind.ValidationEventHandler _eventHandler,
                  boolean validateID)
Parameters:
validateID - if true, ID/IDREF validation will be performed.
Method Detail

validate

public void validate(ValidatableObject vo)
              throws org.xml.sax.SAXException
Validates the sub-tree rooted at vo and reports any errors/warnings to the error handler.

Throws:
org.xml.sax.SAXException

getNamespaceContext

public NamespaceContextImpl getNamespaceContext()

onID

public java.lang.String onID(XMLSerializable owner,
                             java.lang.String value)
                      throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

onIDREF

public java.lang.String onIDREF(XMLSerializable referer,
                                java.lang.String value)
                         throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

reconcileIDs

protected void reconcileIDs()
                     throws org.xml.sax.SAXException
Tests if all IDREFs have corresponding IDs.

Throws:
org.xml.sax.SAXException

reportEvent

public void reportEvent(ValidatableObject source,
                        java.lang.String formattedMessage)
                 throws com.sun.xml.bind.serializer.AbortSerializationException
Reports an error to the application.

Throws:
com.sun.xml.bind.serializer.AbortSerializationException

reportEvent

public void reportEvent(ValidatableObject source,
                        java.lang.Exception nestedException)
                 throws com.sun.xml.bind.serializer.AbortSerializationException
Reports an error to the client. This version should be used when an exception is thrown from sub-modules.

Throws:
com.sun.xml.bind.serializer.AbortSerializationException

reportEvent

public void reportEvent(ValidatableObject source,
                        javax.xml.bind.ValidationEvent event)
                 throws com.sun.xml.bind.serializer.AbortSerializationException
Throws:
com.sun.xml.bind.serializer.AbortSerializationException


Copyright © 2004 sourceforge. All Rights Reserved.