|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.api.gbase.client.GoogleBaseAttributesExtension
public class GoogleBaseAttributesExtension
Keeps track of attributes in the g: namespace.
This class extends the Google data API with some knowledge about
the g: (Google Base attributes) namespace.
The attributes are stored in a list as 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)
.
Field Summary | |
---|---|
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_PERCENT_ATTRIBUTE
Attribute <g:tax_percent> . |
static java.lang.String |
TAX_REGION_ATTRIBUTE
Attribute <g:tax_region> . |
Constructor Summary | |
---|---|
GoogleBaseAttributesExtension()
|
Method Summary | |
---|---|
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 |
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 . |
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. |
XmlParser.ElementHandler |
getHandler(ExtensionProfile extensionProfile,
java.lang.String uri,
java.lang.String localName,
org.xml.sax.Attributes attributes)
Implements Extension.getHandler(ExtensionProfile, String, String, 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.lang.Float |
getTaxPercent()
Gets tax percent attribute, or null. |
java.lang.String |
getTaxRegion()
Gets tax region attribute. |
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)
Sets tax percent attribute. |
void |
setTaxRegion(java.lang.String region)
Sets tax region attribute. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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>
.
getItemType()
,
setItemType(String)
,
Constant Field Valuespublic static final java.lang.String EXPIRATION_DATE_ATTRIBUTE
<g:expiration_date>
.
getExpirationDate()
,
setExpirationDate(DateTime)
,
Constant Field Valuespublic static final java.lang.String IMAGE_LINK_ATTRIBUTE
<g:image_link>
.
getImageLink()
,
getImageLinks()
,
addImageLink(String)
,
Constant Field Valuespublic static final java.lang.String PAYMENT_METHOD_ATTRIBUTE
<g:payment_accepted>
.
getPaymentMethods()
,
addPaymentMethod(String)
,
Constant Field Valuespublic static final java.lang.String PRICE_ATTRIBUTE
<g:price>
.
getPrice()
,
setPrice(NumberUnit)
,
setPrice(float, String)
,
Constant Field Valuespublic static final java.lang.String LOCATION_ATTRIBUTE
<g:location>
.
getLocation()
,
setLocation(String)
,
Constant Field Valuespublic static final java.lang.String PRICE_TYPE_ATTRIBUTE
<g:price_type>
.
getPriceType()
,
setPriceType(String)
,
Constant Field Valuespublic 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>
.
getPriceUnits()
,
setPriceUnits(String)
,
Constant Field Valuespublic static final java.lang.String SHIPPING_ATTRIBUTE
<g:shipping>
.
getShipping()
,
addShipping(Shipping)
,
Constant Field Valuespublic static final java.lang.String TAX_PERCENT_ATTRIBUTE
<g:tax_percent>
.
getTaxPercent()
,
setTaxPercent(float)
,
Constant Field Valuespublic static final java.lang.String TAX_REGION_ATTRIBUTE
<g:tax_region>
.
getTaxRegion()
,
setTaxRegion(String)
,
Constant Field Valuespublic static final java.lang.String DELIVERY_RADIUS_ATTRIBUTE
<g:delivery_radius>
.
getDeliveryRadius()
,
setDeliveryRadius(NumberUnit)
,
setDeliveryRadius(float, String)
,
Constant Field Valuespublic 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>
.
getDeliveryNotes()
,
setDeliveryNotes(String)
,
Constant Field Valuespublic static final java.lang.String PAYMENT_NOTES_ATTRIBUTE
<g:payment_notes>
.
getPaymentNotes()
,
setPaymentNotes(String)
,
Constant Field Valuespublic static final java.lang.String APPLICATION_ATTRIBUTE
<g:application>
.
getApplication()
,
setApplication(String)
,
Constant Field Valuespublic static final java.lang.String CUSTOMER_ID
<g:customer_id>
.
getCustomerId()
,
Constant Field ValuesConstructor Detail |
---|
public GoogleBaseAttributesExtension()
Method Detail |
---|
public 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 setTaxPercent(float taxPercent)
public java.lang.Float getTaxPercent()
public void setTaxRegion(java.lang.String region)
public java.lang.String getTaxRegion()
public 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 name
GoogleBaseAttribute
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 type
GoogleBaseAttribute
,
which might be empty but not nullpublic java.util.List<? extends GoogleBaseAttribute> getAttributes(java.lang.String name)
name
- attribute name
GoogleBaseAttribute
,
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 name
public java.lang.String getReferenceAttribute(java.lang.String name)
GoogleBaseAttributeType.REFERENCE
.
name
- attribute name
public 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 name
java.lang.NumberFormatException
- if some value was
found that could not be convertedpublic java.lang.Integer getIntAttribute(java.lang.String name)
GoogleBaseAttributeType.INT
.
name
- attribute name
java.lang.NumberFormatException
- if some value was
found that could not be convertedpublic java.lang.Number getNumberAttribute(java.lang.String name)
GoogleBaseAttributeType.NUMBER
.
name
- attribute name
java.lang.NumberFormatException
- if some value was
found that could not be convertedpublic java.lang.Boolean getBooleanAttribute(java.lang.String name)
GoogleBaseAttributeType.BOOLEAN
.
name
- attribute name
public DateTime getDateTimeAttribute(java.lang.String name)
GoogleBaseAttributeType.DATE_TIME
.
name
- attribute name
java.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 name
java.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 name
java.lang.NumberFormatException
- if some value was
found that could not be convertedpublic java.lang.String getUrlAttribute(java.lang.String name)
GoogleBaseAttributeType.URL
.
name
- attribute name
public NumberUnit<java.lang.Integer> getIntUnitAttribute(java.lang.String name)
GoogleBaseAttributeType.INT_UNIT
.
name
- attribute name
java.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 name
java.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 name
java.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 value
public 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 value
public 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 value
public 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 value
public 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 value
public 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 value
public 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 value
public 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 value
public 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 value
java.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 value
public 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 value
public 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 value
public 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 name
java.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 name
java.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 java.lang.String getLocationAttribute(java.lang.String name)
getLocationAttributeAsObject(String)
instead.
name
- attribute name
java.lang.NumberFormatException
- if some value was
found that could not be converted.public Location getLocationAttributeAsObject(java.lang.String name)
name
- attribute name
java.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 name
java.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 name
java.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 value
public 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 value
public 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 name
java.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 name
java.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 value
java.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.
generate
in interface Extension
xmlWriter
- extensionProfile
-
java.io.IOException
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 attributes
ParseException
- when an unexpected tag or badly-formatted
XML is detected
java.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
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |