|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gdata.model.Element
com.google.gdata.model.atompub.Collection
public class Collection
The Collection class defines the basic Java object model representation and XML parsing/generation support for an APP collection.
The implementation is versioned to support the AtomPub draft version 9 introspection format (used for the GData v1 implementation) as well as the final RFC5023 format (used for all other versions). The key difference between the two is that draft used an attribute for the collection title and a comma-delimited list for accepted MIME types, where the final version uses atom:title and repeating app:accept elements.
Field Summary | |
---|---|
static AttributeKey<java.lang.String> |
HREF
The href attribute. |
static ElementKey<java.lang.Void,Collection> |
KEY
The key for this element. |
static AttributeKey<java.lang.String> |
TITLE
Qualified name of title attribute. |
Constructor Summary | |
---|---|
Collection()
Default mutable constructor. |
|
Collection(java.lang.String href)
Construct a collection with the given href. |
|
Collection(java.lang.String href,
TextContent title,
java.lang.String... accepts)
Construct a collection with all fields. |
Method Summary | |
---|---|
Collection |
addAccept(Accept accept)
Adds a new accept element. |
Collection |
addAccept(java.lang.String accept)
Adds a new accept string. |
Collection |
addCategories(Categories categories)
Adds a new app categories document. |
java.util.List<java.lang.String> |
getAcceptList()
Returns a list of accept strings. |
java.util.List<Accept> |
getAccepts()
Returns the accept elements. |
java.util.List<Categories> |
getCategorieses()
Returns the app categories documents. |
java.lang.String |
getHref()
Returns the href. |
TextContent |
getTitle()
Returns the title. |
boolean |
hasAccepts()
Returns whether it has the accept elements. |
boolean |
hasCategorieses()
Returns whether it has the app categories documents. |
boolean |
hasHref()
Returns whether it has the href. |
boolean |
hasTitle()
Returns whether it has the title. |
static void |
registerMetadata(MetadataRegistry registry)
Registers the metadata for this element. |
boolean |
removeAccept(Accept accept)
Removes an accept element. |
boolean |
removeAccept(java.lang.String acceptStr)
Removes an accept string. |
Element |
resolve(ElementMetadata<?,?> metadata,
ValidationContext vc)
Resolve this element's state against the metadata. |
void |
setHref(java.lang.String href)
Sets the href. |
Collection |
setTitle(TextContent title)
Sets the title. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final ElementKey<java.lang.Void,Collection> KEY
public static final AttributeKey<java.lang.String> HREF
public static final AttributeKey<java.lang.String> TITLE
Constructor Detail |
---|
public Collection()
public Collection(java.lang.String href)
href
- href.public Collection(java.lang.String href, TextContent title, java.lang.String... accepts)
Method Detail |
---|
public static void registerMetadata(MetadataRegistry registry)
public java.util.List<Accept> getAccepts()
public java.util.List<java.lang.String> getAcceptList()
getAcceptList
in interface ICollection
public Collection addAccept(Accept accept)
accept
- accept elementpublic Collection addAccept(java.lang.String accept)
accept
- accept stringpublic boolean removeAccept(Accept accept)
accept
- accept element
public boolean removeAccept(java.lang.String acceptStr)
acceptStr
- the string to remove
public boolean hasAccepts()
public java.util.List<Categories> getCategorieses()
public Collection addCategories(Categories categories)
categories
- app categories documentpublic boolean hasCategorieses()
public java.lang.String getHref()
getHref
in interface Reference
public void setHref(java.lang.String href)
setHref
in interface Reference
href
- href or null
to resetpublic boolean hasHref()
public TextContent getTitle()
getTitle
in interface ICollection
public Collection setTitle(TextContent title)
title
- title or null
to resetpublic boolean hasTitle()
public Element resolve(ElementMetadata<?,?> metadata, ValidationContext vc)
Element
resolve
in class Element
vc
- validation context
public java.lang.String toString()
toString
in class Element
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |