|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gdata.data.ExtensionProfile
public class ExtensionProfile
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>
.
Nested Class Summary | |
---|---|
class |
ExtensionProfile.ExtensionPointHandler
Reads the ExtensionPoint XML format |
class |
ExtensionProfile.Handler
Reads the ExtensionProfile XML format. |
Constructor Summary | |
---|---|
ExtensionProfile()
|
Method Summary | |
---|---|
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 . |
void |
declare(java.lang.Class<? extends ExtensionPoint> extendedType,
java.lang.Class<? extends Extension> extClass)
Specifies that type extendedType can contain an extension described
by extClass , as determined by
ExtensionDescription.getDefaultDescription(Class) . |
void |
declare(java.lang.Class<? extends ExtensionPoint> extendedType,
ExtensionDescription extDescription)
Specifies that type extendedType can contain an extension
described by extDescription . |
void |
declareAdditionalNamespace(XmlNamespace ns)
Specifies additional top-level namespace declarations. |
void |
declareArbitraryXmlExtension(java.lang.Class<? extends ExtensionPoint> extendedType)
Specifies that type extendedType can contain arbitrary XML. |
void |
declareEntryExtension(java.lang.Class<? extends Extension> extClass)
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. |
void |
declareEntryExtension(ExtensionDescription extDesc)
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. |
void |
declareEntryLinkProfile(ExtensionProfile profile)
Specifies the type of entries nested within <gd:entryLink> . |
void |
declareFeedExtension(java.lang.Class<? extends Extension> extClass)
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. |
void |
declareFeedExtension(ExtensionDescription extDesc)
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. |
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. |
ExtensionProfile |
getEntryLinkProfile()
Retrieves the type of entries nested within <gd:entryLink> . |
ExtensionProfile |
getFeedLinkProfile()
Retrieves the type of feeds nested within <gd:feedLink> . |
ExtensionManifest |
getManifest(java.lang.Class<?> extendedType)
Retrieves an extension manifest for a specific class (or one of its superclasses) or null if not specified. |
java.util.Collection<XmlNamespace> |
getNamespaceDecls()
Retrieves a collection of all namespaces used by this profile. |
boolean |
isAutoExtending()
|
boolean |
isDeclared(java.lang.Class<?> extendedType)
Returns whether the given extended type has already been declared. |
void |
parseConfig(ExtensionProfile configProfile,
java.lang.ClassLoader classLoader,
java.io.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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExtensionProfile()
Method Detail |
---|
public void addDeclarations(Kind.Adaptor adaptor)
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.
public void declare(java.lang.Class<? extends ExtensionPoint> extendedType, ExtensionDescription extDescription)
extendedType
can contain an extension
described by extDescription
.
public void declare(java.lang.Class<? extends ExtensionPoint> extendedType, java.lang.Class<? extends Extension> extClass)
extendedType
can contain an extension described
by extClass
, as determined by
ExtensionDescription.getDefaultDescription(Class)
.
@Deprecated public void declareFeedExtension(ExtensionDescription extDesc)
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.
extDesc
defines a feed extension.
@Deprecated public void declareFeedExtension(java.lang.Class<? extends Extension> extClass)
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.
extClass
defines a feed extension.
@Deprecated public void declareEntryExtension(ExtensionDescription extDesc)
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.
extDesc
defines an entry extension.
@Deprecated public void declareEntryExtension(java.lang.Class<? extends Extension> extClass)
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.
extClass
defines an entry extension.
public void declareArbitraryXmlExtension(java.lang.Class<? extends ExtensionPoint> extendedType)
extendedType
can contain arbitrary XML.
public void declareAdditionalNamespace(XmlNamespace ns)
public void declareFeedLinkProfile(ExtensionProfile profile)
<gd:feedLink>
.
public ExtensionProfile getFeedLinkProfile()
<gd:feedLink>
.
public void declareEntryLinkProfile(ExtensionProfile profile)
<gd:entryLink>
.
public ExtensionProfile getEntryLinkProfile()
<gd:entryLink>
.
public ExtensionManifest getManifest(java.lang.Class<?> extendedType)
null
if not specified.
public boolean isDeclared(java.lang.Class<?> extendedType)
getManifest(Class)
, it does not check the super
classes.
public java.util.Collection<XmlNamespace> getNamespaceDecls()
public void setAutoExtending(boolean v)
public boolean isAutoExtending()
public void setArbitraryXml(boolean v)
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.
v
- true
to enable foreign XML preservation, false
otherwise.
#see ExtensionPoint.getXmlBlob()public boolean allowsArbitraryXml()
ExtensionPoint
.
true
if foreign XML elements are preserved, false
otherwise.public void parseConfig(ExtensionProfile configProfile, java.lang.ClassLoader classLoader, java.io.InputStream stream) throws java.io.IOException, ParseException
configProfile
- Extension profile description configuration extensions.classLoader
- ClassLoader to load extension classesstream
- InputStream from which to read the description
java.io.IOException
ParseException
public void generateConfig(XmlWriter w, ExtensionProfile extProfile) throws java.io.IOException
w
- Output writer.extProfile
- Extension profile.
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |