public class

GmAttributes

extends Object
implements Extension
java.lang.Object
   ↳ com.google.api.gbase.client.GmAttributes

Class Overview

Java representation for the gm:attributes tag for in the itemtypes feed.

Summary

Nested Classes
class GmAttributes.GmAttribute The information defining an attribute, as contained by the gm:attribute element in the itemtypes feed. 
Fields
private final Set<GoogleBaseAttributeId> attributeIds
private final List<GmAttributes.GmAttribute> attributes
Public Constructors
GmAttributes()
Public Methods
void addAttribute(GoogleBaseAttributeId attributeId, GmAttributes.GmAttribute.Importance importance)
Adds a new attribute to the list.
void addAttribute(String name, GoogleBaseAttributeType type)
This method is deprecated. use addAttribute(GoogleBaseAttributeId, GmAttribute.Importance) instead. This method will be removed in a future release
void generate(XmlWriter w, ExtensionProfile extProfile)
Generate the XML representation for this tag.
List<GoogleBaseAttributeId> getAttributeIds()
This method is deprecated. use getAttributes() instead.
Collection<GmAttributes.GmAttribute> getAttributes()
Gets an unmodifiable collection of GmAttribute objects.
XmlParser.ElementHandler getHandler(ExtensionProfile extProfile, String namespace, String localName, Attributes attrs)
Creates a parser for this tag.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.google.gdata.data.Extension

Fields

private final Set<GoogleBaseAttributeId> attributeIds

private final List<GmAttributes.GmAttribute> attributes

Public Constructors

public GmAttributes ()

Public Methods

public void addAttribute (GoogleBaseAttributeId attributeId, GmAttributes.GmAttribute.Importance importance)

Adds a new attribute to the list.

Note: The importance parameter should not be null. The current implementation allows null values for loadind old attributes persisted on client side. The null check will be enabled in a future release.

Parameters
attributeId The id for this attribute
importance Attribute importance, may be null if no importance is defined
Throws
NullPointerException if name is null
IllegalArgumentException if an attribute with the same name and type has already been added

public void addAttribute (String name, GoogleBaseAttributeType type)

This method is deprecated.
use addAttribute(GoogleBaseAttributeId, GmAttribute.Importance) instead. This method will be removed in a future release

Adds a new attribute to the list with no importance specified.

Parameters
name Attribute name
type Attribute type, may be null
Throws
NullPointerException if name is null

public void generate (XmlWriter w, ExtensionProfile extProfile)

Generate the XML representation for this tag.

Parameters
w XML writer
extProfile Extension profile
Throws
IOException

public List<GoogleBaseAttributeId> getAttributeIds ()

This method is deprecated.
use getAttributes() instead.

Gets an unmodifiable list of GoogleBaseAttributeId objects.

Returns
  • attribute list, which might be empty

public Collection<GmAttributes.GmAttribute> getAttributes ()

Gets an unmodifiable collection of GmAttribute objects.

Returns
  • attribute list, which might be empty

public XmlParser.ElementHandler getHandler (ExtensionProfile extProfile, String namespace, String localName, Attributes attrs)

Creates a parser for this tag.

Parameters
extProfile Extension profile
namespace Extension namespace
localName Tag name, without the namespace prefix
attrs Tag attributes
Returns
  • an element handler
Throws
IOException
ParseException