protected static class

XmlWriter.Element

extends Object
java.lang.Object
   ↳ com.google.gdata.util.common.xml.XmlWriter.Element

Class Overview

The Element class contains information about an XML element. Used to keep track of namespace alias/URI mappings. This class may be subclassed by XmlWriter subclasses that want to track additional information about output elements. The createElement(String, String, String) method can be overridden to instantiate a specialized Element subclass.

Summary

Constants
int NOT_REPEATING Sentinel value used for repeating elements.
Fields
public String enclosingDefaultNamespace The default namespace uri that will be active after closure of this element.
public boolean hasAttributes True if the element has attributes.
public final String name Local name of the element.
public String nsAlias Namespace prefix for the element.
public List<XmlNamespace> nsDecls Namespace declarations associated with this element.
public final String nsUri Full namespace uri for the element.
public boolean openTagEnded Set to false if the closing bracket of the element's start tag has been written (i.e.
public int repeatingCount Indicates the number of repeating child elements written within the scope of the current startRepeatingElement() / endRepeatingElement() pair for this element.
public int repeatingIndex If an element is a part of a series of repeating element within its parent, this will contain the zero-based index of the child, else the value will be NOT_REPEATING.
public boolean unformattedChildren True if this element contains unformatted children (text nodes, raw blobs of XML, or unescaped strings.
public String xmlLang xml:lang attribute of the element.
Protected Constructors
XmlWriter.Element(String nsAlias, String nsUri, String name)
Constructs an element.
Public Methods
void addNamespace(XmlNamespace ns)
Adds a namespace declaration to the element, avoiding duplicates.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int NOT_REPEATING

Sentinel value used for repeating elements.

Constant Value: -1 (0xffffffff)

Fields

public String enclosingDefaultNamespace

The default namespace uri that will be active after closure of this element. If null, indicates that the default namespace for the enclosing scope is the same as for the element scope.

public boolean hasAttributes

True if the element has attributes.

public final String name

Local name of the element.

public String nsAlias

Namespace prefix for the element.

public List<XmlNamespace> nsDecls

Namespace declarations associated with this element.

public final String nsUri

Full namespace uri for the element.

public boolean openTagEnded

Set to false if the closing bracket of the element's start tag has been written (i.e. if writeOpenTagEnd() has been called yet). Used to optimized elements that have no nested content or children.

public int repeatingCount

Indicates the number of repeating child elements written within the scope of the current startRepeatingElement() / endRepeatingElement() pair for this element. The value will be NOT_REPEATING if not currently writing repeating elements.

public int repeatingIndex

If an element is a part of a series of repeating element within its parent, this will contain the zero-based index of the child, else the value will be NOT_REPEATING.

public boolean unformattedChildren

True if this element contains unformatted children (text nodes, raw blobs of XML, or unescaped strings.

public String xmlLang

xml:lang attribute of the element.

Protected Constructors

protected XmlWriter.Element (String nsAlias, String nsUri, String name)

Constructs an element. This constructor should never be directly called, always use the createElement(String, String, String) method to create new elements.

Parameters
nsAlias
nsUri
name

Public Methods

public void addNamespace (XmlNamespace ns)

Adds a namespace declaration to the element, avoiding duplicates.

Parameters
ns