patterntesting.exception.xml
Class SAXHelper

java.lang.Object
  extended by patterntesting.exception.xml.SAXHelper

public final class SAXHelper
extends Object

The class SAXHelper was introduced to be able to provide better SAXExceptions.

Since:
17.12.2008
Version:
$Revision: 1.4 $
Author:
oliver

Field Summary
static String DRIVER_PROPERTY
          The Constant DRIVER_PROPERTY.
static String DRIVER_RESOURCE
          The Constant DRIVER_RESOURCE.
 
Constructor Summary
SAXHelper()
           
 
Method Summary
static SAXException betterSAXException(SAXException saxe)
          Transforms a SAXException with too less infos into a better SAXException with more infos.
static SAXException betterSAXException(SAXException saxe, String newMessage)
          Better sax exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DRIVER_PROPERTY

public static final String DRIVER_PROPERTY
The Constant DRIVER_PROPERTY.

See Also:
Constant Field Values

DRIVER_RESOURCE

public static final String DRIVER_RESOURCE
The Constant DRIVER_RESOURCE.

See Also:
Constant Field Values
Constructor Detail

SAXHelper

public SAXHelper()
Method Detail

betterSAXException

public static SAXException betterSAXException(SAXException saxe)
Transforms a SAXException with too less infos into a better SAXException with more infos.
NOTE: Amonst other things the system property "org.xml.sax.driver" are used to get a better exception. Normally this should be synchronized because other threads may changes this system property so that this method may misinterpret this property. But it is very unlikely (except for testing) that this happen. So no synchronization is done to avoid blocked threads. So in some very, very rare circumstances the "better SAXException" may be perhaps confuses you (or the tester ;-).

Parameters:
saxe - the saxe
Returns:
the sAX exception

betterSAXException

public static SAXException betterSAXException(SAXException saxe,
                                              String newMessage)
Better sax exception.

Parameters:
saxe - the saxe
newMessage - the new message
Returns:
the sAX exception


Copyright © 2009-2010 PatternTesting Team. All Rights Reserved.