public class

ExtensionProfile

extends Object
java.lang.Object
   ↳ com.google.gdata.data.ExtensionProfile

Class Overview

Specifies a complete extension profile for an extended GData schema. A profile is a set of allowed extensions for each type together with additional properties.

For example, Calendar might allow <gd:who> within <atom:feed>, and <gd:when>, <gd:who>, and <gd:where> within <atom:entry>.

Summary

Nested Classes
class ExtensionProfile.ExtensionPointHandler Reads the ExtensionPoint XML format  
class ExtensionProfile.Handler Reads the ExtensionProfile XML format. 
Fields
private Collection<XmlNamespace> additionalNamespaces Additional namespaces.
private boolean allowsArbitraryXml When true, indicates that arbitrary XML is acceptable on any ExtensionPoint when parsing using this profile.
private HashSet<Class<? extends Kind.Adaptor>> declared Set of previously declared Kind.Adaptor classes.
private ExtensionProfile entryLinkProfile Nested entry link profile.
private ExtensionProfile feedLinkProfile Nested feed link profile.
private boolean isAutoExtending Profile supports auto-extension declaration
private Collection<XmlNamespace> nsDecls Namespace declarations cache.
private final Map<Class<?>, ExtensionManifest> profile Internal storage for the profile.
Public Constructors
ExtensionProfile()
Public Methods
void addDeclarations(Kind.Adaptor adaptor)
Adds the extension declarations associated with an Kind.Adaptor instance, if the declaring class has not already added to this profile.
boolean allowsArbitraryXml()
Returns whether foreign XML elements will be preserved within any ExtensionPoint.
synchronized void declare(Class<? extends ExtensionPoint> extendedType, ExtensionDescription extDescription)
Specifies that type extendedType can contain an extension described by extDescription.
synchronized void declare(Class<? extends ExtensionPoint> extendedType, Class<? extends Extension> extClass)
Specifies that type extendedType can contain an extension described by extClass, as determined by getDefaultDescription(Class).
synchronized void declareAdditionalNamespace(XmlNamespace ns)
Specifies additional top-level namespace declarations.
synchronized void declareArbitraryXmlExtension(Class<? extends ExtensionPoint> extendedType)
Specifies that type extendedType can contain arbitrary XML.
synchronized void declareArbitraryXmlExtension(Class<? extends ExtensionPoint> extendedType, boolean mixedContent)
Specifies that type extendedType can contain arbitrary XML.
synchronized void declareEntryExtension(Class<? extends Extension> extClass)
This method is deprecated. Calls to this API should be replaced with calls to declare(Class, ExtensionDescription) where the first argument is a specific BaseEntry subtype. The BaseEntry class should only be used for mix-in types that might appear in multiple entry types. Its use for all entry declarations can result in conflicts when mutiple feed types are declared into a single extension profile, a common practice in client library service initialization for services that return multiple entry types.
synchronized void declareEntryExtension(ExtensionDescription extDesc)
This method is deprecated. Calls to this API should be replaced with calls to declare(Class, ExtensionDescription) where the first argument is a specific BaseEntry subtype. The BaseEntry class should only be used for mix-in types that might appear in multiple entry types. Its use for all entry declarations can result in conflicts when mutiple feed types are declared into a single extension profile, a common practice in client library service initialization for services that return multiple entry types.
synchronized void declareEntryLinkProfile(ExtensionProfile profile)
Specifies the type of entries nested within <gd:entryLink>.
synchronized void declareFeedExtension(ExtensionDescription extDesc)
This method is deprecated. Calls to this API should be replaced with calls to declare(Class, ExtensionDescription) where the first argument is a specific BaseFeed subtype. The BaseFeed class should only be used for mix-in types that might appear in multiple feed types. Its use for all feed declarations can result in conflicts when mutiple feed types are declared into a single extension profile, a common practice in client library service initialization for services that return multiple feed types.
synchronized void declareFeedExtension(Class<? extends Extension> extClass)
This method is deprecated. Calls to this API should be replaced with calls to declare(Class, ExtensionDescription) where the first argument is a specific BaseFeed subtype. The BaseFeed class should only be used for mix-in types that might appear in multiple feed types. Its use for all feed declarations can result in conflicts when mutiple feed types are declared into a single extension profile, a common practice in client library service initialization for services that return multiple feed types.
synchronized void declareFeedLinkProfile(ExtensionProfile profile)
Specifies the type of feeds nested within <gd:feedLink>.
void generateConfig(XmlWriter w, ExtensionProfile extProfile)
Generates XML in the external config format.
synchronized ExtensionProfile getEntryLinkProfile()
Retrieves the type of entries nested within <gd:entryLink>.
synchronized ExtensionProfile getFeedLinkProfile()
Retrieves the type of feeds nested within <gd:feedLink>.
ExtensionManifest getManifest(Class<?> extendedType)
Retrieves an extension manifest for a specific class (or one of its superclasses) or null if not specified.
synchronized Collection<XmlNamespace> getNamespaceDecls()
Retrieves a collection of all namespaces used by this profile.
boolean isAutoExtending()
boolean isDeclared(Class<?> extendedType)
Returns whether the given extended type has already been declared.
void parseConfig(ExtensionProfile configProfile, ClassLoader classLoader, InputStream stream)
Parses XML in the ExtensionProfile format.
void setArbitraryXml(boolean v)
Configures the extension profile to specify whether any foreign XML elements found when parsing within an ExtensionPoint should be preserved.
void setAutoExtending(boolean v)
[Expand]
Inherited Methods
From class java.lang.Object

Fields

private Collection<XmlNamespace> additionalNamespaces

Additional namespaces.

private boolean allowsArbitraryXml

When true, indicates that arbitrary XML is acceptable on any ExtensionPoint when parsing using this profile. The default value is true to provide compliance with sections 6.3 of RFC4287 (Atom Syntax) and section 6.2 of the AtomPub spec.

private HashSet<Class<? extends Kind.Adaptor>> declared

Set of previously declared Kind.Adaptor classes.

private ExtensionProfile entryLinkProfile

Nested entry link profile.

private ExtensionProfile feedLinkProfile

Nested feed link profile.

private boolean isAutoExtending

Profile supports auto-extension declaration

private Collection<XmlNamespace> nsDecls

Namespace declarations cache.

private final Map<Class<?>, ExtensionManifest> profile

Internal storage for the profile.

Public Constructors

public ExtensionProfile ()

Public Methods

public void addDeclarations (Kind.Adaptor adaptor)

Adds the extension declarations associated with an Kind.Adaptor instance, if the declaring class has not already added to this profile. The method is optimized to reduce the overhead of declaring the same adaptor type multiple times within the same profile.

Parameters
adaptor

public boolean allowsArbitraryXml ()

Returns whether foreign XML elements will be preserved within any ExtensionPoint.

Returns
  • true if foreign XML elements are preserved, false otherwise.

public synchronized void declare (Class<? extends ExtensionPoint> extendedType, ExtensionDescription extDescription)

Specifies that type extendedType can contain an extension described by extDescription.

Parameters
extendedType
extDescription

public synchronized void declare (Class<? extends ExtensionPoint> extendedType, Class<? extends Extension> extClass)

Specifies that type extendedType can contain an extension described by extClass, as determined by getDefaultDescription(Class).

Parameters
extendedType
extClass

public synchronized void declareAdditionalNamespace (XmlNamespace ns)

Specifies additional top-level namespace declarations.

Parameters
ns

public synchronized void declareArbitraryXmlExtension (Class<? extends ExtensionPoint> extendedType)

Specifies that type extendedType can contain arbitrary XML.

Parameters
extendedType The type being declared for

public synchronized void declareArbitraryXmlExtension (Class<? extends ExtensionPoint> extendedType, boolean mixedContent)

Specifies that type extendedType can contain arbitrary XML.

Parameters
extendedType The type being declared for
mixedContent If true, permit mixed content in the arbitrary XML.

public synchronized void declareEntryExtension (Class<? extends Extension> extClass)

This method is deprecated.
Calls to this API should be replaced with calls to declare(Class, ExtensionDescription) where the first argument is a specific BaseEntry subtype. The BaseEntry class should only be used for mix-in types that might appear in multiple entry types. Its use for all entry declarations can result in conflicts when mutiple feed types are declared into a single extension profile, a common practice in client library service initialization for services that return multiple entry types.

Declares that extClass defines an entry extension.

Parameters
extClass

public synchronized void declareEntryExtension (ExtensionDescription extDesc)

This method is deprecated.
Calls to this API should be replaced with calls to declare(Class, ExtensionDescription) where the first argument is a specific BaseEntry subtype. The BaseEntry class should only be used for mix-in types that might appear in multiple entry types. Its use for all entry declarations can result in conflicts when mutiple feed types are declared into a single extension profile, a common practice in client library service initialization for services that return multiple entry types.

Declares that extDesc defines an entry extension.

Parameters
extDesc

public synchronized void declareEntryLinkProfile (ExtensionProfile profile)

Specifies the type of entries nested within <gd:entryLink>.

Parameters
profile

public synchronized void declareFeedExtension (ExtensionDescription extDesc)

This method is deprecated.
Calls to this API should be replaced with calls to declare(Class, ExtensionDescription) where the first argument is a specific BaseFeed subtype. The BaseFeed class should only be used for mix-in types that might appear in multiple feed types. Its use for all feed declarations can result in conflicts when mutiple feed types are declared into a single extension profile, a common practice in client library service initialization for services that return multiple feed types.

Declares that extDesc defines a feed extension.

Parameters
extDesc

public synchronized void declareFeedExtension (Class<? extends Extension> extClass)

This method is deprecated.
Calls to this API should be replaced with calls to declare(Class, ExtensionDescription) where the first argument is a specific BaseFeed subtype. The BaseFeed class should only be used for mix-in types that might appear in multiple feed types. Its use for all feed declarations can result in conflicts when mutiple feed types are declared into a single extension profile, a common practice in client library service initialization for services that return multiple feed types.

Declares that extClass defines a feed extension.

Parameters
extClass

public synchronized void declareFeedLinkProfile (ExtensionProfile profile)

Specifies the type of feeds nested within <gd:feedLink>.

Parameters
profile

public void generateConfig (XmlWriter w, ExtensionProfile extProfile)

Generates XML in the external config format.

Parameters
w Output writer.
extProfile Extension profile.
Throws
IOException

public synchronized ExtensionProfile getEntryLinkProfile ()

Retrieves the type of entries nested within <gd:entryLink>.

public synchronized ExtensionProfile getFeedLinkProfile ()

Retrieves the type of feeds nested within <gd:feedLink>.

public ExtensionManifest getManifest (Class<?> extendedType)

Retrieves an extension manifest for a specific class (or one of its superclasses) or null if not specified.

Parameters
extendedType

public synchronized Collection<XmlNamespace> getNamespaceDecls ()

Retrieves a collection of all namespaces used by this profile.

public boolean isAutoExtending ()

public boolean isDeclared (Class<?> extendedType)

Returns whether the given extended type has already been declared. Note that unlike getManifest(Class), it does not check the super classes.

Parameters
extendedType

public void parseConfig (ExtensionProfile configProfile, ClassLoader classLoader, InputStream stream)

Parses XML in the ExtensionProfile format.

Parameters
configProfile Extension profile description configuration extensions.
classLoader ClassLoader to load extension classes
stream InputStream from which to read the description
Throws
IOException
ParseException

public void setArbitraryXml (boolean v)

Configures the extension profile to specify whether any foreign XML elements found when parsing within an ExtensionPoint should be preserved. If false, the presence of foreign XML will result in parsing errors. Arbitrary XML support is enabled by default in a newly created profile.

Parameters
v true to enable foreign XML preservation, false otherwise. #see ExtensionPoint.getXmlBlob()

public void setAutoExtending (boolean v)

Parameters
v