org.jaffa.tools.patternengine
Class DomParser.ValueObject

java.lang.Object
  extended byorg.jaffa.tools.patternengine.DomParser.ValueObject
Enclosing class:
DomParser

public static class DomParser.ValueObject
extends Object

A value in the input XML stream can be represented as a ValueObject. This class supports various helper routines to get different variations of the values.


Constructor Summary
DomParser.ValueObject(String value)
          Creates an instance.
 
Method Summary
 boolean getBooleanValue()
          Returns true if the value is any of true/yes/t/y/1.
 String getCriteriaFieldType()
          Returns the CriteriaField implementation classname appropriate for the datatype represented by this value.
 boolean getCriteriaFieldTypeThrowsException()
          Returns true if the CriteriaField implementation class appropriate for the datatype represented by this value throws an Exception during Instantiation.
 boolean getDataTypeBoolean()
          Returns a true if the value represents the Boolean datatype or its variants.
 boolean getDataTypeDateOnly()
          Returns a true if the value represents the DateOnly datatype
 boolean getDataTypeDateTime()
          Returns a true if the value represents the DateTime datatype
 boolean getDataTypeNumeric()
          Returns a true if the value represents a numeric datatype.
 boolean getDataTypeString()
          Returns a true if the value represents the datatype for which the String class is used.
 String getGridColumnDataType()
          Returns the string to be specified as the GridColumnDataType for the datatype represented by this value.
 int getIntValue()
          Translates the value to an int value.
 String getJavaDataType()
          Returns the Java classname for the datatype represented by this value.
 String getLower()
          Returns the value with the value in lowercase.
 String getLower1()
          Returns the value with the 1st character in lowercase.
 String getMetaFieldType()
          Returns the FieldMetaData implementation classname appropriate for the datatype represented by this value.
 String getParserMethod()
          Returns the ParserMethod appropriate for the datatype represented by this value.
 Map getRelatedObject(Object relatedObjectsMap)
          This will check the input Map for a RelatedObject having the same Name as this field.
 String getRelationshipType(Object relatedObjectsMap)
          This will check the input Map for a RelatedObject having the same Name as this field.
 boolean getRelationshipTypeMany()
          Returns true if the value equals any of the values: Many, OneAndMany, *, m..*, m (where m > 1) or m..n (where n >= m && n > 1)
 boolean getRelationshipTypeMany(Object relatedObjectsMap)
          Returns true if the RelationshipType for the matching RelatedObject equals any of the values: Many, OneAndMany, *, m..*, m (where m > 1) or m..n (where n >= m && n > 1) This is extensively used by the object-maintenace_2_0 pattern.
 boolean getRelationshipTypeOne()
          Returns true if the value equals any of the values: One, OneAndMany, 1, 0..1, 1..1.
 boolean getRelationshipTypeOne(Object relatedObjectsMap)
          Returns true if the RelationshipType for the matching RelatedObject equals any of the values: One, OneAndMany, 1, 0..1, 1..1 This is extensively used by the object-maintenace_2_0 pattern.
 boolean getRelationshipTypeOptional()
          Returns true if the value equals any of the values: 0..*, *, 0 or 0..n
 String getSpace()
          Translates the value to words separated by spaces.
 String getStatic()
          Translates the value to all UpperCase with underscores separating the words.
 String getUpper()
          Returns the value with the value in uppercase.
 String getUpper1()
          Returns the value with the 1st character in uppercase.
 String getWidgetType()
          Returns the WidgetType appropriate for the datatype represented by this value.
 String getWidgetTypeBasedOnBreakup()
          Returns the WidgetType appropriate for the Breakup type represented by this value.
 String getWidgetTypeInCriteriaScreen()
          Returns the WidgetType appropriate for the datatype represented by this value for an Inquiry Criteria Screen.
 String toString()
          Returns the value as is.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DomParser.ValueObject

public DomParser.ValueObject(String value)
Creates an instance.

Parameters:
value - the value of this object.
Method Detail

getLower1

public String getLower1()
Returns the value with the 1st character in lowercase.

Returns:
the value with the 1st character in lowercase.

getUpper1

public String getUpper1()
Returns the value with the 1st character in uppercase.

Returns:
the value with the 1st character in uppercase.

getLower

public String getLower()
Returns the value with the value in lowercase.

Returns:
the value with the value in lowercase.

getUpper

public String getUpper()
Returns the value with the value in uppercase.

Returns:
the value with the value in uppercase.

getStatic

public String getStatic()
Translates the value to all UpperCase with underscores separating the words. For eg: "abcDef" would be translated to "ABC_DEF".

Returns:
the value as a static.

getSpace

public String getSpace()
Translates the value to words separated by spaces. For eg: "abcDef" would be translated to "abc Def".

Returns:
the value separated into words.

getIntValue

public int getIntValue()
                throws NumberFormatException
Translates the value to an int value.

Returns:
the value as an int value.
Throws:
NumberFormatException - if the String cannot be converted to an int value.

toString

public String toString()
Returns the value as is.

Returns:
the value as is.

getBooleanValue

public boolean getBooleanValue()
Returns true if the value is any of true/yes/t/y/1. It utilises the Parser.parseBoolean() method to arrive at the result.

Returns:
true if the value is any of true/yes/t/y/1.

getJavaDataType

public String getJavaDataType()
Returns the Java classname for the datatype represented by this value. It invokes the Defaults.getClassString() method to obtain the Java classname.

