|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openeai.OpenEaiObject
org.openeai.layouts.EnterpriseLayoutManagerImpl
public abstract class EnterpriseLayoutManagerImpl
The parent class of all EnterpriseLayoutManagers created by the OpenEAI software foundation. Provides convenience methods to the decendant objects.
| Field Summary | |
|---|---|
protected static java.lang.String |
LIST
|
| Fields inherited from class org.openeai.OpenEaiObject |
|---|
logger |
| Constructor Summary | |
|---|---|
EnterpriseLayoutManagerImpl()
Constructor |
|
| Method Summary | |
|---|---|
java.lang.String |
getEnterpriseObjectsUri()
Returns the EnterpriseObjects document uri associated to this EnterpriseFields object. |
protected org.jdom.Element |
getFieldLayout(org.jdom.Element eField,
java.lang.String name)
Returns the Layout Element associated to a particular field as specified in an application's deployment document. |
protected org.jdom.Element |
getLayout()
This method returns the actual layout element associated with this layout manager. |
protected org.jdom.Element |
getLayout(org.jdom.Element startingElement,
java.lang.String name)
This method searches for and returns the field definition which is part of the layout for an object that matches the name passed in. |
java.lang.String |
getLayoutManagerName()
This method returns the name of the layout manager. |
org.jdom.Element |
getLayoutRoot()
Returns the layout manager's root element. |
protected int |
getLength(XmlEnterpriseObject xeo,
java.lang.String fieldName)
Convenience method that tells the layout manager implementation how many instances of a given repeatable field exist on the parent object. |
protected java.lang.String |
getTargetAppName()
Returns the target application name associated to this layout manager. |
protected java.lang.Object |
getValueFromObject(XmlEnterpriseObject xeo,
java.lang.String fieldName)
Returns the value currently held in the parent object for the field passed in. |
protected java.lang.Object |
getValueFromObject(XmlEnterpriseObject xeo,
java.lang.String fieldName,
java.lang.Object[] parms,
java.lang.Class[] parmTypes)
Convenience method used by layout manager implementations to retrieve data from a repeating field (of any type) on a parent object. |
protected java.lang.Object |
getValueFromObject(XmlEnterpriseObject xeo,
java.lang.String appName,
java.lang.String fieldName)
Convenience method used by layout manager implementations to retrieve data from a parent object for a particular application. |
protected java.lang.Object |
getValueFromObject(XmlEnterpriseObject xeo,
java.lang.String appName,
java.lang.String fieldName,
java.lang.Object[] parms,
java.lang.Class[] parmTypes)
Convenience method used by layout manager implementations to retrieve data from a repeating field (of type Element or Attribute) on a parent object for a particular application. |
void |
init(java.lang.String layoutManagerName,
org.jdom.Document layoutDoc)
This is the default initialization method that can be used by child layout managers. |
protected java.lang.Object |
instantiate(java.lang.String className)
Convenience method used by layout manager implementations to instantiate child objects that need to be built from the input passed to them and added to the parent object being built. |
protected boolean |
isDate(java.lang.String className)
Determines if the class name passed in is one of the OpenEAI Date objects (Date or Datetime). |
protected boolean |
isRepeating(java.lang.Object xeo,
java.lang.String fieldName)
Convenience method that tells the layout manager implementation if the field specified is a repeating field on the object passed in. |
protected boolean |
isRequired(org.jdom.Element eField)
Uses the field definition passed in to determine if a field is required. |
void |
setEnterpriseObjectsUri(java.lang.String uri)
Sets the EnterpriseObjects document uri associated to this EnterpriseFields object. |
protected void |
setLayout(org.jdom.Element layout)
This method sets the actual layout element associated with this layout manager. |
void |
setLayoutManagerName(java.lang.String name)
This method sets the name associated to the layout manager. |
protected void |
setLayoutRoot(org.jdom.Element layout)
This method sets the layout manager's root element. |
protected void |
setTargetAppName(java.lang.String appName)
Sets the name of the target application for which an output is being built. |
protected void |
setVariableValue(java.lang.Object mObj,
java.lang.String variableName,
java.lang.Object value,
java.lang.Class classType)
Convenience method that sets a field on an object passed in to the value passed in by finding the appropriate setter method (by field name) on the object and invoking that method. |
protected void |
setVariableValue(java.lang.Object mObj,
java.lang.String variableName,
java.lang.Object value,
java.lang.Class classType,
int index)
This method replaces the repeatable child object at a particular index with the value passed in. |
| Methods inherited from class org.openeai.OpenEaiObject |
|---|
getAppName, getDebug, getFromAddr, 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 |
| Field Detail |
|---|
protected static final java.lang.String LIST
| Constructor Detail |
|---|
public EnterpriseLayoutManagerImpl()
| Method Detail |
|---|
protected void setTargetAppName(java.lang.String appName)
This application name will be used to "reverse-translate" data from enterprise values to application values if translations/mappings exist.
appName - String the name of the application.EnterpriseTranslator,
EnterpriseMappingprotected java.lang.String getTargetAppName()
EnterpriseTranslator,
EnterpriseMappingprotected final void setLayoutRoot(org.jdom.Element layout)
layout - Element the root element of the XML documentpublic final org.jdom.Element getLayoutRoot()
public final void setEnterpriseObjectsUri(java.lang.String uri)
uri - String URI to the EnterpriseObjects document. Can be file system or web uri.public final java.lang.String getEnterpriseObjectsUri()
protected final void setLayout(org.jdom.Element layout)
This is the element that provides the details regarding what the layout being used really is. It's the layout's definition.
layout - Element the layout element.protected final org.jdom.Element getLayout()
This is the element that provides the details regarding what the layout being used really is. It's the layout's definition.
protected final org.jdom.Element getFieldLayout(org.jdom.Element eField,
java.lang.String name)
eField - Element the Field XML Element contained within the EnterpriseObjects documentsname - String the layout name contained within the Layout Element in the EnterpriseObjects document
public final void setLayoutManagerName(java.lang.String name)
name - String the layout manager name.public final java.lang.String getLayoutManagerName()
public void init(java.lang.String layoutManagerName,
org.jdom.Document layoutDoc)
throws EnterpriseLayoutException
layoutManagerName - String the layout manager's namelayoutDoc - Document the layout document. Typically, this is the EnterpriseObjects document
associated to the object that this layout manager is being configured for.
EnterpriseLayoutException
protected org.jdom.Element getLayout(org.jdom.Element startingElement,
java.lang.String name)
throws EnterpriseLayoutException
startingElement - Element the element that is the starting point for the search. Typically, this is the root element of the EO documentname - String the name of the layout manager we're looking for. Typically, this will be the name of the object.
EnterpriseLayoutException
protected boolean isRequired(org.jdom.Element eField)
throws EnterpriseLayoutException
EnterpriseLayoutException - if the Field's Format element can't be found.
protected boolean isRepeating(java.lang.Object xeo,
java.lang.String fieldName)
throws EnterpriseLayoutException
If a child object is a repeating object within a parent object, the "getter" method for that child object will return a java.util.List. This method inspects the return type of that getter method and checks to see if it's a java.util.List.
For example, the Address child object in the BasicPerson object is repeating. Therefore, the BasicPerson object has a "getAddress" method that returns a java.util.List of Address objects that exist in that BasicPerson. This method invokes that method and checks the class type (instanceof) the returned object. If it's a java.util.List it knows the Address is a repeating child on the BasicPerson. This will work for any XmlEnterpriseObject.
xeo - Object the object that's being queriedfieldName - String the name of the field being tested.
EnterpriseLayoutException - if an error occurs executing the child object's getter method.
protected int getLength(XmlEnterpriseObject xeo,
java.lang.String fieldName)
throws EnterpriseLayoutException
If a child object is a repeating object within a parent object, the "getter" method for that child object will return a java.util.List. This method invokes the getter method for the child object and returns the size of that List. If the List returned is null, zero will be returned.
For example, the Address child object in the BasicPerson object is repeating. Therefore, the BasicPerson object has a "getAddress" method that returns a java.util.List of Address objects that exist in that BasicPerson. This method invokes that method and returns the size of the returned object.
xeo - XmlEnterpriseObject the parent object being queriedfieldName - String the name of the child object being tested
EnterpriseLayoutException - if an error occurs executing the getter method for the particular
field on the parent object passed in. An exception will also be thrown if the
object being checked is not a repeating field (the object returned by the getter method
is not a java.util.List.protected java.lang.Object instantiate(java.lang.String className)
String class name of the object to instantiate.
protected java.lang.Object getValueFromObject(XmlEnterpriseObject xeo,
java.lang.String appName,
java.lang.String fieldName)
throws EnterpriseLayoutException
xeo - XmlEnterpriseObject the parent object being queried.appName - String the name of the application used for the "reverse-translation" from
enterprise value to application specific value.
EnterpriseLayoutException - if errors occur reverse-translating the enterprise
value to an application specific value.
protected java.lang.Object getValueFromObject(XmlEnterpriseObject xeo,
java.lang.String fieldName)
throws EnterpriseLayoutException
xeo - XmlEnterpriseObject the parent objectfieldName - String the name of the field that the getter method should be called for
EnterpriseLayoutException - if errors occur invoking the getter method on the field
protected java.lang.Object getValueFromObject(XmlEnterpriseObject xeo,
java.lang.String appName,
java.lang.String fieldName,
java.lang.Object[] parms,
java.lang.Class[] parmTypes)
throws EnterpriseLayoutException
xeo - XmlEnterpriseObject the parent object being queried.appName - String the name of the application used for the "reverse-translation" from
enterprise value to application specific value.fieldName - String the name of the repeatable field (of type Attribute or Element) from which to get the dataparms - Object[] the index from which to pull the repeatable child fieldparmTypes - Class[] the data type of the index (Integer.TYPE)
EnterpriseLayoutException - if errors occur reverse-translating the enterprise
value to an application specific value.
protected java.lang.Object getValueFromObject(XmlEnterpriseObject xeo,
java.lang.String fieldName,
java.lang.Object[] parms,
java.lang.Class[] parmTypes)
throws EnterpriseLayoutException
xeo - XmlEnterpriseObject the parent object being queried.fieldName - String the name of the repeatable field (of any type) from which to get the dataparms - Object[] the index from which to pull the repeatable child fieldparmTypes - Class[] the data type of the index (Integer.TYPE)
EnterpriseLayoutException - if errors occur reverse-translating the enterprise
value to an application specific value.
protected void setVariableValue(java.lang.Object mObj,
java.lang.String variableName,
java.lang.Object value,
java.lang.Class classType)
throws EnterpriseFieldException
By invoking the setter method on the object passed in, all the rules that are specified in the EnterpriseFields object are invoked when that setter method is called.
mObj - Object the object on which the setter method is being invoked.variableName - String the name of the field for which the setter method should be calledvalue - Object the value to pass to the setter method.classType - Class the class type of variable being set
EnterpriseFieldExceptionEnterpriseFields,
EnterpriseFormatter
protected void setVariableValue(java.lang.Object mObj,
java.lang.String variableName,
java.lang.Object value,
java.lang.Class classType,
int index)
throws EnterpriseFieldException
mObj - Object the object on which to call the setter method (the parent object).variableName - String the name of the child object that's being set.value - Object value the object being passed to the setter method.classType - Class the type of class being passed to the setter (String or XmlEnterpriseObject)index - int the index at which to replace the data
EnterpriseFieldException - if errors occur calling the setter method.protected boolean isDate(java.lang.String className)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||