com.ibm.commerce.component.servicemapper

Class BODFactory

  • java.lang.Object
    • org.apache.commons.jxpath.AbstractFactory
      • com.ibm.commerce.component.servicemapper.BODFactory


  • public class BODFactory
    extends org.apache.commons.jxpath.AbstractFactory
    This class provides logic of how the objects in a noun can be created by JXPath. The noun should be a JavaBean with the following exceptions:
    • List is supported for indexed properties. A noun can has a List property, such as setProp(List prop) and getProp(List prop). In this case, the noun must provide an indexedProperty so that the factory knows what type will be contained in the list. For example, getProp(index, GiftRegistryVO noun) indicates that the list contains GiftRegistryVO. Either a read property or a write property will be ok.
    • The indexed property may has no corresponding regular property. In this case, the indexed property should able to add the set property even when the underline array is out of bound.
    See Also:
    AbstractFactory
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM copyright notice field.
    • Constructor Summary

      Constructors 
      Constructor and Description
      BODFactory()
      Constructs a factory
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean createObject(org.apache.commons.jxpath.JXPathContext context, org.apache.commons.jxpath.Pointer pointer, java.lang.Object parent, java.lang.String name, int index)
      Creates an object that is corresponding to the JavaBean property parent.name.
      java.lang.Class getNounType()
      Gets the type of the noun for the converted BusinessObjectDocument
      void setNounType(java.lang.Class nounType)
      Sets the type of the noun this factory currently is handling
      • Methods inherited from class org.apache.commons.jxpath.AbstractFactory

        declareVariable
      • 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
    • Constructor Detail

      • BODFactory

        public BODFactory()
        Constructs a factory
    • Method Detail

      • setNounType

        public void setNounType(java.lang.Class nounType)
        Sets the type of the noun this factory currently is handling
        Parameters:
        nounType - the type of the noun the factory is creating object for
      • getNounType

        public java.lang.Class getNounType()
        Gets the type of the noun for the converted BusinessObjectDocument
        Returns:
        the type of the noun
      • createObject

        public boolean createObject(org.apache.commons.jxpath.JXPathContext context,
                                    org.apache.commons.jxpath.Pointer pointer,
                                    java.lang.Object parent,
                                    java.lang.String name,
                                    int index)
        Creates an object that is corresponding to the JavaBean property parent.name. The property may be a List, an array, or an indexed property. In this case, the underline collection of property will always be expanded to size index+1. Then, the property indexed by the given index can be stored. For example, if the index is 6, then corresponding get() will return a list or an array of size 7. The 7th element will be created. All the unset element will be filled with null for list and array, as placeholders. it is the ServiceMapper user's responsibility to make sure they are able to handle those placeholders.
        Overrides:
        createObject in class org.apache.commons.jxpath.AbstractFactory
        Parameters:
        context - the context of the JXPath
        pointer - the Pointer that points to the current property to be created.
        parent - the parent of the property to be created
        name - the name of the property
        index - the index of the property, if the property is in a collection.
        See Also:
        AbstractFactory.createObject(org.apache.commons.jxpath.JXPathContext, org.apache.commons.jxpath.Pointer, java.lang.Object, java.lang.String, int)