ariba.ui.aribaweb.util
Class AWFormatting

java.lang.Object
  extended by ariba.util.core.ClassExtension
      extended by ariba.ui.aribaweb.util.AWFormatting
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
AWFormatting_AribaFormatter, AWFormatting_AWFormatter, AWFormatting_JavaFormat

public abstract class AWFormatting
extends ClassExtension

This should really be named the AWFormatterAdapter. This implements the adapter pattern via ClassExtensions. This leads to a slight variation of the standard adapter pattern. In the standard pattern the Adapter (ie, this class) does all of the adaptations while here we have subclasses of this class handle the specific adaptations. To put it another way, this class and its subclasses take the place of the usual monolithic adapter in the Adapter Pattern. Also see the Wikipedia entry at http://en.wikipedia.org/wiki/Adapter_pattern.


Field Summary
 
Fields inherited from class ariba.util.core.ClassExtension
forClass
 
Constructor Summary
AWFormatting()
           
 
Method Summary
abstract  java.lang.String format(java.lang.Object receiver, java.lang.Object objectToFormat)
          This is really more like toString() than format().
 java.lang.String format(java.lang.Object receiver, java.lang.Object objectToFormat, java.util.Locale locale)
          This is really more like toString() than format().
static AWFormatting get(java.lang.Object target)
          Returns a formatter adapter (AWFormatting object) for the target's type.
abstract  java.lang.Object parseObject(java.lang.Object receiver, java.lang.String stringToParse)
          This is really more like toObject() than parseObject().
 java.lang.Object parseObject(java.lang.Object receiver, java.lang.String stringToParse, java.util.Locale locale)
          This is really more like toObject() than parseObject().
static void registerClassExtension(java.lang.Class receiverClass, AWFormatting formatClassExtension)
          This will make the passed in formatter adapter (AWFormatting object) the proper formatter adapter to use for objects of type formatterAdapteeClass (receiverClass).
 
Methods inherited from class ariba.util.core.ClassExtension
clone, forClass, getRealClass, setForClass
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AWFormatting

public AWFormatting()
Method Detail

registerClassExtension

public static void registerClassExtension(java.lang.Class receiverClass,
                                          AWFormatting formatClassExtension)
This will make the passed in formatter adapter (AWFormatting object) the proper formatter adapter to use for objects of type formatterAdapteeClass (receiverClass).

Parameters:
receiverClass - the formatterAdapteeClass
formatClassExtension - the formatterAdapterClassExtension

get

public static AWFormatting get(java.lang.Object target)
Returns a formatter adapter (AWFormatting object) for the target's type.

Parameters:
target - The formatterAdaptee.
Returns:
a formatter adapter that will work on the target's type.

parseObject

public abstract java.lang.Object parseObject(java.lang.Object receiver,
                                             java.lang.String stringToParse)
This is really more like toObject() than parseObject().

Parameters:
receiver - the formatterAdaptee
stringToParse - the objectInStringForm
Returns:
an object with the type depending on the receiver (formatterAdaptee)

format

public abstract java.lang.String format(java.lang.Object receiver,
                                        java.lang.Object objectToFormat)
This is really more like toString() than format(). It converts an object to a string. With the allowed objects depending on the receiver (formatterAdaptee).

Parameters:
receiver - the formatterAdaptee
objectToFormat - the objectToStringify
Returns:
the string form of the objectToFormat (objectToStringify)

parseObject

public java.lang.Object parseObject(java.lang.Object receiver,
                                    java.lang.String stringToParse,
                                    java.util.Locale locale)
This is really more like toObject() than parseObject().

Parameters:
receiver - the formatterAdaptee
stringToParse - the objectInStringForm
locale - the locale
Returns:
an object with the type depending on the receiver (formatterAdaptee)

format

public java.lang.String format(java.lang.Object receiver,
                               java.lang.Object objectToFormat,
                               java.util.Locale locale)
This is really more like toString() than format(). It converts an object to a string. With the allowed objects depending on the receiver (formatterAdaptee).

Parameters:
receiver - the formatterAdaptee
objectToFormat - the objectToStringify
locale - the locale
Returns:
the string form of the objectToFormat (objectToStringify)


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