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 XMLEncoder

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

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.

    public class XMLEncoder

extends java.lang.Object

A helper class to encode objects to XML.

Since:
  1.2

Constructor Summary
`XMLEncoder()` Deprecated. Creates new XMLEncoder.
`XMLEncoder(java.lang.String mappingUrl)` Deprecated. Creates new XMLEncoder that will use a mapping descriptor loaded via provided URL.

Method Summary
`java.lang.String` | `encode(java.lang.Object object)` Deprecated. Encodes an object using "root" as a root tag.
`java.lang.String` | `encode(java.lang.String rootTag, java.lang.Object object)` Deprecated. Encodes using provided root XML tag.
`protected void` | `encodeCollection(java.lang.String xmlTag, java.util.Collection<java.lang.Object> c, boolean useType)` Deprecated. Encodes a collection of objects, attaching them to the current root.
`void` | `encodeProperty(java.lang.String xmlTag, java.lang.Object value)` Deprecated. A callback method for XMLSerializable objects to encode an object property.
`protected void` | `encodeProperty(java.lang.String xmlTag, java.lang.Object value, boolean useType)` Deprecated.
`protected void` | `encodeSerializable(java.lang.String xmlTag, XMLSerializable object)` Deprecated.
`protected void` | `encodeSimple(java.lang.String xmlTag, java.lang.Object object, boolean useType)` Deprecated.
`protected org.w3c.dom.Node` | `getRootNode(boolean forceSyntheticRoot)` Deprecated. Returns a root DOM node of the encoder.
`protected void` | `initDocument(java.lang.String rootTag, java.lang.String type)` Deprecated. Resets the encoder to process a new object tree.
`protected java.lang.String` | `nodeToString(org.w3c.dom.Node rootNode)` Deprecated.
`void` | `setRoot(java.lang.String xmlTag, java.lang.String type)` Deprecated. A callback for XMLSerializable objects to add a node to an encoding tree.
`protected void` | `setRoot(java.lang.String xmlTag, java.lang.String type, boolean push)` Deprecated.

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

Constructor Detail

### XMLEncoder

    public XMLEncoder()

  Deprecated.
  Creates new XMLEncoder.

### XMLEncoder

    public XMLEncoder(java.lang.String mappingUrl)

  Deprecated.
  Creates new XMLEncoder that will use a mapping descriptor loaded via provided URL.

Method Detail

### setRoot

    public void setRoot(java.lang.String xmlTag,
                        java.lang.String type)

  Deprecated.
  A callback for XMLSerializable objects to add a node to an encoding tree.

### encodeProperty

    public void encodeProperty(java.lang.String xmlTag,
                               java.lang.Object value)

  Deprecated.
  A callback method for XMLSerializable objects to encode an object property. Note that the object must call "setRoot" prior to encoding its properties.

  Parameters:
    `xmlTag` - The name of the XML element used to represent the property.
    `value` - The object's property value to encode.

### encode

    public java.lang.String encode(java.lang.Object object)
                            throws CayenneRuntimeException

  Deprecated.
  Encodes an object using "root" as a root tag.

  Throws:
    `CayenneRuntimeException`

### encode

    public java.lang.String encode(java.lang.String rootTag,
                                   java.lang.Object object)
                            throws CayenneRuntimeException

  Deprecated.
  Encodes using provided root XML tag.

  Throws:
    `CayenneRuntimeException`

### initDocument

    protected void initDocument(java.lang.String rootTag,
                                java.lang.String type)

  Deprecated.
  Resets the encoder to process a new object tree.

### getRootNode

    protected org.w3c.dom.Node getRootNode(boolean forceSyntheticRoot)

  Deprecated.
  Returns a root DOM node of the encoder.

### nodeToString

    protected java.lang.String nodeToString(org.w3c.dom.Node rootNode)

  Deprecated.

### setRoot

    protected void setRoot(java.lang.String xmlTag,
                           java.lang.String type,
                           boolean push)

  Deprecated.

### encodeProperty

    protected void encodeProperty(java.lang.String xmlTag,
                                  java.lang.Object value,
                                  boolean useType)

  Deprecated.

### encodeSimple

    protected void encodeSimple(java.lang.String xmlTag,
                                java.lang.Object object,
                                boolean useType)

  Deprecated.

### encodeSerializable

    protected void encodeSerializable(java.lang.String xmlTag,
                                      XMLSerializable object)

  Deprecated.

### encodeCollection

    protected void encodeCollection(java.lang.String xmlTag,
                                    java.util.Collection<java.lang.Object> c,
                                    boolean useType)

  Deprecated.
  Encodes a collection of objects, attaching them to the current root.

  Parameters:
    `xmlTag` - The name of the root XML element for the encoded collection.
    `c` - The collection to encode.

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-2011 Apache Cayenne. All Rights Reserved.