Google Data APIs Client Library (1.41.1)



com.google.gdata.data
Class ExtensionDescription

java.lang.Object
  extended by com.google.gdata.data.AbstractExtension
      extended by com.google.gdata.data.ExtensionPoint
          extended by com.google.gdata.data.ExtensionDescription
All Implemented Interfaces:
Extension, java.lang.Comparable<ExtensionDescription>

public class ExtensionDescription
extends ExtensionPoint
implements java.lang.Comparable<ExtensionDescription>

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.

See Also:
ExtensionProfile.declare(Class, ExtensionDescription)

Nested Class Summary
static 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
 
Nested classes/interfaces inherited from class com.google.gdata.data.ExtensionPoint
ExtensionPoint.CumulativeBlobHandler, ExtensionPoint.ExtensionHandler
 
Nested classes/interfaces inherited from class com.google.gdata.data.AbstractExtension
AbstractExtension.AttributesHandler
 
Field Summary
 
Fields inherited from class com.google.gdata.data.ExtensionPoint
xmlBlob
 
Constructor Summary
ExtensionDescription()
          Constructs an uninitialized ExtensionDescription.
ExtensionDescription(java.lang.Class<? extends Extension> extensionClass, com.google.gdata.util.common.xml.XmlNamespace namespace, java.lang.String localName)
          Constructs a new ExtensionDescription for an optional, non-repeating simple element.
ExtensionDescription(java.lang.Class<? extends Extension> extensionClass, com.google.gdata.util.common.xml.XmlNamespace namespace, java.lang.String localName, boolean required, boolean repeatable, boolean aggregate)
          Constructs a new ExtensionDescription populated with the parameter values.
ExtensionDescription(java.lang.Class<? extends Extension> extensionClass, com.google.gdata.util.common.xml.XmlNamespace namespace, java.lang.String localName, boolean required, boolean repeatable, boolean aggregate, boolean arbitraryXml, boolean mixedContent)
          Constructs a new ExtensionDescription populated with the parameter values.
 
Method Summary
 boolean allowsArbitraryXml()
           
 boolean allowsMixedContent()
           
 int compareTo(ExtensionDescription desc)
          Defines a natural ordering for ExtensionDescription based upon the qualified name of the mapped XML element.
 void generateConfig(com.google.gdata.util.common.xml.XmlWriter w, ExtensionProfile extProfile)
          Generates XML in the external config format.
static ExtensionDescription getDefaultDescription(java.lang.Class<? extends Extension> extensionClass)
          Returns the default ExtensionDescription for the specified Extension class.
 java.lang.Class<? extends Extension> getExtensionClass()
           
 java.lang.String getLocalName()
           
 com.google.gdata.util.common.xml.XmlNamespace getNamespace()
           
 boolean isAggregate()
           
 boolean isRepeatable()
           
 boolean isRequired()
           
 void setAggregate(boolean aggregate)
           
 void setArbitraryXml(boolean arbitraryXml)
           
 void setExtensionClass(java.lang.Class<? extends Extension> extensionClass)
           
 void setLocalName(java.lang.String localName)
           
 void setMixedContent(boolean mixedContent)
           
 void setNamespace(com.google.gdata.util.common.xml.XmlNamespace namespace)
           
 void setRepeatable(boolean repeatable)
           
 void setRequired(boolean required)
           
 
Methods inherited from class com.google.gdata.data.ExtensionPoint
addExtension, addExtension, addRepeatingExtension, addRepeatingExtension, checkRequiredExtensions, createExtensionInstance, declareExtensions, generate, generateCumulativeXmlBlob, generateExtensions, generateStartElement, getExtension, getExtensionDescription, getExtensionHandler, getExtensions, getHandler, getManifest, getRepeatingExtension, getRepeatingExtensions, getXmlBlob, hasExtension, hasRepeatingExtension, initializeArbitraryXml, parseCumulativeXmlBlob, removeExtension, removeExtension, removeRepeatingExtension, setExtension, setXmlBlob, visit, visitChild, visitChildren
 
Methods inherited from class com.google.gdata.data.AbstractExtension
consumeAttributes, disableStrictValidation, enableStrictValidation, eq, generate, generateAttributes, getExtensionLocalName, getExtensionNamespace, isImmutable, isStrictValidation, putAttributes, sameClassAs, setImmutable, throwExceptionForMissingAttribute, throwExceptionIfImmutable, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtensionDescription

public ExtensionDescription()
Constructs an uninitialized ExtensionDescription.


ExtensionDescription

public ExtensionDescription(java.lang.Class<? extends Extension> extensionClass,
                            com.google.gdata.util.common.xml.XmlNamespace namespace,
                            java.lang.String localName,
                            boolean required,
                            boolean repeatable,
                            boolean aggregate)
Constructs a new ExtensionDescription populated with the parameter values.


ExtensionDescription

public ExtensionDescription(java.lang.Class<? extends Extension> extensionClass,
                            com.google.gdata.util.common.xml.XmlNamespace namespace,
                            java.lang.String localName,
                            boolean required,
                            boolean repeatable,
                            boolean aggregate,
                            boolean arbitraryXml,
                            boolean mixedContent)
Constructs a new ExtensionDescription populated with the parameter values.


ExtensionDescription

public ExtensionDescription(java.lang.Class<? extends Extension> extensionClass,
                            com.google.gdata.util.common.xml.XmlNamespace namespace,
                            java.lang.String localName)
Constructs a new ExtensionDescription for an optional, non-repeating simple element.

Method Detail

getDefaultDescription

public static ExtensionDescription getDefaultDescription(java.lang.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:
java.lang.IllegalArgumentException - if a default description could not be fourn for the extension class.

setNamespace

public void setNamespace(com.google.gdata.util.common.xml.XmlNamespace namespace)

getNamespace

public final com.google.gdata.util.common.xml.XmlNamespace getNamespace()

setLocalName

public void setLocalName(java.lang.String localName)

getLocalName

public final java.lang.String getLocalName()

setExtensionClass

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

getExtensionClass

public final java.lang.Class<? extends Extension> getExtensionClass()

setRequired

public void setRequired(boolean required)

isRequired

public final boolean isRequired()

setRepeatable

public void setRepeatable(boolean repeatable)

isRepeatable

public final boolean isRepeatable()

setAggregate

public void setAggregate(boolean aggregate)

isAggregate

public final boolean isAggregate()

setArbitraryXml

public void setArbitraryXml(boolean arbitraryXml)

allowsArbitraryXml

public final boolean allowsArbitraryXml()

setMixedContent

public void setMixedContent(boolean mixedContent)

allowsMixedContent

public final boolean allowsMixedContent()

compareTo

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.

Specified by:
compareTo in interface java.lang.Comparable<ExtensionDescription>

generateConfig

public void generateConfig(com.google.gdata.util.common.xml.XmlWriter w,
                           ExtensionProfile extProfile)
                    throws java.io.IOException
Generates XML in the external config format.

Parameters:
w - Output writer.
extProfile - Extension profile.
Throws:
java.io.IOException