com.google.code.facebookapi
Class MarketListing

java.lang.Object
  extended by com.google.code.facebookapi.MarketListing
Direct Known Subclasses:
MarketplaceListing

public class MarketListing
extends java.lang.Object

A utility class for creating and verifying marketplace listings. For details visit http://wiki.developers.facebook.com/index.php/Marketplace_Listing_Attributes


Field Summary
protected  org.json.JSONObject attribs
           
protected static java.lang.String CATEGORY_ATTRIB
           
static java.lang.String CONDITION_ANY
          Specifies a condition of 'any'
static java.lang.String CONDITION_NEW
          Specifies a condition of 'new'
static java.lang.String CONDITION_USED
          Specified a condition of 'used'
protected static java.lang.String DESCRIPTION_ATTRIB
           
protected static org.apache.commons.logging.Log log
           
protected static java.lang.String SUBCATEGORY_ATTRIB
           
protected static java.lang.String TITLE_ATTRIB
           
 
Constructor Summary
MarketListing(java.lang.String title, java.lang.String description, MarketListingCategory category, MarketListingSubcategory subcategory)
          Constructor.
 
Method Summary
 java.lang.String getAttribute(java.lang.String name)
          Retrieve the value of the specified attribute.
 java.lang.String getCategory()
           
 java.lang.String getDescription()
           
 java.lang.String getSubCategory()
           
 java.lang.String getTitle()
           
 void removeAttribute(java.lang.CharSequence attr)
          Remove an attribute from this listing.
 void setAttribute(java.lang.String name, java.lang.String value)
          Set an attribute for this listing.
 void setCategory(java.lang.String category)
          Set the category of the listing
 void setDescription(java.lang.String description)
          Set the listing description.
 void setSubCategory(java.lang.String subCategory)
          Set the subcategory of the listing
 void setTitle(java.lang.String title)
          Set the listing title.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log

CONDITION_ANY

public static final java.lang.String CONDITION_ANY
Specifies a condition of 'any'

See Also:
Constant Field Values

CONDITION_NEW

public static final java.lang.String CONDITION_NEW
Specifies a condition of 'new'

See Also:
Constant Field Values

CONDITION_USED

public static final java.lang.String CONDITION_USED
Specified a condition of 'used'

See Also:
Constant Field Values

CATEGORY_ATTRIB

protected static final java.lang.String CATEGORY_ATTRIB
See Also:
Constant Field Values

SUBCATEGORY_ATTRIB

protected static final java.lang.String SUBCATEGORY_ATTRIB
See Also:
Constant Field Values

TITLE_ATTRIB

protected static final java.lang.String TITLE_ATTRIB
See Also:
Constant Field Values

DESCRIPTION_ATTRIB

protected static final java.lang.String DESCRIPTION_ATTRIB
See Also:
Constant Field Values

attribs

protected org.json.JSONObject attribs
Constructor Detail

MarketListing

public MarketListing(java.lang.String title,
                     java.lang.String description,
                     MarketListingCategory category,
                     MarketListingSubcategory subcategory)
Constructor.

Parameters:
title - the title of the listing, always required.
description - the listing description, always required.
category - the listing category, always required.
subcategory - the listing subcategory, always required.
Method Detail

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.String value)
Set an attribute for this listing. Attributes are used to specify optional listing information (for example, 'price', 'isbn', 'condition', etc.). The specific attributes required by Facebook vary depending upon the category of listing being posted. For more details, visit: http://wiki.developers.facebook.com/index.php/Marketplace_Listing_Attributes

Parameters:
name - the name of the attribute to set
value - the value to set

getAttribute

public java.lang.String getAttribute(java.lang.String name)
Retrieve the value of the specified attribute.

Parameters:
name - the name of the attribute to lookup.
Returns:
the value of the specified attribute, or null if it is not set.

setCategory

public void setCategory(java.lang.String category)
Set the category of the listing

Parameters:
category - the category to set

getCategory

public java.lang.String getCategory()
Returns:
the listing category.

setSubCategory

public void setSubCategory(java.lang.String subCategory)
Set the subcategory of the listing

Parameters:
subCategory - the subcategory to set

getSubCategory

public java.lang.String getSubCategory()
Returns:
the listing subcategory.

setTitle

public void setTitle(java.lang.String title)
Set the listing title.

Parameters:
title - the title to set.

getTitle

public java.lang.String getTitle()
Returns:
the listing title.

setDescription

public void setDescription(java.lang.String description)
Set the listing description.

Parameters:
description - the description to set.

getDescription

public java.lang.String getDescription()
Returns:
the listing description.

removeAttribute

public void removeAttribute(java.lang.CharSequence attr)
Remove an attribute from this listing.

Parameters:
attr - the attribute to remove.


Copyright © 2010. All Rights Reserved.