org.openeai.layouts
Class XmlLayout


java.lang.Object

  |

  +--org.openeai.OpenEaiObject

        |

        +--org.openeai.layouts.EnterpriseLayoutManagerImpl

              |

              +--org.openeai.layouts.XmlLayout

All Implemented Interfaces:
EnterpriseLayoutManager

public class XmlLayout
extends EnterpriseLayoutManagerImpl
implements EnterpriseLayoutManager

This is the default Layout manager that all Enterprise Messaging Objects use to build themselves from and serialize themselves to XML. It uses information found in the EnterpriseObjects documents to determine the layout corresponding to a particular object.

Version:
3.0 beta2 - 28 January 2003
Author:
Tod Jackson (tod@openeai.org), Steve Wheat (steve@openeai.org)

Field Summary
 
Fields inherited from class org.openeai.OpenEaiObject
logger
 
Constructor Summary
XmlLayout()
          Constructor
 
Method Summary
 void buildObjectFromInput(java.lang.Object input, XmlEnterpriseObject xeo)
          This is the buildObjectFromInput method that all Layout Managers must implement.
 java.lang.Object buildOutputFromObject(XmlEnterpriseObject xeo)
          This is the buildOutputFromObject method that all Layout Managers must implement.
 java.lang.Object buildOutputFromObject(XmlEnterpriseObject anXmlEnterpriseObject, java.lang.String appName)
          This is the buildOutputFromObject method that all Layout Managers must implement.
 void init(java.lang.String layoutManagerName, org.jdom.Document layoutDoc)
          Method used to initialize the LayoutMangager implementation with information found in the EnterpriseObjects document associated to the object being initialized.
 
Methods inherited from class org.openeai.layouts.EnterpriseLayoutManagerImpl
getEnterpriseObjectsUri, getFieldLayout, getLayout, getLayout, getLayoutManagerName, getLayoutRoot, getLength, getTargetAppName, getValueFromObject, getValueFromObject, getValueFromObject, getValueFromObject, instantiate, isDate, isRepeating, isRequired, setEnterpriseObjectsUri, setLayout, setLayoutManagerName, setLayoutRoot, setTargetAppName, setVariableValue, setVariableValue
 
Methods inherited from class org.openeai.OpenEaiObject
addLog4jProperty, getAppName, getDebug, getFromAddr, getLog4jProperties, getMailHost, getMailService, getProperties, getToAddr, initializeLog4j, initializeLog4j, initializeLog4j, setAppName, setDebug, setFromAddr, setMailHost, setMailService, setProperties, setToAddr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openeai.layouts.EnterpriseLayoutManager
getEnterpriseObjectsUri, getLayoutManagerName, getLayoutRoot, setEnterpriseObjectsUri, setLayoutManagerName
 

Constructor Detail

XmlLayout


public XmlLayout()
Constructor

Method Detail

init


public void init(java.lang.String layoutManagerName,
                 org.jdom.Document layoutDoc)
          throws EnterpriseLayoutException
Description copied from interface: EnterpriseLayoutManager
Method used to initialize the LayoutMangager implementation with information found in the EnterpriseObjects document associated to the object being initialized. The layoutmanager implementation retrieves information from the EnterpriseObjects document to tell it how the object should be built from an input and serialized to an output.

Specified by:
init in interface EnterpriseLayoutManager
Overrides:
init in class EnterpriseLayoutManagerImpl
Throws:
EnterpriseLayoutException - if any errors occur initializing the layout manager implementation.

buildOutputFromObject


public java.lang.Object buildOutputFromObject(XmlEnterpriseObject xeo)
                                       throws EnterpriseLayoutException
This is the buildOutputFromObject method that all Layout Managers must implement. This particular layout manager returns an Element when this method is called. It is up to the caller of this method to cast the object to an Element. This Element is an XML Element that contains all the data currently residing in the object. The fields that data is retrieved from to build the element are defined in EnterpriseObjects document associated to the object being serialized.

All XmlEnterpriseObjects have a method that determines the layout manager being used and then calls this method on the currently used layout manager (this class for example). The method in XmlEnterpriseObject is also called buildOutputFromObject.

Specified by:
buildOutputFromObject in interface EnterpriseLayoutManager
Returns:
Object the XML element that corresponds to the data in the object.
Throws:
EnterpriseLayoutException - if any errors occur getting the field values from the object.

buildOutputFromObject


public java.lang.Object buildOutputFromObject(XmlEnterpriseObject anXmlEnterpriseObject,
                                              java.lang.String appName)
                                       throws EnterpriseLayoutException
This is the buildOutputFromObject method that all Layout Managers must implement. This particular layout manager returns an Element with application specifice values when this method is called. It is up to the caller of this method to cast the object to an Element. This Element is an XML Element that contains all the data currently residing in the object. The fields that data is retrieved from to build the element are defined in the EnterpriseObjects document associated to the object being serialized.

This method takes the contents currently stored in the object and builds an XML Element from that content which contains application specific values. These "translations" are performed based on information found in EnterpriseObjects.xml.

All XmlEnterpriseObjects have a method that determines the layout manager being used and then calls this method on the currently used layout manager (this class for example). The method in XmlEnterpriseObject is also called buildOutputFromObject.

Specified by:
buildOutputFromObject in interface EnterpriseLayoutManager
Returns:
Object the XML element that corresponds to the data in the object.
Throws:
EnterpriseLayoutException - if any errors occur getting the field values from the object.

buildObjectFromInput


public void buildObjectFromInput(java.lang.Object input,
                                 XmlEnterpriseObject xeo)
                          throws EnterpriseLayoutException
This is the buildObjectFromInput method that all Layout Managers must implement. This particular layout manager builds the object passed in from an Element. This Element is an XML Element that contains all the data the caller wishes to populate the object with. This data can be application specific data and rules found in the EnterpriseOjbects document associated to the object being populated are then applied to the data in the XML Element and when it's all complete, the object contains Enterprise Values.

All XmlEnterpriseObjects have a method that determines the "input" layout manager being used and then calls this method on the currently used layout manager (this class for example). The method in XmlEnterpriseObject is also called buildObjectFromInput.

Specified by:
buildObjectFromInput in interface EnterpriseLayoutManager
Throws:
EnterpriseLayoutException - if an errors occur setting the Object fields with data contained in the XML element.


Copyright © 2002, OpenEAI Software Foundation