public class GoogleBaseAttributesExtension extends Object implements Extension
GoogleBaseAttributes
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 String |
APPLICATION_ATTRIBUTE
Attribute
<g:application>. |
static String |
CUSTOMER_ID
Attribute
<g:customer_id>. |
static String |
DELIVERY_NOTES_ATTRIBUTE
Attribute
<g:delivery_notes>. |
static String |
DELIVERY_RADIUS_ATTRIBUTE
Attribute
<g:delivery_radius>. |
static ExtensionDescription |
DESCRIPTION
A description for this extension, to pass to an
ExtensionProfile. |
static String |
EXPIRATION_DATE_ATTRIBUTE
Attribute
<g:expiration_date>. |
static String |
IMAGE_LINK_ATTRIBUTE
Attribute
<g:image_link>. |
static String |
ITEM_TYPE_ATTRIBUTE
Attribute
<g:item_type>. |
static String |
LABEL_ATTRIBUTE
Attribute
<g:label>. |
static String |
LOCATION_ATTRIBUTE
Attribute
<g:location>. |
static String |
PAYMENT_METHOD_ATTRIBUTE
Attribute
<g:payment_accepted>. |
static String |
PAYMENT_NOTES_ATTRIBUTE
Attribute
<g:payment_notes>. |
static String |
PICKUP_ATTRIBUTE
Attribute
<g:pickup>. |
static String |
PRICE_ATTRIBUTE
Attribute
<g:price>. |
static String |
PRICE_TYPE_ATTRIBUTE
Attribute
<g:price_type>. |
static String |
PRICE_UNITS_ATTRIBUTE
Attribute
<g:price_units>. |
static String |
QUANTITY_ATTRIBUTE
Attribute
<g:quantity>. |
static String |
SHIPPING_ATTRIBUTE
Attribute
<g:shipping>. |
static String |
TAX_ATTRIBUTE
Attribute
<g:tax>. |
static String |
TAX_PERCENT_ATTRIBUTE
Deprecated.
use
TAX_ATTRIBUTE instead |
static 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(String name,
boolean value)
Adds an attribute of type
GoogleBaseAttributeType.BOOLEAN. |
GoogleBaseAttribute |
addDateAttribute(String name,
DateTime date)
Adds an attribute of type
GoogleBaseAttributeType.DATE. |
GoogleBaseAttribute |
addDateTimeAttribute(String name,
DateTime dateTime)
Adds an attribute of type
GoogleBaseAttributeType.DATE_TIME. |
GoogleBaseAttribute |
addDateTimeRangeAttribute(String name,
DateTimeRange dateTimeRange)
Adds an attribute of type
GoogleBaseAttributeType.DATE_TIME_RANGE. |
GoogleBaseAttribute |
addFloatAttribute(String name,
float value)
Adds an attribute of type
GoogleBaseAttributeType.FLOAT. |
GoogleBaseAttribute |
addFloatUnitAttribute(String name,
float value,
String unit)
Adds an attribute of type
GoogleBaseAttributeType.FLOAT_UNIT. |
GoogleBaseAttribute |
addFloatUnitAttribute(String name,
NumberUnit<Float> value)
Adds an attribute of type
GoogleBaseAttributeType.FLOAT_UNIT. |
void |
addGroupAttribute(String groupName,
Group group)
Adds group attribute.
|
void |
addImageLink(String link)
Adds an image URL.
|
GoogleBaseAttribute |
addIntAttribute(String name,
int value)
Adds an attribute of type
GoogleBaseAttributeType.INT. |
GoogleBaseAttribute |
addIntUnitAttribute(String name,
int value,
String unit)
Adds an attribute of type
GoogleBaseAttributeType.INT_UNIT. |
GoogleBaseAttribute |
addIntUnitAttribute(String name,
NumberUnit<Integer> value)
Adds an attribute of type
GoogleBaseAttributeType.INT_UNIT. |
void |
addLabel(String value)
Adds a label to the entry.
|
GoogleBaseAttribute |
addLocationAttribute(String name,
Location location)
Adds an attribute of type
GoogleBaseAttributeType.LOCATION. |
GoogleBaseAttribute |
addLocationAttribute(String name,
String location)
Adds an attribute of type
GoogleBaseAttributeType.LOCATION. |
GoogleBaseAttribute |
addNumberAttribute(String name,
Number value)
Adds an attribute of type
GoogleBaseAttributeType.NUMBER. |
GoogleBaseAttribute |
addNumberUnitAttribute(String name,
Number value,
String unit)
Adds an attribute of type
GoogleBaseAttributeType.NUMBER_UNIT. |
GoogleBaseAttribute |
addNumberUnitAttribute(String name,
NumberUnit<Number> value)
Adds an attribute of type
GoogleBaseAttributeType.NUMBER_UNIT. |
void |
addPaymentMethod(String method)
Adds an accepted payment method.
|
GoogleBaseAttribute |
addReferenceAttribute(String name,
String value)
Adds an attribute of type
GoogleBaseAttributeType.REFERENCE. |
void |
addShipping(Shipping shipping)
Adds shipping attribute.
|
void |
addShippingAttribute(String name,
Shipping shipping)
Adds an attribute of type
GoogleBaseAttributeType.SHIPPING. |
void |
addTax(Tax tax)
Adds tax attribute.
|
void |
addTaxAttribute(String name,
Tax tax)
Adds an attribute of type
GoogleBaseAttributeType.TAX. |
GoogleBaseAttribute |
addTextAttribute(String name,
String value)
Adds an attribute of type
GoogleBaseAttributeType.TEXT. |
GoogleBaseAttribute |
addUrlAttribute(String name,
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). |
String |
getApplication()
Gets the application attribute.
|
GoogleBaseAttribute |
getAttribute(String name)
Gets the first attribute with a certain name.
|
GoogleBaseAttribute |
getAttribute(String name,
GoogleBaseAttributeType type)
Gets the first attribute with a certain name and type.
|
List<? extends GoogleBaseAttribute> |
getAttributes()
Gets a list of all the attributes available in the extension
namespace at the current
ExtensionPoint. |
List<? extends GoogleBaseAttribute> |
getAttributes(String name)
Gets all the attributes with a certain name and type.
|
List<? extends GoogleBaseAttribute> |
getAttributes(String name,
GoogleBaseAttributeType type)
Gets all the attributes with a certain name and type.
|
Boolean |
getBooleanAttribute(String name)
Gets the first value of a specific attribute, as an Boolean.
|
Integer |
getCustomerId() |
DateTime |
getDateAttribute(String name)
Gets the first value of a specific attribute, as a date.
|
DateTimeRange |
getDateRangeAttribute(String name)
Gets the first value of a specific attribute, as a date/dateTime
range.
|
DateTime |
getDateTimeAttribute(String name)
Gets the first value of a specific attribute, as a date and a time.
|
DateTimeRange |
getDateTimeRangeAttribute(String name)
Gets the first value of a specific attribute, as a
DateTimeRange. |
List<? extends DateTimeRange> |
getDateTimeRangeAttributes(String name)
Gets all the values of a specific attribute, as a list of
DateTimeRange. |
String |
getDeliveryNotes()
Gets delivery notes attribute
|
NumberUnit<Float> |
getDeliveryRadius()
Gets delivery radius.
|
DateTime |
getExpirationDate()
Gets the date and time at which the entry expires.
|
Float |
getFloatAttribute(String name)
Gets the first value of a specific attribute, as a Float.
|
NumberUnit<Float> |
getFloatUnitAttribute(String name)
Gets the first value of a specific attribute, as an float,
followed by a unit name.
|
Group |
getGroupAttribute(String name)
Gets the first value of a specific attribute, as a
Group. |
Collection<? extends Group> |
getGroupAttributes(String groupName)
Gets all the values of a specific attribute, as a collection of
Groups. |
XmlParser.ElementHandler |
getHandler(ExtensionProfile extensionProfile,
String uri,
String localName,
Attributes attributes)
|
String |
getImageLink()
Gets the first URL to an image representing this item.
|
List<? extends String> |
getImageLinks()
Gets all URLs to images representing this item.
|
Integer |
getIntAttribute(String name)
Gets the first value of a specific attribute, as an Integer.
|
NumberUnit<Integer> |
getIntUnitAttribute(String name)
Gets the first value of a specific attribute, as an integer,
followed by a unit name.
|
String |
getItemType()
Gets the item type.
|
Collection<? extends String> |
getLabels()
Gets the labels set for the entry.
|
String |
getLocation()
Gets the location.
|
String |
getLocationAttribute(String name)
Gets the first value of a specific location attribute, as an
address.
|
Location |
getLocationAttributeAsObject(String name)
Gets the first value of a specific location attribute, as a
location object.
|
List<? extends String> |
getLocationAttributes(String name)
Gets all the values of a specific location attribute, as a list of
strings.
|
List<Location> |
getLocationAttributesAsObjects(String name)
Gets all the values of a specific attribute, as a list of
Location objects. |
Number |
getNumberAttribute(String name)
Gets the first value of a specific attribute, as a Number.
|
NumberUnit<? extends Number> |
getNumberUnitAttribute(String name)
Gets the first value of a specific attribute, as a Number,
followed by a unit name.
|
Collection<? extends String> |
getPaymentMethods()
Gets a collection of accepted payment methods (Cash, WireTransfer, ...).
|
String |
getPaymentNotes()
Gets payment notes attribute
|
Boolean |
getPickup()
Gets pickup attribute, or null.
|
NumberUnit<Float> |
getPrice()
Gets the price of the item.
|
String |
getPriceType()
Gets price type.
|
String |
getPriceUnits()
Gets price units.
|
Integer |
getQuantity()
Gets quantity, or null if not set.
|
String |
getReferenceAttribute(String name)
Gets the first value of a specific reference attribute.
|
Collection<? extends Shipping> |
getShipping()
Gets shipping attributes.
|
Shipping |
getShippingAttribute(String name)
Gets the first value of a specific attribute, as a
Shipping. |
List<? extends Shipping> |
getShippingAttributes(String name)
Gets all the values of a specific attribute, as a list of
Shippings. |
Collection<? extends Tax> |
getTax()
Gets tax attributes.
|
Tax |
getTaxAttribute(String name)
Gets the first value of a specific attribute, as a
Tax. |
List<? extends Tax> |
getTaxAttributes(String name)
Gets all the values of a specific attribute, as a list of
Taxs. |
Float |
getTaxPercent()
Deprecated.
use
getTax() instead |
String |
getTaxRegion()
Deprecated.
use
getTax() instead |
String |
getTextAttribute(String name)
Gets the first value of a specific attribute, as a string.
|
List<String> |
getTextAttributeValues(String attributeName)
Gets all the values of a specific attribute, as a list
of strings.
|
String |
getUrlAttribute(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(String name)
Removes all attributes with a certain name from the list.
|
void |
removeAttributes(String name,
GoogleBaseAttributeType type)
Removes all attributes with a certain name and
type from the list.
|
void |
setApplication(String name)
Sets the application attribute.
|
void |
setDeliveryNotes(String notes)
Sets delivery notes attribute.
|
void |
setDeliveryRadius(float value,
String unit)
Sets delivery radius.
|
void |
setDeliveryRadius(NumberUnit<Float> value)
Sets delivery radius.
|
void |
setExpirationDate(DateTime date)
Sets the date at which the entry expires.
|
void |
setItemType(String value)
Sets the item type.
|
void |
setLocation(String value)
Sets the location.
|
void |
setPaymentNotes(String notes)
Sets payment notes attribute.
|
void |
setPickup(boolean pickup)
Sets pickup attribute.
|
void |
setPrice(float value,
String currency)
Sets the price of the item.
|
void |
setPrice(NumberUnit<Float> value)
Sets the price of the item.
|
void |
setPriceType(String type)
Sets price type.
|
void |
setPriceUnits(String value)
Sets price units.
|
void |
setQuantity(int value)
Sets quantity.
|
void |
setTaxPercent(float taxPercent)
Deprecated.
use
addTax(Tax) instead |
void |
setTaxRegion(String region)
Deprecated.
use
addTax(Tax) instead |
public static final ExtensionDescription DESCRIPTION
ExtensionProfile.public static final String LABEL_ATTRIBUTE
<g:label>.getLabels(),
addLabel(String),
Constant Field Valuespublic static final String ITEM_TYPE_ATTRIBUTE
<g:item_type>.public static final String EXPIRATION_DATE_ATTRIBUTE
<g:expiration_date>.public static final String IMAGE_LINK_ATTRIBUTE
<g:image_link>.public static final String PAYMENT_METHOD_ATTRIBUTE
<g:payment_accepted>.public static final String PRICE_ATTRIBUTE
<g:price>.public static final String LOCATION_ATTRIBUTE
<g:location>.public static final String PRICE_TYPE_ATTRIBUTE
<g:price_type>.public static final String QUANTITY_ATTRIBUTE
<g:quantity>.getQuantity(),
setQuantity(int),
Constant Field Valuespublic static final String PRICE_UNITS_ATTRIBUTE
<g:price_units>.public static final String SHIPPING_ATTRIBUTE
<g:shipping>.public static final String TAX_ATTRIBUTE
<g:tax>.getTax(),
addTax(Tax),
Constant Field Values@Deprecated public static final String TAX_PERCENT_ATTRIBUTE
TAX_ATTRIBUTE instead<g:tax_percent>.getTax(),
addTax(Tax),
Constant Field Values@Deprecated public static final String TAX_REGION_ATTRIBUTE
TAX_ATTRIBUTE instead<g:tax_region>.getTax(),
addTax(Tax),
Constant Field Valuespublic static final String DELIVERY_RADIUS_ATTRIBUTE
<g:delivery_radius>.public static final String PICKUP_ATTRIBUTE
<g:pickup>.getPickup(),
setPickup(boolean),
Constant Field Valuespublic static final String DELIVERY_NOTES_ATTRIBUTE
<g:delivery_notes>.public static final String PAYMENT_NOTES_ATTRIBUTE
<g:payment_notes>.public static final String APPLICATION_ATTRIBUTE
<g:application>.public static final String CUSTOMER_ID
<g:customer_id>.getCustomerId(),
Constant Field Valuespublic Collection<? extends String> getLabels()
public void addLabel(String value)
value - public String getItemType()
public void setItemType(String value)
public DateTime getExpirationDate()
public void setExpirationDate(DateTime date)
public String getImageLink()
public List<? extends String> getImageLinks()
public void addImageLink(String link)
public Collection<? extends String> getPaymentMethods()
public void addPaymentMethod(String method)
public NumberUnit<Float> getPrice()
public void setPrice(NumberUnit<Float> value)
value - public void setPrice(float value,
String currency)
value - currency - public String getLocation()
public void setLocation(String value)
public void setPriceType(String type)
public String getPriceType()
public void setQuantity(int value)
public Integer getQuantity()
public void setPriceUnits(String value)
public String getPriceUnits()
public void addShipping(Shipping shipping)
public Collection<? extends Shipping> getShipping()
public void addTax(Tax tax)
public Collection<? extends Tax> getTax()
@Deprecated public void setTaxPercent(float taxPercent)
addTax(Tax) instead@Deprecated public Float getTaxPercent()
getTax() instead@Deprecated public void setTaxRegion(String region)
addTax(Tax) instead@Deprecated public String getTaxRegion()
getTax() insteadpublic void setDeliveryRadius(float value,
String unit)
public void setDeliveryRadius(NumberUnit<Float> value)
public NumberUnit<Float> getDeliveryRadius()
public void setPickup(boolean pickup)
public Boolean getPickup()
public void setDeliveryNotes(String notes)
public String getDeliveryNotes()
public void setPaymentNotes(String notes)
public String getPaymentNotes()
public Integer getCustomerId()
public List<? extends GoogleBaseAttribute> getAttributes()
ExtensionPoint.
Attributes might be repeated.GoogleBaseAttribute,
which might be empty but not nullpublic GoogleBaseAttribute getAttribute(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(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 List<? extends GoogleBaseAttribute> getAttributes(String name, GoogleBaseAttributeType type)
name - attribute nametype - attribute type, null to ignore the typeGoogleBaseAttribute,
which might be empty but not nullpublic List<? extends GoogleBaseAttribute> getAttributes(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(String name)
name - name of the attributes that should be removedpublic void removeAttributes(String name, GoogleBaseAttributeType type)
name - name of the attributes that should be removedtype - attribute type, null to ignore the typepublic void clearAttributes()
public String getTextAttribute(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 String getReferenceAttribute(String name)
GoogleBaseAttributeType.REFERENCE.name - attribute namepublic List<String> getTextAttributeValues(String attributeName)
getAttributeAsString(String, GoogleBaseAttributeType)
if you would like to get the value non-string attributes.attributeName - public Float getFloatAttribute(String name)
GoogleBaseAttributeType.FLOAT.name - attribute nameNumberFormatException - if some value was
found that could not be convertedpublic Integer getIntAttribute(String name)
GoogleBaseAttributeType.INT.name - attribute nameNumberFormatException - if some value was
found that could not be convertedpublic Number getNumberAttribute(String name)
GoogleBaseAttributeType.NUMBER.name - attribute nameNumberFormatException - if some value was
found that could not be convertedpublic Boolean getBooleanAttribute(String name)
GoogleBaseAttributeType.BOOLEAN.name - attribute namepublic DateTime getDateTimeAttribute(String name)
GoogleBaseAttributeType.DATE_TIME.name - attribute nameNumberFormatException - if some value was
found that could not be convertedpublic DateTime getDateAttribute(String name)
GoogleBaseAttributeType.DATE_TIME and
GoogleBaseAttributeType.DATE.name - attribute nameNumberFormatException - if some value was
found that could not be convertedpublic DateTimeRange getDateRangeAttribute(String name)
GoogleBaseAttributeType.DATE_TIME,
GoogleBaseAttributeType.DATE and
GoogleBaseAttributeType.DATE_TIME_RANGE.name - attribute nameNumberFormatException - if some value was
found that could not be convertedpublic String getUrlAttribute(String name)
GoogleBaseAttributeType.URL.name - attribute namepublic NumberUnit<Integer> getIntUnitAttribute(String name)
GoogleBaseAttributeType.INT_UNIT.name - attribute nameNumberFormatException - if some value was
found that could not be convertedpublic NumberUnit<Float> getFloatUnitAttribute(String name)
GoogleBaseAttributeType.FLOAT_UNIT.name - attribute nameNumberFormatException - if some value was
found that could not be convertedpublic NumberUnit<? extends Number> getNumberUnitAttribute(String name)
GoogleBaseAttributeType.NUMBER_UNIT,
GoogleBaseAttributeType.INT_UNIT or
GoogleBaseAttributeType.FLOAT_UNIT.name - attribute nameNumberFormatException - if some value was
found that could not be convertedpublic GoogleBaseAttribute addTextAttribute(String name, 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(String name, 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(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(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(String name, 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(String name, int value, 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(String name, NumberUnit<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(String name, float value, 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(String name, NumberUnit<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(String name, Number value, 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(String name, NumberUnit<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(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 valueIllegalArgumentException - if the attribute value is
not only a date, but a date and a time (see
DateTime.isDateOnly())public GoogleBaseAttribute addDateTimeAttribute(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(String name, 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(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(String groupName, Group group)
public Group getGroupAttribute(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 Collection<? extends Group> getGroupAttributes(String groupName)
Groups.
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(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 nameNumberFormatException - if some value was
found that could not be converted.public List<? extends Shipping> getShippingAttributes(String name)
Shippings.
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 nameNumberFormatException - if some value was
found that could not be convertedpublic void addShippingAttribute(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(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 nameNumberFormatException - if some value was
found that could not be converted.public List<? extends Tax> getTaxAttributes(String name)
Taxs.
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 nameNumberFormatException - if some value was
found that could not be convertedpublic void addTaxAttribute(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 String getLocationAttribute(String name)
getLocationAttributeAsObject(String)
instead.name - attribute nameNumberFormatException - if some value was
found that could not be converted.public Location getLocationAttributeAsObject(String name)
name - attribute nameNumberFormatException - if some value was
found that could not be converted.public List<? extends String> getLocationAttributes(String name)
name - attribute nameNumberFormatException - if some value was
found that could not be convertedpublic List<Location> getLocationAttributesAsObjects(String name)
Location objects.name - attribute nameNumberFormatException - if some value was
found that could not be convertedpublic GoogleBaseAttribute addLocationAttribute(String name, 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(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(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 nameNumberFormatException - if some value was
found that could not be convertedpublic List<? extends DateTimeRange> getDateTimeRangeAttributes(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 nameNumberFormatException - if some value was
found that could not be convertedpublic GoogleBaseAttribute addDateTimeRangeAttribute(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 valueIllegalArgumentException - 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 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 ExtensionxmlWriter - extensionProfile - IOExceptionpublic XmlParser.ElementHandler getHandler(ExtensionProfile extensionProfile, String uri, String localName, Attributes attributes) throws ParseException, 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 ExtensionextensionProfile - extension profileuri - extension namespacelocalName - tag name, without the namespace prefixattributes - tag attributesParseException - when an unexpected tag or badly-formatted
XML is detectedIOExceptionpublic String getApplication()
public void setApplication(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 - Copyright © 2012. All Rights Reserved.