public class GoogleBaseAttributesExtension extends java.lang.Object implements Extension
GoogleBaseAttribute
s
Accessing GoogleBaseAttribute directly is possible, but usually not
recommended.
Many methods are available in this class that will perform
the necessary type conversion from GoogleBaseAttribute to
String, Integer, Float, and DateTime
.
Shortcuts exist for a few well-known attributes.
You usually get such an object using
GoogleBaseEntry.getGoogleBaseAttributes()
.
This class can be registered in an
ExtensionProfile
using
DESCRIPTION
and then accessed from an
ExtensionPoint
using
ExtensionPoint.getExtension(Class)
.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
APPLICATION_ATTRIBUTE
Attribute
<g:application> . |
static java.lang.String |
CUSTOMER_ID
Attribute
<g:customer_id> . |
static java.lang.String |
DELIVERY_NOTES_ATTRIBUTE
Attribute
<g:delivery_notes> . |
static java.lang.String |
DELIVERY_RADIUS_ATTRIBUTE
Attribute
<g:delivery_radius> . |
static ExtensionDescription |
DESCRIPTION
A description for this extension, to pass to an
ExtensionProfile . |
static java.lang.String |
EXPIRATION_DATE_ATTRIBUTE
Attribute
<g:expiration_date> . |
static java.lang.String |
IMAGE_LINK_ATTRIBUTE
Attribute
<g:image_link> . |
static java.lang.String |
ITEM_TYPE_ATTRIBUTE
Attribute
<g:item_type> . |
static java.lang.String |
LABEL_ATTRIBUTE
Attribute
<g:label> . |
static java.lang.String |
LOCATION_ATTRIBUTE
Attribute
<g:location> . |
static java.lang.String |
PAYMENT_METHOD_ATTRIBUTE
Attribute
<g:payment_accepted> . |
static java.lang.String |
PAYMENT_NOTES_ATTRIBUTE
Attribute
<g:payment_notes> . |
static java.lang.String |
PICKUP_ATTRIBUTE
Attribute
<g:pickup> . |
static java.lang.String |
PRICE_ATTRIBUTE
Attribute
<g:price> . |
static java.lang.String |
PRICE_TYPE_ATTRIBUTE
Attribute
<g:price_type> . |
static java.lang.String |
PRICE_UNITS_ATTRIBUTE
Attribute
<g:price_units> . |
static java.lang.String |
QUANTITY_ATTRIBUTE
Attribute
<g:quantity> . |
static java.lang.String |
SHIPPING_ATTRIBUTE
Attribute
<g:shipping> . |
static java.lang.String |
TAX_ATTRIBUTE
Attribute
<g:tax> . |
static java.lang.String |
TAX_PERCENT_ATTRIBUTE
Deprecated.
use
TAX_ATTRIBUTE instead |
static java.lang.String |
TAX_REGION_ATTRIBUTE
Deprecated.
use
TAX_ATTRIBUTE instead |
Constructor and Description |
---|
GoogleBaseAttributesExtension() |
Modifier and Type | Method and Description |
---|---|
GoogleBaseAttribute |
addAttribute(GoogleBaseAttribute attribute)
Adds an attribute to the list.
|
GoogleBaseAttribute |
addBooleanAttribute(java.lang.String name,
boolean value)
Adds an attribute of type
GoogleBaseAttributeType.BOOLEAN . |
GoogleBaseAttribute |
addDateAttribute(java.lang.String name,
DateTime date)
Adds an attribute of type
GoogleBaseAttributeType.DATE . |
GoogleBaseAttribute |
addDateTimeAttribute(java.lang.String name,
DateTime dateTime)
Adds an attribute of type
GoogleBaseAttributeType.DATE_TIME . |
GoogleBaseAttribute |
addDateTimeRangeAttribute(java.lang.String name,
DateTimeRange dateTimeRange)
Adds an attribute of type
GoogleBaseAttributeType.DATE_TIME_RANGE . |
GoogleBaseAttribute |
addFloatAttribute(java.lang.String name,
float value)
Adds an attribute of type
GoogleBaseAttributeType.FLOAT . |
GoogleBaseAttribute |
addFloatUnitAttribute(java.lang.String name,
float value,
java.lang.String unit)
Adds an attribute of type
GoogleBaseAttributeType.FLOAT_UNIT . |
GoogleBaseAttribute |
addFloatUnitAttribute(java.lang.String name,
NumberUnit<java.lang.Float> value)
Adds an attribute of type
GoogleBaseAttributeType.FLOAT_UNIT . |
void |
addGroupAttribute(java.lang.String groupName,
Group group)
Adds group attribute.
|
void |
addImageLink(java.lang.String link)
Adds an image URL.
|
GoogleBaseAttribute |
addIntAttribute(java.lang.String name,
int value)
Adds an attribute of type
GoogleBaseAttributeType.INT . |
GoogleBaseAttribute |
addIntUnitAttribute(java.lang.String name,
int value,
java.lang.String unit)
Adds an attribute of type
GoogleBaseAttributeType.INT_UNIT . |
GoogleBaseAttribute |
addIntUnitAttribute(java.lang.String name,
NumberUnit<java.lang.Integer> value)
Adds an attribute of type
GoogleBaseAttributeType.INT_UNIT . |
void |
addLabel(java.lang.String value)
Adds a label to the entry.
|
GoogleBaseAttribute |
addLocationAttribute(java.lang.String name,
Location location)
Adds an attribute of type
GoogleBaseAttributeType.LOCATION . |
GoogleBaseAttribute |
addLocationAttribute(java.lang.String name,
java.lang.String location)
Adds an attribute of type
GoogleBaseAttributeType.LOCATION . |
GoogleBaseAttribute |
addNumberAttribute(java.lang.String name,
java.lang.Number value)
Adds an attribute of type
GoogleBaseAttributeType.NUMBER . |
GoogleBaseAttribute |
addNumberUnitAttribute(java.lang.String name,
java.lang.Number value,
java.lang.String unit)
Adds an attribute of type
GoogleBaseAttributeType.NUMBER_UNIT . |
GoogleBaseAttribute |
addNumberUnitAttribute(java.lang.String name,
NumberUnit<java.lang.Number> value)
Adds an attribute of type
GoogleBaseAttributeType.NUMBER_UNIT . |
void |
addPaymentMethod(java.lang.String method)
Adds an accepted payment method.
|
GoogleBaseAttribute |
addReferenceAttribute(java.lang.String name,
java.lang.String value)
Adds an attribute of type
GoogleBaseAttributeType.REFERENCE . |
void |
addShipping(Shipping shipping)
Adds shipping attribute.
|
void |
addShippingAttribute(java.lang.String name,
Shipping shipping)
Adds an attribute of type
GoogleBaseAttributeType.SHIPPING . |
void |
addTax(Tax tax)
Adds tax attribute.
|
void |
addTaxAttribute(java.lang.String name,
Tax tax)
Adds an attribute of type
GoogleBaseAttributeType.TAX . |
GoogleBaseAttribute |
addTextAttribute(java.lang.String name,
java.lang.String value)
Adds an attribute of type
GoogleBaseAttributeType.TEXT . |
GoogleBaseAttribute |
addUrlAttribute(java.lang.String name,
java.lang.String value)
Adds an attribute of type
GoogleBaseAttributeType.URL . |
void |
clearAttributes()
Removes all attributes from the list.
|
void |
generate(XmlWriter xmlWriter,
ExtensionProfile extensionProfile)
Implements
Extension.generate(XmlWriter, ExtensionProfile) . |
java.lang.String |
getApplication()
Gets the application attribute.
|
GoogleBaseAttribute |
getAttribute(java.lang.String name)
Gets the first attribute with a certain name.
|
GoogleBaseAttribute |
getAttribute(java.lang.String name,
GoogleBaseAttributeType type)
Gets the first attribute with a certain name and type.
|
java.util.List<? extends GoogleBaseAttribute> |
getAttributes()
Gets a list of all the attributes available in the extension
namespace at the current
ExtensionPoint . |
java.util.List<? extends GoogleBaseAttribute> |
getAttributes(java.lang.String name)
Gets all the attributes with a certain name and type.
|
java.util.List<? extends GoogleBaseAttribute> |
getAttributes(java.lang.String name,
GoogleBaseAttributeType type)
Gets all the attributes with a certain name and type.
|
java.lang.Boolean |
getBooleanAttribute(java.lang.String name)
Gets the first value of a specific attribute, as an Boolean.
|
java.lang.Integer |
getCustomerId() |
DateTime |
getDateAttribute(java.lang.String name)
Gets the first value of a specific attribute, as a date.
|
DateTimeRange |
getDateRangeAttribute(java.lang.String name)
Gets the first value of a specific attribute, as a date/dateTime
range.
|
DateTime |
getDateTimeAttribute(java.lang.String name)
Gets the first value of a specific attribute, as a date and a time.
|
DateTimeRange |
getDateTimeRangeAttribute(java.lang.String name)
Gets the first value of a specific attribute, as a
DateTimeRange . |
java.util.List<? extends DateTimeRange> |
getDateTimeRangeAttributes(java.lang.String name)
Gets all the values of a specific attribute, as a list of
DateTimeRange . |
java.lang.String |
getDeliveryNotes()
Gets delivery notes attribute
|
NumberUnit<java.lang.Float> |
getDeliveryRadius()
Gets delivery radius.
|
DateTime |
getExpirationDate()
Gets the date and time at which the entry expires.
|
java.lang.Float |
getFloatAttribute(java.lang.String name)
Gets the first value of a specific attribute, as a Float.
|
NumberUnit<java.lang.Float> |
getFloatUnitAttribute(java.lang.String name)
Gets the first value of a specific attribute, as an float,
followed by a unit name.
|
Group |
getGroupAttribute(java.lang.String name)
Gets the first value of a specific attribute, as a
Group . |
java.util.Collection<? extends Group> |
getGroupAttributes(java.lang.String groupName)
Gets all the values of a specific attribute, as a collection of
Group s. |
XmlParser.ElementHandler |
getHandler(ExtensionProfile extensionProfile,
java.lang.String uri,
java.lang.String localName,
org.xml.sax.Attributes attributes)
|
java.lang.String |
getImageLink()
Gets the first URL to an image representing this item.
|
java.util.List<? extends java.lang.String> |
getImageLinks()
Gets all URLs to images representing this item.
|
java.lang.Integer |
getIntAttribute(java.lang.String name)
Gets the first value of a specific attribute, as an Integer.
|
NumberUnit<java.lang.Integer> |
getIntUnitAttribute(java.lang.String name)
Gets the first value of a specific attribute, as an integer,
followed by a unit name.
|
java.lang.String |
getItemType()
Gets the item type.
|
java.util.Collection<? extends java.lang.String> |
getLabels()
Gets the labels set for the entry.
|
java.lang.String |
getLocation()
Gets the location.
|
java.lang.String |
getLocationAttribute(java.lang.String name)
Gets the first value of a specific location attribute, as an
address.
|
Location |
getLocationAttributeAsObject(java.lang.String name)
Gets the first value of a specific location attribute, as a
location object.
|
java.util.List<? extends java.lang.String> |
getLocationAttributes(java.lang.String name)
Gets all the values of a specific location attribute, as a list of
strings.
|
java.util.List<Location> |
getLocationAttributesAsObjects(java.lang.String name)
Gets all the values of a specific attribute, as a list of
Location objects. |
java.lang.Number |
getNumberAttribute(java.lang.String name)
Gets the first value of a specific attribute, as a Number.
|
NumberUnit<? extends java.lang.Number> |
getNumberUnitAttribute(java.lang.String name)
Gets the first value of a specific attribute, as a Number,
followed by a unit name.
|
java.util.Collection<? extends java.lang.String> |
getPaymentMethods()
Gets a collection of accepted payment methods (Cash, WireTransfer, ...).
|
java.lang.String |
getPaymentNotes()
Gets payment notes attribute
|
java.lang.Boolean |
getPickup()
Gets pickup attribute, or null.
|
NumberUnit<java.lang.Float> |
getPrice()
Gets the price of the item.
|
java.lang.String |
getPriceType()
Gets price type.
|
java.lang.String |
getPriceUnits()
Gets price units.
|
java.lang.Integer |
getQuantity()
Gets quantity, or null if not set.
|
java.lang.String |
getReferenceAttribute(java.lang.String name)
Gets the first value of a specific reference attribute.
|
java.util.Collection<? extends Shipping> |
getShipping()
Gets shipping attributes.
|
Shipping |
getShippingAttribute(java.lang.String name)
Gets the first value of a specific attribute, as a
Shipping . |
java.util.List<? extends Shipping> |
getShippingAttributes(java.lang.String name)
Gets all the values of a specific attribute, as a list of
Shipping s. |
java.util.Collection<? extends Tax> |
getTax()
Gets tax attributes.
|
Tax |
getTaxAttribute(java.lang.String name)
Gets the first value of a specific attribute, as a
Tax . |
java.util.List<? extends Tax> |
getTaxAttributes(java.lang.String name)
Gets all the values of a specific attribute, as a list of
Tax s. |
java.lang.Float |
getTaxPercent()
Deprecated.
use
getTax() instead |
java.lang.String |
getTaxRegion()
Deprecated.
use
getTax() instead |
java.lang.String |
getTextAttribute(java.lang.String name)
Gets the first value of a specific attribute, as a string.
|
java.util.List<java.lang.String> |
getTextAttributeValues(java.lang.String attributeName)
Gets all the values of a specific attribute, as a list
of strings.
|
java.lang.String |
getUrlAttribute(java.lang.String name)
Gets the first value of a specific attribute, as an url.
|
void |
removeAttribute(GoogleBaseAttribute value)
Removes an attribute from the list.
|
void |
removeAttributes(java.lang.String name)
Removes all attributes with a certain name from the list.
|
void |
removeAttributes(java.lang.String name,
GoogleBaseAttributeType type)
Removes all attributes with a certain name and
type from the list.
|
void |
setApplication(java.lang.String name)
Sets the application attribute.
|
void |
setDeliveryNotes(java.lang.String notes)
Sets delivery notes attribute.
|
void |
setDeliveryRadius(float value,
java.lang.String unit)
Sets delivery radius.
|
void |
setDeliveryRadius(NumberUnit<java.lang.Float> value)
Sets delivery radius.
|
void |
setExpirationDate(DateTime date)
Sets the date at which the entry expires.
|
void |
setItemType(java.lang.String value)
Sets the item type.
|
void |
setLocation(java.lang.String value)
Sets the location.
|
void |
setPaymentNotes(java.lang.String notes)
Sets payment notes attribute.
|
void |
setPickup(boolean pickup)
Sets pickup attribute.
|
void |
setPrice(float value,
java.lang.String currency)
Sets the price of the item.
|
void |
setPrice(NumberUnit<java.lang.Float> value)
Sets the price of the item.
|
void |
setPriceType(java.lang.String type)
Sets price type.
|
void |
setPriceUnits(java.lang.String value)
Sets price units.
|
void |
setQuantity(int value)
Sets quantity.
|
void |
setTaxPercent(float taxPercent)
Deprecated.
use
addTax(Tax) instead |
void |
setTaxRegion(java.lang.String region)
Deprecated.
use
addTax(Tax) instead |
public static final ExtensionDescription DESCRIPTION
ExtensionProfile
.public static final java.lang.String LABEL_ATTRIBUTE
<g:label>
.getLabels()
,
addLabel(String)
,
Constant Field Valuespublic static final java.lang.String ITEM_TYPE_ATTRIBUTE
<g:item_type>
.public static final java.lang.String EXPIRATION_DATE_ATTRIBUTE
<g:expiration_date>
.public static final java.lang.String IMAGE_LINK_ATTRIBUTE
<g:image_link>
.public static final java.lang.String PAYMENT_METHOD_ATTRIBUTE
<g:payment_accepted>
.public static final java.lang.String PRICE_ATTRIBUTE
<g:price>
.public static final java.lang.String LOCATION_ATTRIBUTE
<g:location>
.public static final java.lang.String PRICE_TYPE_ATTRIBUTE
<g:price_type>
.public static final java.lang.String QUANTITY_ATTRIBUTE
<g:quantity>
.getQuantity()
,
setQuantity(int)
,
Constant Field Valuespublic static final java.lang.String PRICE_UNITS_ATTRIBUTE
<g:price_units>
.public static final java.lang.String SHIPPING_ATTRIBUTE
<g:shipping>
.public static final java.lang.String TAX_ATTRIBUTE
<g:tax>
.getTax()
,
addTax(Tax)
,
Constant Field Values@Deprecated public static final java.lang.String TAX_PERCENT_ATTRIBUTE
TAX_ATTRIBUTE
instead<g:tax_percent>
.getTax()
,
addTax(Tax)
,
Constant Field Values@Deprecated public static final java.lang.String TAX_REGION_ATTRIBUTE
TAX_ATTRIBUTE
instead<g:tax_region>
.getTax()
,
addTax(Tax)
,
Constant Field Valuespublic static final java.lang.String DELIVERY_RADIUS_ATTRIBUTE
<g:delivery_radius>
.public static final java.lang.String PICKUP_ATTRIBUTE
<g:pickup>
.getPickup()
,
setPickup(boolean)
,
Constant Field Valuespublic static final java.lang.String DELIVERY_NOTES_ATTRIBUTE
<g:delivery_notes>
.public static final java.lang.String PAYMENT_NOTES_ATTRIBUTE
<g:payment_notes>
.public static final java.lang.String APPLICATION_ATTRIBUTE
<g:application>
.public static final java.lang.String CUSTOMER_ID
<g:customer_id>
.getCustomerId()
,
Constant Field Valuespublic java.util.Collection<? extends java.lang.String> getLabels()
public void addLabel(java.lang.String value)
value
- public java.lang.String getItemType()
public void setItemType(java.lang.String value)
public DateTime getExpirationDate()
public void setExpirationDate(DateTime date)
public java.lang.String getImageLink()
public java.util.List<? extends java.lang.String> getImageLinks()
public void addImageLink(java.lang.String link)
public java.util.Collection<? extends java.lang.String> getPaymentMethods()
public void addPaymentMethod(java.lang.String method)
public NumberUnit<java.lang.Float> getPrice()
public void setPrice(NumberUnit<java.lang.Float> value)
value
- public void setPrice(float value, java.lang.String currency)
value
- currency
- public java.lang.String getLocation()
public void setLocation(java.lang.String value)
public void setPriceType(java.lang.String type)
public java.lang.String getPriceType()
public void setQuantity(int value)
public java.lang.Integer getQuantity()
public void setPriceUnits(java.lang.String value)
public java.lang.String getPriceUnits()
public void addShipping(Shipping shipping)
public java.util.Collection<? extends Shipping> getShipping()
public void addTax(Tax tax)
public java.util.Collection<? extends Tax> getTax()
@Deprecated public void setTaxPercent(float taxPercent)
addTax(Tax)
instead@Deprecated public java.lang.Float getTaxPercent()
getTax()
instead@Deprecated public void setTaxRegion(java.lang.String region)
addTax(Tax)
instead@Deprecated public java.lang.String getTaxRegion()
getTax()
insteadpublic void setDeliveryRadius(float value, java.lang.String unit)
public void setDeliveryRadius(NumberUnit<java.lang.Float> value)
public NumberUnit<java.lang.Float> getDeliveryRadius()
public void setPickup(boolean pickup)
public java.lang.Boolean getPickup()
public void setDeliveryNotes(java.lang.String notes)
public java.lang.String getDeliveryNotes()
public void setPaymentNotes(java.lang.String notes)
public java.lang.String getPaymentNotes()
public java.lang.Integer getCustomerId()
public java.util.List<? extends GoogleBaseAttribute> getAttributes()
ExtensionPoint
.
Attributes might be repeated.GoogleBaseAttribute
,
which might be empty but not nullpublic GoogleBaseAttribute getAttribute(java.lang.String name)
getAttributes(String)
to make sure
you get all of them.name
- attribute nameGoogleBaseAttribute
or null if no attribute was found with this namepublic GoogleBaseAttribute getAttribute(java.lang.String name, GoogleBaseAttributeType type)
getAttributes(String)
to make sure
you get all of them.name
- attribute nametype
- attribute type (null to ignore the type)GoogleBaseAttribute
or null if no attribute was found with this namepublic java.util.List<? extends GoogleBaseAttribute> getAttributes(java.lang.String name, GoogleBaseAttributeType type)
name
- attribute nametype
- attribute type, null to ignore the typeGoogleBaseAttribute
,
which might be empty but not nullpublic java.util.List<? extends GoogleBaseAttribute> getAttributes(java.lang.String name)
name
- attribute nameGoogleBaseAttribute
,
which might be empty but not nullpublic GoogleBaseAttribute addAttribute(GoogleBaseAttribute attribute)
removeAttributes(String, GoogleBaseAttributeType)
first.attribute
- public void removeAttribute(GoogleBaseAttribute value)
value
- public void removeAttributes(java.lang.String name)
name
- name of the attributes that should be removedpublic void removeAttributes(java.lang.String name, GoogleBaseAttributeType type)
name
- name of the attributes that should be removedtype
- attribute type, null to ignore the typepublic void clearAttributes()
public java.lang.String getTextAttribute(java.lang.String name)
getTextAttributeValues(String)
instead.
This method checks the type of the attribute
that is being queried. Use
getAttributeAsString(String, GoogleBaseAttributeType)
if you would like to get the value of non-string attributes.name
- attribute namepublic java.lang.String getReferenceAttribute(java.lang.String name)
GoogleBaseAttributeType.REFERENCE
.name
- attribute namepublic java.util.List<java.lang.String> getTextAttributeValues(java.lang.String attributeName)
getAttributeAsString(String, GoogleBaseAttributeType)
if you would like to get the value non-string attributes.attributeName
- public java.lang.Float getFloatAttribute(java.lang.String name)
GoogleBaseAttributeType.FLOAT
.name
- attribute namejava.lang.NumberFormatException
- if some value was
found that could not be convertedpublic java.lang.Integer getIntAttribute(java.lang.String name)
GoogleBaseAttributeType.INT
.name
- attribute namejava.lang.NumberFormatException
- if some value was
found that could not be convertedpublic java.lang.Number getNumberAttribute(java.lang.String name)
GoogleBaseAttributeType.NUMBER
.name
- attribute namejava.lang.NumberFormatException
- if some value was
found that could not be convertedpublic java.lang.Boolean getBooleanAttribute(java.lang.String name)
GoogleBaseAttributeType.BOOLEAN
.name
- attribute namepublic DateTime getDateTimeAttribute(java.lang.String name)
GoogleBaseAttributeType.DATE_TIME
.name
- attribute namejava.lang.NumberFormatException
- if some value was
found that could not be convertedpublic DateTime getDateAttribute(java.lang.String name)
GoogleBaseAttributeType.DATE_TIME
and
GoogleBaseAttributeType.DATE
.name
- attribute namejava.lang.NumberFormatException
- if some value was
found that could not be convertedpublic DateTimeRange getDateRangeAttribute(java.lang.String name)
GoogleBaseAttributeType.DATE_TIME
,
GoogleBaseAttributeType.DATE
and
GoogleBaseAttributeType.DATE_TIME_RANGE
.name
- attribute namejava.lang.NumberFormatException
- if some value was
found that could not be convertedpublic java.lang.String getUrlAttribute(java.lang.String name)
GoogleBaseAttributeType.URL
.name
- attribute namepublic NumberUnit<java.lang.Integer> getIntUnitAttribute(java.lang.String name)
GoogleBaseAttributeType.INT_UNIT
.name
- attribute namejava.lang.NumberFormatException
- if some value was
found that could not be convertedpublic NumberUnit<java.lang.Float> getFloatUnitAttribute(java.lang.String name)
GoogleBaseAttributeType.FLOAT_UNIT
.name
- attribute namejava.lang.NumberFormatException
- if some value was
found that could not be convertedpublic NumberUnit<? extends java.lang.Number> getNumberUnitAttribute(java.lang.String name)
GoogleBaseAttributeType.NUMBER_UNIT
,
GoogleBaseAttributeType.INT_UNIT
or
GoogleBaseAttributeType.FLOAT_UNIT
.name
- attribute namejava.lang.NumberFormatException
- if some value was
found that could not be convertedpublic GoogleBaseAttribute addTextAttribute(java.lang.String name, java.lang.String value)
GoogleBaseAttributeType.TEXT
.
This method will never remove an attribute, even if it has
the same name as the new attribute. If you would like to set
an attribute that can only appear once, call
removeAttributes(String, GoogleBaseAttributeType)
first.name
- attribute namevalue
- attribute valuepublic GoogleBaseAttribute addReferenceAttribute(java.lang.String name, java.lang.String value)
GoogleBaseAttributeType.REFERENCE
.
This method will never remove an attribute, even if it has
the same name as the new attribute. If you would like to set
an attribute that can only appear once, call
removeAttributes(String, GoogleBaseAttributeType)
first.name
- attribute namevalue
- attribute valuepublic GoogleBaseAttribute addIntAttribute(java.lang.String name, int value)
GoogleBaseAttributeType.INT
.
This method will never remove an attribute, even if it has
the same name as the new attribute. If you would like to set
an attribute that can only appear once, call
removeAttributes(String, GoogleBaseAttributeType)
first.name
- attribute namevalue
- attribute valuepublic GoogleBaseAttribute addFloatAttribute(java.lang.String name, float value)
GoogleBaseAttributeType.FLOAT
.
This method will never remove an attribute, even if it has
the same name as the new attribute. If you would like to set
an attribute that can only appear once, call
removeAttributes(String, GoogleBaseAttributeType)
first.name
- attribute namevalue
- attribute valuepublic GoogleBaseAttribute addNumberAttribute(java.lang.String name, java.lang.Number value)
GoogleBaseAttributeType.NUMBER
.
This method will never remove an attribute, even if it has
the same name as the new attribute. If you would like to set
an attribute that can only appear once, call
removeAttributes(String, GoogleBaseAttributeType)
first.name
- attribute namevalue
- attribute valuepublic GoogleBaseAttribute addIntUnitAttribute(java.lang.String name, int value, java.lang.String unit)
GoogleBaseAttributeType.INT_UNIT
.
This method will never remove an attribute, even if it has
the same name as the new attribute. If you would like to set
an attribute that can only appear once, call
removeAttributes(String, GoogleBaseAttributeType)
first.name
- attribute namevalue
- unit
- public GoogleBaseAttribute addIntUnitAttribute(java.lang.String name, NumberUnit<java.lang.Integer> value)
GoogleBaseAttributeType.INT_UNIT
.
This method will never remove an attribute, even if it has
the same name as the new attribute. If you would like to set
an attribute that can only appear once, call
removeAttributes(String, GoogleBaseAttributeType)
first.name
- attribute namevalue
- attribute valuepublic GoogleBaseAttribute addFloatUnitAttribute(java.lang.String name, float value, java.lang.String unit)
GoogleBaseAttributeType.FLOAT_UNIT
.
This method will never remove an attribute, even if it has
the same name as the new attribute. If you would like to set
an attribute that can only appear once, call
removeAttributes(String, GoogleBaseAttributeType)
first.name
- attribute namevalue
- unit
- public GoogleBaseAttribute addFloatUnitAttribute(java.lang.String name, NumberUnit<java.lang.Float> value)
GoogleBaseAttributeType.FLOAT_UNIT
.
This method will never remove an attribute, even if it has
the same name as the new attribute. If you would like to set
an attribute that can only appear once, call
removeAttributes(String, GoogleBaseAttributeType)
first.name
- attribute namevalue
- attribute valuepublic GoogleBaseAttribute addNumberUnitAttribute(java.lang.String name, java.lang.Number value, java.lang.String unit)
GoogleBaseAttributeType.NUMBER_UNIT
.
This method will never remove an attribute, even if it has
the same name as the new attribute. If you would like to set
an attribute that can only appear once, call
removeAttributes(String, GoogleBaseAttributeType)
first.name
- attribute namevalue
- unit
- public GoogleBaseAttribute addNumberUnitAttribute(java.lang.String name, NumberUnit<java.lang.Number> value)
GoogleBaseAttributeType.NUMBER_UNIT
.
This method will never remove an attribute, even if it has
the same name as the new attribute. If you would like to set
an attribute that can only appear once, call
removeAttributes(String, GoogleBaseAttributeType)
first.name
- attribute namevalue
- attribute valuepublic GoogleBaseAttribute addDateAttribute(java.lang.String name, DateTime date)
GoogleBaseAttributeType.DATE
.
This method will never remove an attribute, even if it has
the same name as the new attribute. If you would like to set
an attribute that can only appear once, call
removeAttributes(String, GoogleBaseAttributeType)
first.name
- attribute namedate
- attribute valuejava.lang.IllegalArgumentException
- if the attribute value is
not only a date, but a date and a time (see
DateTime.isDateOnly()
)public GoogleBaseAttribute addDateTimeAttribute(java.lang.String name, DateTime dateTime)
GoogleBaseAttributeType.DATE_TIME
.
This method will never remove an attribute, even if it has
the same name as the new attribute. If you would like to set
an attribute that can only appear once, call
removeAttributes(String, GoogleBaseAttributeType)
first.name
- attribute namedateTime
- attribute valuepublic GoogleBaseAttribute addUrlAttribute(java.lang.String name, java.lang.String value)
GoogleBaseAttributeType.URL
.
This method will never remove an attribute, even if it has
the same name as the new attribute. If you would like to set
an attribute that can only appear once, call
removeAttributes(String, GoogleBaseAttributeType)
first.name
- attribute namevalue
- attribute valuepublic GoogleBaseAttribute addBooleanAttribute(java.lang.String name, boolean value)
GoogleBaseAttributeType.BOOLEAN
.
This method will never remove an attribute, even if it has
the same name as the new attribute. If you would like to set
an attribute that can only appear once, call
removeAttributes(String, GoogleBaseAttributeType)
first.name
- attribute namevalue
- attribute valuepublic void addGroupAttribute(java.lang.String groupName, Group group)
public Group getGroupAttribute(java.lang.String name)
Group
.
This method does not check the type of the attribute
that's being queried, it just gets the value and try
and convert it.name
- attribute namepublic java.util.Collection<? extends Group> getGroupAttributes(java.lang.String groupName)
Group
s.
This method does not check the type of the attribute
that's being queried, it just gets the values and try
and convert them.groupName
- the group namepublic Shipping getShippingAttribute(java.lang.String name)
Shipping
.
This method does not check the type of the attribute
that's being queried, it just gets the value and try
and convert it.name
- attribute namejava.lang.NumberFormatException
- if some value was
found that could not be converted.public java.util.List<? extends Shipping> getShippingAttributes(java.lang.String name)
Shipping
s.
This method does not check the type of the attribute
that's being queried, it just gets the values and try
and convert them.name
- attribute namejava.lang.NumberFormatException
- if some value was
found that could not be convertedpublic void addShippingAttribute(java.lang.String name, Shipping shipping)
GoogleBaseAttributeType.SHIPPING
.
This method will never remove an attribute, even if it has
the same name as the new attribute. If you would like to set
an attribute that can only appear once, call
removeAttributes(String, GoogleBaseAttributeType)
first.name
- attribute nameshipping
- attribute valuepublic Tax getTaxAttribute(java.lang.String name)
Tax
.
This method does not check the type of the attribute
that's being queried, it just gets the value and try
and convert it.name
- attribute namejava.lang.NumberFormatException
- if some value was
found that could not be converted.public java.util.List<? extends Tax> getTaxAttributes(java.lang.String name)
Tax
s.
This method does not check the type of the attribute
that's being queried, it just gets the values and try
and convert them.name
- attribute namejava.lang.NumberFormatException
- if some value was
found that could not be convertedpublic void addTaxAttribute(java.lang.String name, Tax tax)
GoogleBaseAttributeType.TAX
.
This method will never remove an attribute, even if it has
the same name as the new attribute. If you would like to set
an attribute that can only appear once, call
removeAttributes(String, GoogleBaseAttributeType)
first.name
- attribute nametax
- attribute valuepublic java.lang.String getLocationAttribute(java.lang.String name)
getLocationAttributeAsObject(String)
instead.name
- attribute namejava.lang.NumberFormatException
- if some value was
found that could not be converted.public Location getLocationAttributeAsObject(java.lang.String name)
name
- attribute namejava.lang.NumberFormatException
- if some value was
found that could not be converted.public java.util.List<? extends java.lang.String> getLocationAttributes(java.lang.String name)
name
- attribute namejava.lang.NumberFormatException
- if some value was
found that could not be convertedpublic java.util.List<Location> getLocationAttributesAsObjects(java.lang.String name)
Location
objects.name
- attribute namejava.lang.NumberFormatException
- if some value was
found that could not be convertedpublic GoogleBaseAttribute addLocationAttribute(java.lang.String name, java.lang.String location)
GoogleBaseAttributeType.LOCATION
.
This method will never remove an attribute, even if it has
the same name as the new attribute. If you would like to set
an attribute that can only appear once, call
removeAttributes(String, GoogleBaseAttributeType)
first.name
- attribute namelocation
- attribute valuepublic GoogleBaseAttribute addLocationAttribute(java.lang.String name, Location location)
GoogleBaseAttributeType.LOCATION
.
This method will never remove an attribute, even if it has
the same name as the new attribute. If you would like to set
an attribute that can only appear once, call
removeAttributes(String, GoogleBaseAttributeType)
first.name
- attribute namelocation
- attribute valuepublic DateTimeRange getDateTimeRangeAttribute(java.lang.String name)
DateTimeRange
.
This method does not check the type of the attribute
that's being queried, it just gets the value and try
and convert it.name
- attribute namejava.lang.NumberFormatException
- if some value was
found that could not be convertedpublic java.util.List<? extends DateTimeRange> getDateTimeRangeAttributes(java.lang.String name)
DateTimeRange
.
This method does not check the type of the attribute
that's being queried, it just gets the values and try
and convert them.name
- attribute namejava.lang.NumberFormatException
- if some value was
found that could not be convertedpublic GoogleBaseAttribute addDateTimeRangeAttribute(java.lang.String name, DateTimeRange dateTimeRange)
GoogleBaseAttributeType.DATE_TIME_RANGE
.
This method will never remove an attribute, even if it has
the same name as the new attribute. If you would like to set
an attribute that can only appear once, call
removeAttributes(String, GoogleBaseAttributeType)
first.name
- attribute namedateTimeRange
- attribute valuejava.lang.IllegalArgumentException
- if the DateTimeRange is an empty
range, in which case addDateTimeAttribute(String,
com.google.gdata.data.DateTime)
should be used instead.public void generate(XmlWriter xmlWriter, ExtensionProfile extensionProfile) throws java.io.IOException
Extension.generate(XmlWriter, ExtensionProfile)
.
This method generates XML code for the attribute in this extension.
It is meant to be called by the Google data library.public XmlParser.ElementHandler getHandler(ExtensionProfile extensionProfile, java.lang.String uri, java.lang.String localName, org.xml.sax.Attributes attributes) throws ParseException, java.io.IOException
Extension.getHandler(ExtensionProfile, String, String, Attributes)
.
This method returns a handler object that can parse an attribute in
the current namespace and add the corresponding GoogleBaseAttribute
into the list.
It is meant to be called by the Google data library.getHandler
in interface Extension
extensionProfile
- extension profileuri
- extension namespacelocalName
- tag name, without the namespace prefixattributes
- tag attributesParseException
- when an unexpected tag or badly-formatted
XML is detectedjava.io.IOException
public java.lang.String getApplication()
public void setApplication(java.lang.String name)
GoogleBaseService#update(java.net.URL,
com.google.gdata.data.BaseEntry)
GoogleBaseService#insert(java.net.URL,
com.google.gdata.data.BaseEntry)
and
GoogleBaseService#batch(java.net.URL,
com.google.gdata.data.BaseFeed)
.name
-