com.ibm.commerce.giftregistry.messaging.programadapter.messagemapper

Class GiftRegistryGenericAttributeNodeHandler

  • java.lang.Object
    • com.ibm.commerce.giftregistry.messaging.programadapter.messagemapper.GiftRegistryGenericAttributeNodeHandler
  • All Implemented Interfaces:
    NodeHandler


    public class GiftRegistryGenericAttributeNodeHandler
    extends java.lang.Object
    implements NodeHandler
    This class handles nodes that represent generic attributes, which are used in a gift registry value object. A generic attribute is a value that can be accessed only by a generic getter BaseVO#get and a generic setter BaseVO#set. In an inbound message, if a tag has attribute "type", then the tag represents a generic attribute. The specified type will be the type of the attribute. For example, suppose there is a tag as follows:
                    <GiftRegistryVO>
                            <NewData type="java.lang.String">
                                    newValue
                            </NewData>
                    </GiftRegistryVO>
     
    Then, we know the <samp>NewData</samp> is a generic attribute in the GiftRegistryVO. Therefore, we can access it by calling get("NewData"), and we can also set it to its container by calling set("NewData", "newValue"). The generic attribute can be either an atomic type, or a type that supports default constructor.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String CLASS_NAME
      Name of the class
      static java.lang.String COPYRIGHT
      IBM copyright notice field.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.Object handle(java.lang.Object parent, java.lang.Object currentNode, java.lang.Object[] params)
      Retrieves the value of a generic attribute, and sets it to its parent object.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
      • CLASS_NAME

        public static final java.lang.String CLASS_NAME
        Name of the class
    • Constructor Detail

      • GiftRegistryGenericAttributeNodeHandler

        public GiftRegistryGenericAttributeNodeHandler()
    • Method Detail

      • handle

        public java.lang.Object handle(java.lang.Object parent,
                                       java.lang.Object currentNode,
                                       java.lang.Object[] params)
                                throws java.lang.Exception
        Retrieves the value of a generic attribute, and sets it to its parent object.
        Specified by:
        handle in interface NodeHandler
        Parameters:
        parent - the parent object that has the generic object
        currentNode - the XML node that represents a generic attribute
        params - always null for this handler
        Returns:
        the value of the given node
        Throws:
        java.lang.Exception