ariba.ui.validation
Class PipedFormatter

java.lang.Object
  extended by ariba.ui.aribaweb.util.AWBaseObject
      extended by ariba.ui.aribaweb.util.AWFormatter
          extended by ariba.ui.validation.PipedFormatter
All Implemented Interfaces:
AWObject, Compare

public final class PipedFormatter
extends AWFormatter
implements Compare

This formatter pipes String object values *backward* through its coercion formatter, and then forward through its data formatter. This is valuable when binding a UI field to an XML property that has a canonical *string* representation for a number or date, than then needs to be formatted by a conventional number or date formatter.


Field Summary
 
Fields inherited from class ariba.ui.aribaweb.util.AWBaseObject
AribaHashtableClass, AribaVectorClass, ClassClass, EmptyHashtable, EmptyMap, EmptyVector, False, IntegerClass, JavaHashtableClass, JavaMapClass, JavaVectorClass, LogHandling, NullObject, ObjectClass, StringClass, True, UndefinedObject, UndefinedString, UninitializedRealNumber
 
Fields inherited from interface ariba.util.core.Compare
EqualTo, GreaterThan, LessThan
 
Constructor Summary
PipedFormatter(java.lang.Object stringCoercionFormatter, java.lang.Object dataFormatter)
           
 
Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
          Compares objects two objects for sort order.
 java.lang.String format(java.lang.Object objectValue)
          format the "object value" by first parsing the canonical string value, and then passing that object value through our data formatter.
 java.lang.Object parseCanonicalXMLString(java.lang.String xmlValue)
           
 java.lang.Object parseObject(java.lang.String stringToParse)
          parse the presentation string by first parsing it into an objectValue, and then formatting that into a canonical string representation
 
Methods inherited from class ariba.ui.aribaweb.util.AWBaseObject
debugString, ensureFieldValuesClear, getFieldValue, init, isKindOfClass, localizedJavaString, logString, logWarning, setFieldValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PipedFormatter

public PipedFormatter(java.lang.Object stringCoercionFormatter,
                      java.lang.Object dataFormatter)
Method Detail

parseCanonicalXMLString

public java.lang.Object parseCanonicalXMLString(java.lang.String xmlValue)

format

public java.lang.String format(java.lang.Object objectValue)
format the "object value" by first parsing the canonical string value, and then passing that object value through our data formatter.

Specified by:
format in class AWFormatter

parseObject

public java.lang.Object parseObject(java.lang.String stringToParse)
                             throws java.text.ParseException
parse the presentation string by first parsing it into an objectValue, and then formatting that into a canonical string representation

Specified by:
parseObject in class AWFormatter
Throws:
java.text.ParseException

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Description copied from interface: Compare
Compares objects two objects for sort order.

Specified by:
compare in interface Compare
Parameters:
o1 - the first object to compare
o2 - the second object to compare
Returns:
a value less than, equal to, or greater than zero depending on whether o1 is less than, equal to, or greater than o2


AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.