|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.openeai.OpenEaiObject
|
+--org.openeai.config.EnterpriseFormatter
This class is used to store and verify the expected format of a particular field. It's an instance variable in the Field object and contains formatting rules specific to that field as specified in the EnterpriseObjects document.
For the purpose of this object, formatting includes the following which is all specified in the EnterpriseObjects document for all objects:
These "formatting rules" are applied when the setter method of an Enterprise Object is called. For example, when the BasicPerson.setGender("M"); method is called, the BasicPerson object uses its EnterpriseFields object to turn that supplied value into an "Enterprise Value". The EnterpriseFields object uses a Field's Formatter to perform that logic.
Another example would be a situtation where an application calls the Name.setLastName("JACKSON"); method When that method is called, it too uses its EnterpriseFields object to format that data. Since that field doesn't have any Translations associated with it, the Formatter will verify that the data is of an appropriate length (maximum or exact), verify that it's of the appropriate type (char, numeric etc.) and run any scrubbers that may be associated to that field on the data. Consequently, the application value of "JACKSON" may be converted to the Enterprise Value of "Jackson" in the end.
EnterpriseFields,
Field,
EnterpriseTranslator,
EnterpriseScrubber| Field Summary |
| Fields inherited from class org.openeai.OpenEaiObject |
logger |
| Constructor Summary | |
EnterpriseFormatter()
Constructor |
|
| Method Summary | |
void |
addScrubber(EnterpriseScrubber scrubber)
This method is used as the EnterprsieFields object builds a Field's EnterpriseFormatter to add an EnterpriseScrubber implmentation that's specified in the EnterpriseObjects document to the Field's Formatter. |
java.lang.String |
format(java.lang.String value)
This method is called by the EnterpriseFields object when a Field's data is being converted to the Enterprise Value. |
java.lang.String |
getDatatype()
Returns the allowable datatype for the Field. |
int |
getLength()
Returns the allowable length for the Field as specified in the EnterpriseObject document. |
java.lang.String |
getLengthType()
Returns the length type associated to the Field as specified in the EnterpriseObjects document. |
java.lang.String |
getMask()
|
boolean |
getRequired()
Returns the boolean flag indicating whether or not this Field is required. |
EnterpriseScrubber |
getScrubber(int index)
This method returns a scrubber from a specified location in the list of scrubbers associated to the Field. |
java.util.Vector |
getScrubbers()
Returns the list of all scrubbers associated to the field. |
EnterpriseTranslator |
getTranslator()
Returns the EnterpriseTranslator object associated to the Formatter for the Field. |
void |
insertScrubber(int index,
EnterpriseScrubber scrubber)
This method is also used as the EnterprsieFields object builds a Field's EnterpriseFormatter to add an EnterpriseScrubber implmentation that's specified in the EnterpriseObjects document to the Field's Formatter. |
void |
setDatatype(java.lang.String type)
Sets the allowable datatype for the Field. |
void |
setLength(int length)
Sets the allowable length for the Field as specified in the EnterpriseObject document. |
void |
setLengthType(java.lang.String type)
Sets the length type associated to the Field as specified in the EnterpriseObjects document. |
void |
setMask(java.lang.String mask)
|
void |
setRequired(boolean required)
Sets the boolean flag indicating whether or not this Field is required. |
void |
setScrubbers(java.util.Vector scrubber)
Sets the list of scrubber implementations to that of the Vector passed in. |
void |
setTranslator(EnterpriseTranslator translator)
Sets the EnterpriseTranslator object associated to the Formatter for the Field if one should exist. |
| 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 |
| Constructor Detail |
public EnterpriseFormatter()
| Method Detail |
public void setTranslator(EnterpriseTranslator translator)
EnterpriseTranslator,
Fieldpublic EnterpriseTranslator getTranslator()
EnterpriseTranslator,
Fieldpublic void setScrubbers(java.util.Vector scrubber)
public java.util.Vector getScrubbers()
public EnterpriseScrubber getScrubber(int index)
public void addScrubber(EnterpriseScrubber scrubber)
public void insertScrubber(int index,
EnterpriseScrubber scrubber)
public void setMask(java.lang.String mask)
public java.lang.String getMask()
public void setDatatype(java.lang.String type)
public java.lang.String getDatatype()
public void setRequired(boolean required)
public boolean getRequired()
public void setLength(int length)
setLengthTypepublic int getLength()
setLengthTypepublic void setLengthType(java.lang.String type)
A length type of "exact" means the data supplied for the Field being populated must be EXACTLY n bytes long. A length type of "maximum" means the data supplied for the Field being populated may be UP-TO n bytes long.
public java.lang.String getLengthType()
A length type of "exact" means the data supplied for the Field being populated must be EXACTLY n bytes long. A length type of "maximum" means the data supplied for the Field being populated may be UP-TO n bytes long.
public java.lang.String format(java.lang.String value)
throws InvalidFormatException
InvalidFormatException - if errors occur while applying the fomrmatting rules.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||