com.sun.j2ee.blueprints.ui.shopping
Class BuyNowRenderer

java.lang.Object
  extended byjavax.faces.render.Renderer
      extended bycom.sun.j2ee.blueprints.ui.util.BaseRenderer
          extended bycom.sun.j2ee.blueprints.ui.shopping.BuyNowRenderer
Direct Known Subclasses:
BuyNowLinkRenderer

public class BuyNowRenderer
extends BaseRenderer

This renderer generates the appropriate markup to render BuyNowComponent as a button which resides in its own form element.


Field Summary
 
Fields inherited from class com.sun.j2ee.blueprints.ui.util.BaseRenderer
BUNDLE_ATTR
 
Constructor Summary
BuyNowRenderer()
           
 
Method Summary
 void encodeEnd(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
protected  java.lang.String getPostAttributeValue(BuyNowPostData postDataBean, java.beans.PropertyDescriptor pd)
          Returns the value of the property represented by the passed in PropertyDescriptor.
protected  java.beans.PropertyDescriptor[] getPropertyDescriptors()
          Returns all the PropertyDescriptors of BuyNowPostData Bean.
protected  java.lang.String src(javax.faces.context.FacesContext context, java.lang.String image_url)
           
protected  java.lang.String urlEncodeIfNecessary(java.lang.String propertyName, java.lang.String value, javax.faces.context.FacesContext context)
          URL encodes a property value that is specified by PayPal as an attribute that must be URL encoded.
 
Methods inherited from class com.sun.j2ee.blueprints.ui.util.BaseRenderer
componentIsDisabledOnReadonly, convertClientId, encodeRecursive, getKeyAndLookupInBundle, renderBooleanPassThruAttributes, renderPassThruAttributes, renderPassThruAttributes, setupResponseWriter, shouldRenderAttribute
 
Methods inherited from class javax.faces.render.Renderer
decode, encodeBegin, encodeChildren, getConvertedValue, getRendersChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuyNowRenderer

public BuyNowRenderer()
Method Detail

encodeEnd

public void encodeEnd(javax.faces.context.FacesContext context,
                      javax.faces.component.UIComponent component)
               throws java.io.IOException
Throws:
java.io.IOException

src

protected java.lang.String src(javax.faces.context.FacesContext context,
                               java.lang.String image_url)

getPropertyDescriptors

protected java.beans.PropertyDescriptor[] getPropertyDescriptors()
Returns all the PropertyDescriptors of BuyNowPostData Bean.

Returns:
an array of PropertyDescriptors that describe various properties of BuyNowPostData bean.

getPostAttributeValue

protected java.lang.String getPostAttributeValue(BuyNowPostData postDataBean,
                                                 java.beans.PropertyDescriptor pd)
Returns the value of the property represented by the passed in PropertyDescriptor.

Parameters:
postDataBean - JavaBean that encapsulates data that needs to be posted to PayPal
pd - PropertyDescriptor representing a particular property of postDataBean
Returns:
String value of the property represened by the PropertyDescriptor.

urlEncodeIfNecessary

protected java.lang.String urlEncodeIfNecessary(java.lang.String propertyName,
                                                java.lang.String value,
                                                javax.faces.context.FacesContext context)
URL encodes a property value that is specified by PayPal as an attribute that must be URL encoded.

Parameters:
propertyName - property to check if it needs to be URL encoded.
value - value of the property to URL encode if specified by PayPal.
Returns:
String URL encoded property value or null if the property doesn't have to be URL encoded.