Overview | Package | Class | Tree | Deprecated | Index | Help
| J avolution v5.2 (J2SE 1.5+)
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javolution.xml
Class XMLFormat.OutputElement

    java.lang.Object
      javolution.xml.XMLFormat.OutputElement

Enclosing class:
  XMLFormat<T>

    public static final class XMLFormat.OutputElement

extends java.lang.Object

This class represents an output XML element (marshalling).

Method Summary
`void` | `add(java.lang.Object obj)` Adds the specified object or `null` as an anonymous nested element of unknown type.
`void` | `add(java.lang.Object obj, java.lang.String name)` Adds the specified object as a named nested element of unknown type (`null` objects are ignored).
`void` | `add(java.lang.Object obj, java.lang.String localName, java.lang.String uri)` Adds the specified object as a fully qualified nested element of unknown type (`null` objects are ignored).
`
`<T> void`
` | `add(T obj, java.lang.String name, java.lang.Class<T> cls)` Adds the specified object as a named nested element of specified actual type (`null` objects are ignored).
`
`<T> void`
` | `add(T obj, java.lang.String localName, java.lang.String uri, java.lang.Class<T> cls)` Adds the specified object as a fully qualified nested element of specified actual type (`null` objects are ignored).
`void` | `addText(java.lang.CharSequence text)` Adds the content of a text-only element (equivalent to `getStreamWriter().writeCharacters(text)`).
`void` | `addText(java.lang.String text)` Equivalent to `addText(CharSequence)` (for J2ME compatibility).
`XMLStreamWriter` | `getStreamWriter()` Returns the StAX-like stream writer (provides complete control over the marshalling process).
`void` | `setAttribute(java.lang.String name, boolean value)` Sets the specified `boolean` attribute.
`void` | `setAttribute(java.lang.String name, char value)` Sets the specified `char` attribute.
`void` | `setAttribute(java.lang.String name, java.lang.CharSequence value)` Sets the specified `CharSequence` attribute (`null` values are ignored).
`void` | `setAttribute(java.lang.String name, double value)` Sets the specified `double` attribute.
`void` | `setAttribute(java.lang.String name, float value)` Sets the specified `float` attribute.
`void` | `setAttribute(java.lang.String name, int value)` Sets the specified `int` attribute.
`void` | `setAttribute(java.lang.String name, long value)` Sets the specified `long` attribute.
`void` | `setAttribute(java.lang.String name, java.lang.Object value)` Sets the specified attribute using its associated `TextFormat`.
`void` | `setAttribute(java.lang.String name, java.lang.String value)` Sets the specified `String` attribute (`null` values are ignored).

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

Method Detail

### getStreamWriter

    public XMLStreamWriter getStreamWriter()

  Returns the StAX-like stream writer (provides complete control over the marshalling process).

  Returns:
    the stream writer.

### add

    public void add(java.lang.Object obj)
             throws XMLStreamException

  Adds the specified object or `null` as an anonymous nested element of unknown type.

  Parameters:
    `obj` - the object added as nested element or `null`.
  Throws:
    `XMLStreamException`

### add

    public void add(java.lang.Object obj,
                    java.lang.String name)
             throws XMLStreamException

  Adds the specified object as a named nested element of unknown type (`null` objects are ignored). The nested XML element contains a class attribute identifying the object type.

  Parameters:
    `obj` - the object added as nested element or `null`.
    `name` - the name of the nested element.
  Throws:
    `XMLStreamException`

### add

    public void add(java.lang.Object obj,
                    java.lang.String localName,
                    java.lang.String uri)
             throws XMLStreamException

  Adds the specified object as a fully qualified nested element of unknown type (`null` objects are ignored). The nested XML element contains a class attribute identifying the object type.

  Parameters:
    `obj` - the object added as nested element or `null`.
    `localName` - the local name of the nested element.
    `uri` - the namespace URI of the nested element.
  Throws:
    `XMLStreamException`

### add

    public <T> void add(T obj,
                        java.lang.String name,
                        java.lang.Class<T> cls)
             throws XMLStreamException

  Adds the specified object as a named nested element of specified actual type (`null` objects are ignored). The nested XML element does not contain any class attribute.

  Parameters:
    `obj` - the object added as nested element or `null`.
    `name` - the name of the nested element.
    `cls` - the class identifying the format of the specified object.
  Throws:
    `XMLStreamException`

### add

    public <T> void add(T obj,
                        java.lang.String localName,
                        java.lang.String uri,
                        java.lang.Class<T> cls)
             throws XMLStreamException

  Adds the specified object as a fully qualified nested element of specified actual type (`null` objects are ignored). The nested XML element does not contain any class attribute.

  Parameters:
    `obj` - the object added as nested element or `null`.
    `localName` - the local name of the nested element.
    `uri` - the namespace URI of the nested element.
    `cls` - the class identifying the format of the specified object.
  Throws:
    `XMLStreamException`

### addText

    public void addText(java.lang.CharSequence text)
                 throws XMLStreamException

  Adds the content of a text-only element (equivalent to `getStreamWriter().writeCharacters(text)`).

  Parameters:
    `text` - the element text content or an empty sequence if none.
  Throws:
    `XMLStreamException`

### addText

    public void addText(java.lang.String text)
                 throws XMLStreamException

  Equivalent to `addText(CharSequence)` (for J2ME compatibility).

  Parameters:
    `text` - the element text content or an empty sequence if none.
  Throws:
    `XMLStreamException`

### setAttribute

    public void setAttribute(java.lang.String name,
                             java.lang.CharSequence value)
                      throws XMLStreamException

  Sets the specified `CharSequence` attribute (`null` values are ignored).

  Parameters:
    `name` - the attribute name.
    `value` - the attribute value or `null`.
  Throws:
    `XMLStreamException`

### setAttribute

    public void setAttribute(java.lang.String name,
                             java.lang.String value)
                      throws XMLStreamException

  Sets the specified `String` attribute (`null` values are ignored).

  Parameters:
    `name` - the attribute name.
    `value` - the attribute value.
  Throws:
    `XMLStreamException`

### setAttribute

    public void setAttribute(java.lang.String name,
                             boolean value)
                      throws XMLStreamException

  Sets the specified `boolean` attribute.

  Parameters:
    `name` - the attribute name.
    `value` - the `boolean` value for the specified attribute.
  Throws:
    `XMLStreamException`

### setAttribute

    public void setAttribute(java.lang.String name,
                             char value)
                      throws XMLStreamException

  Sets the specified `char` attribute.

  Parameters:
    `name` - the attribute name.
    `value` - the `char` value for the specified attribute.
  Throws:
    `XMLStreamException`

### setAttribute

    public void setAttribute(java.lang.String name,
                             int value)
                      throws XMLStreamException

  Sets the specified `int` attribute.

  Parameters:
    `name` - the attribute name.
    `value` - the `int` value for the specified attribute.
  Throws:
    `XMLStreamException`

### setAttribute

    public void setAttribute(java.lang.String name,
                             long value)
                      throws XMLStreamException

  Sets the specified `long` attribute.

  Parameters:
    `name` - the attribute name.
    `value` - the `long` value for the specified attribute.
  Throws:
    `XMLStreamException`

### setAttribute

    public void setAttribute(java.lang.String name,
                             float value)
                      throws XMLStreamException

  Sets the specified `float` attribute.

  Parameters:
    `name` - the attribute name.
    `value` - the `float` value for the specified attribute. /
  Throws:
    `XMLStreamException`

### setAttribute

    public void setAttribute(java.lang.String name,
                             double value)
                      throws XMLStreamException

  Sets the specified `double` attribute.

  Parameters:
    `name` - the attribute name.
    `value` - the `double` value for the specified attribute. /
  Throws:
    `XMLStreamException`

### setAttribute

    public void setAttribute(java.lang.String name,
                             java.lang.Object value)
                      throws XMLStreamException

  Sets the specified attribute using its associated `TextFormat`.

  Parameters:
    `name` - the name of the attribute.
    `value` - the `Boolean` value for the specified attribute or `null` in which case the attribute is not set.
  Throws:
    `XMLStreamException`

Overview | Package | Class | Tree | Deprecated | Index | Help
| J avolution v5.2 (J2SE 1.5+)
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005 - 2007 Javolution.