|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectariba.util.core.ClassExtension
ariba.ui.aribaweb.util.AWFormatting
public abstract class AWFormatting
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 |
---|
public AWFormatting()
Method Detail |
---|
public static void registerClassExtension(java.lang.Class receiverClass, AWFormatting formatClassExtension)
receiverClass
- the formatterAdapteeClassformatClassExtension
- the formatterAdapterClassExtensionpublic static AWFormatting get(java.lang.Object target)
target
- The formatterAdaptee.
public abstract java.lang.Object parseObject(java.lang.Object receiver, java.lang.String stringToParse)
receiver
- the formatterAdapteestringToParse
- the objectInStringForm
public abstract java.lang.String format(java.lang.Object receiver, java.lang.Object objectToFormat)
receiver
- the formatterAdapteeobjectToFormat
- the objectToStringify
public java.lang.Object parseObject(java.lang.Object receiver, java.lang.String stringToParse, java.util.Locale locale)
receiver
- the formatterAdapteestringToParse
- the objectInStringFormlocale
- the locale
public java.lang.String format(java.lang.Object receiver, java.lang.Object objectToFormat, java.util.Locale locale)
receiver
- the formatterAdapteeobjectToFormat
- the objectToStringifylocale
- the locale
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |