Changes since
the last release

com.ebay.sdk.attributes
Class AttributesMaster

java.lang.Object
  extended by com.ebay.sdk.attributes.AttributesMaster
All Implemented Interfaces:
IAttributesMaster

public class AttributesMaster
extends Object
implements IAttributesMaster

The core implementation of interface IAttributesMaster.

View UML diagram of the class.

Title: AttributesLib for Java

Description:

Copyright: Copyright (c) 2004-2008

Company: eBay Inc.


Constructor Summary
AttributesMaster()
          Constructor.
 
Method Summary
 ICategoryCSProvider getCategoryCSProvider()
          Sets the ICategoryCSProvider object.
 AttributeSet[] getItemSpecificAttributeSetsForCategories(int[] catIds)
          Returns an array of item specific AttributeSet objects for an array category Ids.
 AttributeSet getReturnPolicyAttributeSet(AttributeSet[] siteWideAttrSets)
          Extracts AttributeSet object for Return Policy from site wide attribute sets
 AttributeSet[] getSiteWideAttributeSetsForCategories(int[] catIds)
          Returns an array of Site Wide AttributeSet objects for an array category Ids.
 IAttributesXmlProvider getXmlProvider()
          Sets the IAttributesXmlProvider object.
 IAttributesXslProvider getXslProvider()
          Sets the IAttributesXslProvider object.
 AttributeSet[] joinItemSpecificAndSiteWideAttributeSets(AttributeSet[] itemSpecAttrSets, AttributeSet[] swAttrSets)
          Creates an array of AttributeSet objects which contains item specific attribute sets and site wide attribute sets with the exception of the attribute set for return policy.
 AttributeSet[] nameValuesToAttributeSets(Map nameValues)
          Parse name value pair list to extract AttributeSet objects.
 String renderHtml(AttributeSet[] attrSets, Document xslDoc, ErrorSet[] errorList)
          Render HTML text by specifying list of AttributeSet and xsl Document
 String renderHtml(AttributeSet[] attrSets, ErrorSet[] errorList)
          Render HTML text by specifying list of AttributeSet.
 String renderHtmlForPostback(Map nameValues, ErrorSet[] errorList)
          Render HTML text by raw name-value pairs that you got during HTML submit.
 void setCategoryCSProvider(ICategoryCSProvider categoryCSProvider)
          Gets the ICategoryCSProvider object.
 void setXmlProvider(IAttributesXmlProvider attrXmlProvider)
          Gets the IAttributesXmlProvider object.
 void setXslProvider(IAttributesXslProvider attrXslProvider)
          Gets the IAttributesXslProvider object.
 ErrorSet[] validate(AttributeSet[] attrSets)
          Validate list of AttributeSet objects against eBay Attributes rules.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributesMaster

public AttributesMaster()
Constructor.

Method Detail

getXslProvider

public IAttributesXslProvider getXslProvider()
Sets the IAttributesXslProvider object.

Specified by:
getXslProvider in interface IAttributesMaster
Returns:
IAttributesXslProvider

setXslProvider

public void setXslProvider(IAttributesXslProvider attrXslProvider)
                    throws Exception
Gets the IAttributesXslProvider object.

Specified by:
setXslProvider in interface IAttributesMaster
Parameters:
attrXslProvider - IAttributesXslProvider
Throws:
Exception

getXmlProvider

public IAttributesXmlProvider getXmlProvider()
Sets the IAttributesXmlProvider object.

Specified by:
getXmlProvider in interface IAttributesMaster
Returns:
IAttributesXmlProvider

setXmlProvider

public void setXmlProvider(IAttributesXmlProvider attrXmlProvider)
Gets the IAttributesXmlProvider object.

Specified by:
setXmlProvider in interface IAttributesMaster
Parameters:
xmlProvider - IAttributesXmlProvider

getCategoryCSProvider

public ICategoryCSProvider getCategoryCSProvider()
Sets the ICategoryCSProvider object.

Specified by:
getCategoryCSProvider in interface IAttributesMaster
Returns:
ICategoryCSProvider

setCategoryCSProvider

public void setCategoryCSProvider(ICategoryCSProvider categoryCSProvider)
Gets the ICategoryCSProvider object.

Specified by:
setCategoryCSProvider in interface IAttributesMaster
Parameters:
categoryCSProvider - ICategoryCSProvider

nameValuesToAttributeSets

public AttributeSet[] nameValuesToAttributeSets(Map nameValues)
                                         throws SdkException,
                                                Exception
Parse name value pair list to extract AttributeSet objects. This method is typically used to parse the query string returned from form POST or GET.

Specified by:
nameValuesToAttributeSets in interface IAttributesMaster
Parameters:
nameValues - java.util.Map The parameters map got from query string or post.
Returns:
AttributeSet[]
Throws:
SdkException
Exception

getItemSpecificAttributeSetsForCategories

public AttributeSet[] getItemSpecificAttributeSetsForCategories(int[] catIds)
                                                         throws SdkException,
                                                                Exception
Returns an array of item specific AttributeSet objects for an array category Ids. Each element of the array contains a VCS Id, if it exists for a given category Id.

Specified by:
getItemSpecificAttributeSetsForCategories in interface IAttributesMaster
Parameters:
catIds - int[]
Returns:
AttributeSet[]
Throws:
SdkException
Exception

joinItemSpecificAndSiteWideAttributeSets

public AttributeSet[] joinItemSpecificAndSiteWideAttributeSets(AttributeSet[] itemSpecAttrSets,
                                                               AttributeSet[] swAttrSets)
                                                        throws Exception
Creates an array of AttributeSet objects which contains item specific attribute sets and site wide attribute sets with the exception of the attribute set for return policy.

Specified by:
joinItemSpecificAndSiteWideAttributeSets in interface IAttributesMaster
Parameters:
itemSpecAttrSets - AttributeSet[]
swAttrSets - AttributeSet[]
Returns:
AttributeSet[]
Throws:
Exception
See Also:
getItemSpecificAttributeSetsForCategories(), getSiteWideAttributeSetsForCategories()

getSiteWideAttributeSetsForCategories

public AttributeSet[] getSiteWideAttributeSetsForCategories(int[] catIds)
                                                     throws SdkException,
                                                            Exception
Returns an array of Site Wide AttributeSet objects for an array category Ids. Each element of the array contains a VCS Id, if it exists for a given category Id.

Specified by:
getSiteWideAttributeSetsForCategories in interface IAttributesMaster
Parameters:
catIds - int[]
Returns:
AttributeSet[]
Throws:
SdkException
Exception

renderHtml

public String renderHtml(AttributeSet[] attrSets,
                         Document xslDoc,
                         ErrorSet[] errorList)
                  throws SdkException,
                         Exception
Render HTML text by specifying list of AttributeSet and xsl Document

Specified by:
renderHtml in interface IAttributesMaster
Parameters:
attrSets - AttributeSet[] List of AttributeSet objects.
xslDoc - Document
errorList - ErrorSet[] The list of ErrorSet objects returned by validate method.
Returns:
String The generated HTML text that is encapsulated in HTML table element.
Throws:
SdkException
Exception

getReturnPolicyAttributeSet

public AttributeSet getReturnPolicyAttributeSet(AttributeSet[] siteWideAttrSets)
                                         throws SdkException,
                                                Exception
Extracts AttributeSet object for Return Policy from site wide attribute sets

Specified by:
getReturnPolicyAttributeSet in interface IAttributesMaster
Parameters:
siteWideAttrSets - AttributeSet[] array of site wide AttributeSet objects.
Returns:
AttributeSet for Return Policy
Throws:
SdkException
Exception
See Also:
getSiteWideAttributeSetsForCategories()

renderHtml

public String renderHtml(AttributeSet[] attrSets,
                         ErrorSet[] errorList)
                  throws SdkException,
                         Exception
Render HTML text by specifying list of AttributeSet.

Specified by:
renderHtml in interface IAttributesMaster
Parameters:
attrSets - AttributeSet[] List of AttributeSet objects.
errorList - ErrorSet[] The list of ErrorSet objects returned by validate method.
Returns:
String The generated HTML text that is encapsulated in HTML table element.
Throws:
SdkException
Exception

renderHtmlForPostback

public String renderHtmlForPostback(Map nameValues,
                                    ErrorSet[] errorList)
                             throws SdkException,
                                    Exception
Render HTML text by raw name-value pairs that you got during HTML submit.

Specified by:
renderHtmlForPostback in interface IAttributesMaster
Parameters:
nameValues - java.util.Map List of name-value pairs from submit of attributes HTML form generated by all these RenderHtml methods.
errorList - ErrorSet[] The list of ErrorSet objects returned by validate method.
Returns:
String The generated HTML text that is encapsulated in HTML table element.
Throws:
SdkException
Exception

validate

public ErrorSet[] validate(AttributeSet[] attrSets)
                    throws SdkException,
                           Exception
Validate list of AttributeSet objects against eBay Attributes rules. Returns zero size array means the validation succeeded. Otherwise means failure and you have to call the above RenderHtml... methods and pass in the ErrorSet list to re-generate Attributes HTML text that contains all the error messages.

Specified by:
validate in interface IAttributesMaster
Parameters:
attrSets - AttributeSet[] The list of AttributeSet object which you want to validate.
Returns:
ErrorSet[] Returns zero-size array means the validation succeeded. Otherwise the list of the ErrorSet objects.
Throws:
SdkException
Exception

Changes since
the last release

The information contained in this document is proprietary and confidential. Use of this information and the eBay API requires a Non-Disclosure Agreement (NDA) between the user and eBay Inc. For information regarding a qualifying NDA, contact Developer Relations:developer-relations@ebay.com
© 2004-2006 eBay Inc. All rights reserved.