public class

ExtensionDescription

extends ExtensionPoint
implements Comparable<T>
java.lang.Object
   ↳ com.google.gdata.data.AbstractExtension
     ↳ com.google.gdata.data.ExtensionPoint
       ↳ com.google.gdata.data.ExtensionDescription

Class Overview

The ExtensionDescription class describes the attributes of an XML extension type. This description can be declared within an ExtensionProfile to indicate that the extension is expected within a particular ExtensionPoint.

Summary

Nested Classes
@interface ExtensionDescription.Default The Default interface defines a simple annotation model for describing the default ExtensionDescription of an Extension class. 
class ExtensionDescription.Handler Reads the ExtensionDescription XML format  
Fields
private boolean aggregate Specifies whether the extension type aggregates the contents of multiple elements within its parent.
private boolean arbitraryXml Specifies whether the extension type allows arbitrary xml children.
private Class<? extends Extension> extensionClass The Extension class used to parse and generate the extension type
private String localName Local name of the XML extension type.
private boolean mixedContent If the extension type allows arbitrary xml, specifies whether the extension allows mixed content.
private XmlNamespace namespace The namespace of the XML extension type.
private boolean repeatable Specifies whether the extension type can be repeated within its parent extension point.
private boolean required Specifies whether the extension is required within its parent extension point.
[Expand]
Inherited Fields
From class com.google.gdata.data.ExtensionPoint
From class com.google.gdata.data.AbstractExtension
Public Constructors
ExtensionDescription()
Constructs an uninitialized ExtensionDescription.
ExtensionDescription(Class<? extends Extension> extensionClass, XmlNamespace namespace, String localName, boolean required, boolean repeatable, boolean aggregate)
Constructs a new ExtensionDescription populated with the parameter values.
ExtensionDescription(Class<? extends Extension> extensionClass, XmlNamespace namespace, String localName, boolean required, boolean repeatable, boolean aggregate, boolean arbitraryXml, boolean mixedContent)
Constructs a new ExtensionDescription populated with the parameter values.
ExtensionDescription(Class<? extends Extension> extensionClass, XmlNamespace namespace, String localName)
Constructs a new ExtensionDescription for an optional, non-repeating simple element.
Public Methods
final boolean allowsArbitraryXml()
final boolean allowsMixedContent()
int compareTo(ExtensionDescription desc)
Defines a natural ordering for ExtensionDescription based upon the qualified name of the mapped XML element.
void generateConfig(XmlWriter w, ExtensionProfile extProfile)
Generates XML in the external config format.
static ExtensionDescription getDefaultDescription(Class<? extends Extension> extensionClass)
Returns the default ExtensionDescription for the specified Extension class.
final Class<? extends Extension> getExtensionClass()
final String getLocalName()
final XmlNamespace getNamespace()
final boolean isAggregate()
final boolean isRepeatable()
final boolean isRequired()
void setAggregate(boolean aggregate)
void setArbitraryXml(boolean arbitraryXml)
void setExtensionClass(Class<? extends Extension> extensionClass)
void setLocalName(String localName)
void setMixedContent(boolean mixedContent)
void setNamespace(XmlNamespace namespace)
void setRepeatable(boolean repeatable)
void setRequired(boolean required)
[Expand]
Inherited Methods
From class com.google.gdata.data.ExtensionPoint
From class com.google.gdata.data.AbstractExtension
From class java.lang.Object
From interface com.google.gdata.data.Extension
From interface java.lang.Comparable

Fields

private boolean aggregate

Specifies whether the extension type aggregates the contents of multiple elements within its parent.

private boolean arbitraryXml

Specifies whether the extension type allows arbitrary xml children.

private Class<? extends Extension> extensionClass

The Extension class used to parse and generate the extension type

private String localName

Local name of the XML extension type. A value of '*' indicates that all elements in the namespace will be handled by the Extension class.

private boolean mixedContent

If the extension type allows arbitrary xml, specifies whether the extension allows mixed content. If the extension type does not permit arbitrary xml, then mixed content is meaningless.

private XmlNamespace namespace

The namespace of the XML extension type.

private boolean repeatable

Specifies whether the extension type can be repeated within its parent extension point.

private boolean required

Specifies whether the extension is required within its parent extension point.

Public Constructors

public ExtensionDescription ()

Constructs an uninitialized ExtensionDescription.

public ExtensionDescription (Class<? extends Extension> extensionClass, XmlNamespace namespace, String localName, boolean required, boolean repeatable, boolean aggregate)

Constructs a new ExtensionDescription populated with the parameter values.

Parameters
extensionClass
namespace
localName
required
repeatable
aggregate

public ExtensionDescription (Class<? extends Extension> extensionClass, XmlNamespace namespace, String localName, boolean required, boolean repeatable, boolean aggregate, boolean arbitraryXml, boolean mixedContent)

Constructs a new ExtensionDescription populated with the parameter values.

Parameters
extensionClass
namespace
localName
required
repeatable
aggregate
arbitraryXml
mixedContent

public ExtensionDescription (Class<? extends Extension> extensionClass, XmlNamespace namespace, String localName)

Constructs a new ExtensionDescription for an optional, non-repeating simple element.

Parameters
extensionClass
namespace
localName

Public Methods

public final boolean allowsArbitraryXml ()

public final boolean allowsMixedContent ()

public int compareTo (ExtensionDescription desc)

Defines a natural ordering for ExtensionDescription based upon the qualified name of the mapped XML element. Elements with no namespace are considered to precede all others.

Parameters
desc

public void generateConfig (XmlWriter w, ExtensionProfile extProfile)

Generates XML in the external config format.

Parameters
w Output writer.
extProfile Extension profile.
Throws
IOException

public static ExtensionDescription getDefaultDescription (Class<? extends Extension> extensionClass)

Returns the default ExtensionDescription for the specified Extension class.

Parameters
extensionClass The target extension class.
Returns
  • default description for the target extension class.
Throws
IllegalArgumentException if a default description could not be fourn for the extension class.

public final Class<? extends Extension> getExtensionClass ()

public final String getLocalName ()

public final XmlNamespace getNamespace ()

public final boolean isAggregate ()

public final boolean isRepeatable ()

public final boolean isRequired ()

public void setAggregate (boolean aggregate)

Parameters
aggregate

public void setArbitraryXml (boolean arbitraryXml)

Parameters
arbitraryXml

public void setExtensionClass (Class<? extends Extension> extensionClass)

Parameters
extensionClass

public void setLocalName (String localName)

Parameters
localName

public void setMixedContent (boolean mixedContent)

Parameters
mixedContent

public void setNamespace (XmlNamespace namespace)

Parameters
namespace

public void setRepeatable (boolean repeatable)

Parameters
repeatable

public void setRequired (boolean required)

Parameters
required