Returns:
the Java Class Name for the datatype represented by this value.

getGridColumnDataType

public String getGridColumnDataType()
Returns the string to be specified as the GridColumnDataType for the datatype represented by this value.

Returns:
the string to be specified as the GridColumnDataType for the datatype represented by this value.

getCriteriaFieldType

public String getCriteriaFieldType()
Returns the CriteriaField implementation classname appropriate for the datatype represented by this value.

Returns:
the CriteriaField implementation classname appropriate for the datatype represented by this value.

getCriteriaFieldTypeThrowsException

public boolean getCriteriaFieldTypeThrowsException()
Returns true if the CriteriaField implementation class appropriate for the datatype represented by this value throws an Exception during Instantiation.

Returns:
true if the CriteriaField implementation class appropriate for the datatype represented by this value throws an Exception during Instantiation.

getMetaFieldType

public String getMetaFieldType()
Returns the FieldMetaData implementation classname appropriate for the datatype represented by this value.

Returns:
the FieldMetaData implementation classname appropriate for the datatype represented by this value.

getWidgetType

public String getWidgetType()
Returns the WidgetType appropriate for the datatype represented by this value.

Returns:
the WidgetType appropriate for the datatype represented by this value.

getWidgetTypeInCriteriaScreen

public String getWidgetTypeInCriteriaScreen()
Returns the WidgetType appropriate for the datatype represented by this value for an Inquiry Criteria Screen.

Returns:
the WidgetType appropriate for the datatype represented by this value for an Inquiry Criteria Screen

getWidgetTypeBasedOnBreakup

public String getWidgetTypeBasedOnBreakup()
Returns the WidgetType appropriate for the Breakup type represented by this value.

Returns:
the WidgetType appropriate for the Breakup type represented by this value.

getParserMethod

public String getParserMethod()
Returns the ParserMethod appropriate for the datatype represented by this value.

Returns:
the ParserMethod appropriate for the datatype represented by this value.

getDataTypeDateOnly

public boolean getDataTypeDateOnly()
Returns a true if the value represents the DateOnly datatype

Returns:
a true if the value represents the DateOnly datatype

getDataTypeDateTime

public boolean getDataTypeDateTime()
Returns a true if the value represents the DateTime datatype

Returns:
a true if the value represents the DateTime datatype

getDataTypeBoolean

public boolean getDataTypeBoolean()
Returns a true if the value represents the Boolean datatype or its variants.

Returns:
a true if the value represents the Boolean datatype or its variants.

getDataTypeString

public boolean getDataTypeString()
Returns a true if the value represents the datatype for which the String class is used.

Returns:
a true if the value represents the datatype for which the String class is used.

getDataTypeNumeric

public boolean getDataTypeNumeric()
Returns a true if the value represents a numeric datatype. Eg. Decimal, Integer, Currency.

Returns:
a true if the value represents a numeric datatype.

getRelatedObject

public Map getRelatedObject(Object relatedObjectsMap)
This will check the input Map for a RelatedObject having the same Name as this field. This is extensively used by the object-maintenace_2_0 pattern.

Parameters:
relatedObjectsMap - The Map containing a collection of RelatedObjects.
Returns:
The matching RelatedObject.

getRelationshipType

public String getRelationshipType(Object relatedObjectsMap)
This will check the input Map for a RelatedObject having the same Name as this field. It will then return the value of the property 'RelationshipToDomainObject' for the RelatedObject. This is extensively used by the object-maintenace_2_0 pattern.

Parameters:
relatedObjectsMap - The Map containing a collection of RelatedObjects.
Returns:
The RelationshipType for the matching RelatedObject.

getRelationshipTypeOne

public boolean getRelationshipTypeOne(Object relatedObjectsMap)
Returns true if the RelationshipType for the matching RelatedObject equals any of the values: One, OneAndMany, 1, 0..1, 1..1 This is extensively used by the object-maintenace_2_0 pattern.

Parameters:
relatedObjectsMap - The Map containing a collection of RelatedObjects.
Returns:
true if the RelationshipType for the matching RelatedObject equals any of the values for the One relationship.

getRelationshipTypeMany

public boolean getRelationshipTypeMany(Object relatedObjectsMap)
Returns true if the RelationshipType for the matching RelatedObject equals any of the values: Many, OneAndMany, *, m..*, m (where m > 1) or m..n (where n >= m && n > 1) This is extensively used by the object-maintenace_2_0 pattern.

Parameters:
relatedObjectsMap - The Map containing a collection of RelatedObjects.
Returns:
true if the RelationshipType for the matching RelatedObject equals any of the values for the Many relationship.

getRelationshipTypeOne

public boolean getRelationshipTypeOne()
Returns true if the value equals any of the values: One, OneAndMany, 1, 0..1, 1..1.

Returns:
true if the value equals any of the values for the One relationship.

getRelationshipTypeMany

public boolean getRelationshipTypeMany()
Returns true if the value equals any of the values: Many, OneAndMany, *, m..*, m (where m > 1) or m..n (where n >= m && n > 1)

Returns:
true if the value equals any of the values for the Many relationship.

getRelationshipTypeOptional

public boolean getRelationshipTypeOptional()
Returns true if the value equals any of the values: 0..*, *, 0 or 0..n

Returns:
true if the value equals any of the values for the Optional relationship.


Copyright © 2002-2004 JAFFA Project.