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

## org.apache.cayenne.xml
Class XMLDecoder

    java.lang.Object
      org.apache.cayenne.xml.XMLDecoder

Deprecated. since 3.1 this XML serialization package is deprecated and will be removed in the following releases. It has a number of functional and performance limitations that make it impossible to evolve further. A replacement may be provided in an undefined future. For now we recommend the users to implement XML serialization of persistent objects based JAXB, XStream or other similar frameworks.

    @Deprecated
    public class XMLDecoder

extends Object

XMLDecoder is used to decode XML into objects.

Since:
  1.2

Constructor Summary
`XMLDecoder()` Deprecated. Default constructor.
`XMLDecoder(ObjectContext objectContext)` Deprecated. Creates an XMLDecoder that will register decoded DataObjects with the specified context.

Method Summary
`Object` | `decode(Reader xml)` Deprecated. Decodes XML wrapped by a Reader into an object.
`Object` | `decode(Reader xml, String mappingUrl)` Deprecated. Decodes XML wrapped by a Reader into an object, using the supplied mapping file to guide the decoding process.
`Boolean` | `decodeBoolean(String xmlTag)` Deprecated. Decodes an XML element to a Boolean.
`protected Collection<Object>` | `decodeCollection(Element xml)` Deprecated. Decodes a Collection represented by XML wrapped by a Reader into a List of objects.
`Double` | `decodeDouble(String xmlTag)` Deprecated. Decodes an XML element to a Double.
`protected Object` | `decodeElement(Element element)` Deprecated. Decodes the XML element to an object.
`Float` | `decodeFloat(String xmlTag)` Deprecated. Decodes an XML element to a Float.
`Integer` | `decodeInteger(String xmlTag)` Deprecated. Decodes an XML element to an Integer.
`static List<Object>` | `decodeList(Reader xml)` Deprecated. Decodes a list of DataObjects.
`static List<Object>` | `decodeList(Reader xml, ObjectContext objectContext)` Deprecated. Decodes a list of DataObjects, registering them the supplied context.
`static List<Object>` | `decodeList(Reader xml, String mappingUrl)` Deprecated. Decodes a list of DataObjects using the supplied mapping file to guide the decoding process.
`static List<Object>` | `decodeList(Reader xml, String mappingUrl, ObjectContext objectContext)` Deprecated. Decodes a list of DataObjects using the supplied mapping file to guide the decoding process, registering them the supplied context.
`protected Object` | `decodeObject(Element child)` Deprecated. Decodes an XML element to an Object.
`Object` | `decodeObject(String xmlTag)` Deprecated. Decodes an object from XML.
`String` | `decodeString(String xmlTag)` Deprecated. Decodes an XML element to a String.

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

Constructor Detail

### XMLDecoder

    public XMLDecoder()

  Deprecated.
  Default constructor. This will create an XMLDecoder instance that will decode objects from XML, but will not register them with any context.

  See Also:
    `XMLDecoder(ObjectContext)`

### XMLDecoder

    public XMLDecoder(ObjectContext objectContext)

  Deprecated.
  Creates an XMLDecoder that will register decoded DataObjects with the specified context.

  Parameters:
    `objectContext` - The context to register decoded DataObjects with.

Method Detail

### decodeBoolean

    public Boolean decodeBoolean(String xmlTag)

  Deprecated.
  Decodes an XML element to a Boolean.

  Parameters:
    `xmlTag` - The tag identifying the element.
  Returns:
    The tag's value.

### decodeDouble

    public Double decodeDouble(String xmlTag)

  Deprecated.
  Decodes an XML element to a Double.

  Parameters:
    `xmlTag` - The tag identifying the element.
  Returns:
    The tag's value.

### decodeFloat

    public Float decodeFloat(String xmlTag)

  Deprecated.
  Decodes an XML element to a Float.

  Parameters:
    `xmlTag` - The tag identifying the element.
  Returns:
    The tag's value.

### decodeInteger

    public Integer decodeInteger(String xmlTag)

  Deprecated.
  Decodes an XML element to an Integer.

  Parameters:
    `xmlTag` - The tag identifying the element.
  Returns:
    The tag's value.

### decodeObject

    public Object decodeObject(String xmlTag)

  Deprecated.
  Decodes an object from XML.

  Parameters:
    `xmlTag` - The XML tag corresponding to the root of the encoded object.
  Returns:
    The decoded object.

### decodeObject

    protected Object decodeObject(Element child)

  Deprecated.
  Decodes an XML element to an Object.

  Parameters:
    `child` - The XML element.
  Returns:
    The tag's value.

### decodeString

    public String decodeString(String xmlTag)

  Deprecated.
  Decodes an XML element to a String.

  Parameters:
    `xmlTag` - The tag identifying the element.
  Returns:
    The tag's value.

### decode

    public Object decode(Reader xml)
                  throws CayenneRuntimeException

  Deprecated.
  Decodes XML wrapped by a Reader into an object.

  Parameters:
    `xml` - Wrapped XML.
  Returns:
    A new instance of the object represented by the XML.
  Throws:
    `CayenneRuntimeException`

### decode

    public Object decode(Reader xml,
                         String mappingUrl)
                  throws CayenneRuntimeException

  Deprecated.
  Decodes XML wrapped by a Reader into an object, using the supplied mapping file to guide the decoding process.

  Parameters:
    `xml` - Wrapped XML.
    `mappingUrl` - Mapping file describing how the XML elements and object properties correlate.
  Returns:
    A new instance of the object represented by the XML.
  Throws:
    `CayenneRuntimeException`

### decodeElement

    protected Object decodeElement(Element element)
                            throws CayenneRuntimeException

  Deprecated.
  Decodes the XML element to an object. If the supplied context is not null, the object will be registered with it and committed to the database.

  Parameters:
    `element` - The XML element.
  Returns:
    The decoded object.
  Throws:
    `CayenneRuntimeException`

### decodeCollection

    protected Collection<Object> decodeCollection(Element xml)
                                           throws CayenneRuntimeException

  Deprecated.
  Decodes a Collection represented by XML wrapped by a Reader into a List of objects. Each object will be registered with the supplied context.

  Parameters:
    `xml` - The XML element representing the elements in the collection to decode.
  Returns:
    A List of all the decoded objects.
  Throws:
    `CayenneRuntimeException`

### decodeList

    public static List<Object> decodeList(Reader xml)
                                   throws CayenneRuntimeException

  Deprecated.
  Decodes a list of DataObjects.

  Parameters:
    `xml` - The wrapped XML encoding of the list of DataObjects.
  Returns:
    The list of decoded DataObjects.
  Throws:
    `CayenneRuntimeException`

### decodeList

    public static List<Object> decodeList(Reader xml,
                                          ObjectContext objectContext)
                                   throws CayenneRuntimeException

  Deprecated.
  Decodes a list of DataObjects, registering them the supplied context.

  Parameters:
    `xml` - The wrapped XML encoding of the list of DataObjects.
    `objectContext` - The context to register the decode DataObjects with.
  Returns:
    The list of decoded DataObjects.
  Throws:
    `CayenneRuntimeException`

### decodeList

    public static List<Object> decodeList(Reader xml,
                                          String mappingUrl)
                                   throws CayenneRuntimeException

  Deprecated.
  Decodes a list of DataObjects using the supplied mapping file to guide the decoding process.

  Parameters:
    `xml` - The wrapped XML encoding of the list of DataObjects.
    `mappingUrl` - Mapping file describing how the XML elements and object properties correlate.
  Returns:
    The list of decoded DataObjects.
  Throws:
    `CayenneRuntimeException`

### decodeList

    public static List<Object> decodeList(Reader xml,
                                          String mappingUrl,
                                          ObjectContext objectContext)
                                   throws CayenneRuntimeException

  Deprecated.
  Decodes a list of DataObjects using the supplied mapping file to guide the decoding process, registering them the supplied context.

  Parameters:
    `xml` - The wrapped XML encoding of the list of objects.
    `mappingUrl` - Mapping file describing how the XML elements and object properties correlate.
    `objectContext` - The context to register the decode DataObjects with.
  Returns:
    The list of decoded DataObjects.
  Throws:
    `CayenneRuntimeException`

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 © 2001-2013 Apache Cayenne. All Rights Reserved.