|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opennms.netmgt.dao.castor.CastorUtils
public class CastorUtils
Utility class for Castor configuration files.
| Method Summary | ||
|---|---|---|
static void |
marshalViaString(Object config,
File cfgFile)
Marshall to a string first, then write the string to the file. |
|
static void |
marshalWithTranslatedExceptions(Object obj,
Writer writer)
Marshal a Castor XML configuration file. |
|
static
|
unmarshal(Class<T> clazz,
Reader reader)
Unmarshal a Castor XML configuration file. |
|
static
|
unmarshalWithTranslatedExceptions(Class<T> clazz,
Reader reader)
Unmarshal a Castor XML configuration file. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void marshalWithTranslatedExceptions(Object obj,
Writer writer)
throws org.springframework.dao.DataAccessException
obj - the object representing the objected to be marshalled to XMLwriter - where the marshalled XML will be written
org.springframework.dao.DataAccessException - if the underlying Castor
Marshaller.marshal() call throws a MarshalException or
ValidationException. The underlying exception will be translated
using CastorExceptionTranslator.
public static <T> T unmarshal(Class<T> clazz,
Reader reader)
throws org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
T - the class representing the marshalled XML configuration
file. This will be the return time form the method.clazz - the class representing the marshalled XML configuration
filereader - the marshalled XML configuration file to unmarshal
org.exolab.castor.xml.MarshalException - if the underlying Castor
Unmarshaller.unmarshal() call throws a MarshalException
org.exolab.castor.xml.ValidationException - if the underlying Castor
Unmarshaller.unmarshal() call throws a ValidationException
public static <T> T unmarshalWithTranslatedExceptions(Class<T> clazz,
Reader reader)
throws org.springframework.dao.DataAccessException
T - the class representing the marshalled XML configuration
file. This will be the return time form the method.clazz - the class representing the marshalled XML configuration
filereader - the marshalled XML configuration file to unmarshal
org.springframework.dao.DataAccessException - if the underlying Castor
Unmarshaller.unmarshal() call throws a MarshalException or
ValidationException. The underlying exception will be translated
using CastorExceptionTranslator.
public static void marshalViaString(Object config,
File cfgFile)
throws org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException,
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||