Google Data APIs Client Library (1.41.1)



com.google.api.gbase.client
Class GmAttributes

java.lang.Object
  extended by com.google.api.gbase.client.GmAttributes
All Implemented Interfaces:
Extension

public class GmAttributes
extends java.lang.Object
implements Extension

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


Nested Class Summary
static class GmAttributes.GmAttribute
          The information defining an attribute, as contained by the gm:attribute element in the itemtypes feed.
 
Constructor Summary
GmAttributes()
           
 
Method Summary
 void addAttribute(GoogleBaseAttributeId attributeId, GmAttributes.GmAttribute.Importance importance)
          Adds a new attribute to the list.
 void addAttribute(java.lang.String name, GoogleBaseAttributeType type)
          Deprecated. use addAttribute(GoogleBaseAttributeId, GmAttribute.Importance) instead. This method will be removed in a future release
 void generate(com.google.gdata.util.common.xml.XmlWriter w, ExtensionProfile extProfile)
          Generate the XML representation for this tag.
 java.util.List<GoogleBaseAttributeId> getAttributeIds()
          Deprecated. use getAttributes() instead.
 java.util.Collection<GmAttributes.GmAttribute> getAttributes()
          Gets an unmodifiable collection of GmAttribute objects.
 XmlParser.ElementHandler getHandler(ExtensionProfile extProfile, java.lang.String namespace, java.lang.String localName, org.xml.sax.Attributes attrs)
          Creates a parser for this tag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GmAttributes

public GmAttributes()
Method Detail

getAttributeIds

public java.util.List<GoogleBaseAttributeId> getAttributeIds()
Deprecated. use getAttributes() instead.

Gets an unmodifiable list of GoogleBaseAttributeId objects.

Returns:
attribute list, which might be empty

getAttributes

public java.util.Collection<GmAttributes.GmAttribute> getAttributes()
Gets an unmodifiable collection of GmAttribute objects.

Returns:
attribute list, which might be empty

addAttribute

public void addAttribute(java.lang.String name,
                         GoogleBaseAttributeType type)
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:
java.lang.NullPointerException - if name is null

addAttribute

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:
java.lang.NullPointerException - if name is null
java.lang.IllegalArgumentException - if an attribute with the same name and type has already been added

generate

public void generate(com.google.gdata.util.common.xml.XmlWriter w,
                     ExtensionProfile extProfile)
              throws java.io.IOException
Generate the XML representation for this tag.

Specified by:
generate in interface Extension
Parameters:
w - XML writer
extProfile - extension profile
Throws:
java.io.IOException

getHandler

public XmlParser.ElementHandler getHandler(ExtensionProfile extProfile,
                                           java.lang.String namespace,
                                           java.lang.String localName,
                                           org.xml.sax.Attributes attrs)
                                    throws ParseException,
                                           java.io.IOException
Creates a parser for this tag.

Specified by:
getHandler in interface Extension
Parameters:
extProfile - extension profile
namespace - extension namespace
localName - tag name, without the namespace prefix
attrs - tag attributes
Returns:
an element handler
Throws:
ParseException - when an unexpected tag or badly-formatted XML is detected
java.io.IOException