Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.thoughtworks.xstream.converters
Class ConversionException

    java.lang.Object
      java.lang.Throwable
          java.lang.Exception
              java.lang.RuntimeException
                  com.thoughtworks.xstream.core.BaseException
                      com.thoughtworks.xstream.XStreamException
                          com.thoughtworks.xstream.converters.ConversionException

All Implemented Interfaces:
  ErrorWriter, Serializable

Direct Known Subclasses:
  AbstractReflectionConverter.DuplicateFieldException, JavaBeanConverter.DuplicateFieldException

    public class ConversionException

extends XStreamException
implements ErrorWriter

Thrown by `Converter` implementations when they cannot convert an object to/from textual data. When this exception is thrown it can be passed around to things that accept an `ErrorWriter`, allowing them to add diagnostics to the stack trace.

Author:
  Joe Walnes, Jörg Schaible
See Also:
  `ErrorWriter`, Serialized Form

Constructor Summary
`ConversionException(String msg)`
`ConversionException(String msg, Throwable cause)`
`ConversionException(Throwable cause)`

Method Summary
`void` | `add(String name, String information)` Add some information to the error message.
`String` | `get(String errorKey)` Retrieve information of the error message.
`String` | `getMessage()`
`String` | `getShortMessage()`
`Iterator` | `keys()` Retrieve an iterator over all keys of the error message.

Methods inherited from class com.thoughtworks.xstream.XStreamException
`getCause`

Methods inherited from class java.lang.Throwable
`fillInStackTrace, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### ConversionException

    public ConversionException(String msg,
                               Throwable cause)

### ConversionException

    public ConversionException(String msg)

### ConversionException

    public ConversionException(Throwable cause)

Method Detail

### get

    public String get(String errorKey)

  Description copied from interface: `ErrorWriter`
  Retrieve information of the error message.

  Specified by:
    `get` in interface `ErrorWriter`
  Parameters:
    `errorKey` - the key of the message
  Returns:
    the value

### add

    public void add(String name,
                    String information)

  Description copied from interface: `ErrorWriter`
  Add some information to the error message.

  Specified by:
    `add` in interface `ErrorWriter`
  Parameters:
    `name` - something to identify the type of information (e.g. 'XPath').
    `information` - detail of the message (e.g. '/blah/moo[3]'

### keys

    public Iterator keys()

  Description copied from interface: `ErrorWriter`
  Retrieve an iterator over all keys of the error message.

  Specified by:
    `keys` in interface `ErrorWriter`
  Returns:
    an Iterator

### getMessage

    public String getMessage()

  Overrides:
    `getMessage` in class `Throwable`

### getShortMessage

    public String getShortMessage()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2008 XStream. All Rights Reserved.