net.ontopia.utils
Class Stringified

java.lang.Object
  extended by net.ontopia.utils.Stringified

public class Stringified
extends java.lang.Object

INTERNAL: Utility class that wraps an object and a stringifier for use with the Object.toString() method. This class is useful when code calls the default toString() method on objects.

Ideally is should be possible to call the StringifierIF.toString(Object) methods directly, but sometimes this is impossible especially when working with code that you yourself doesn't control. Thus you can wrap your object and stringifier in an object of this class to gain the power of stringifiers.

The Swing components generally use the toString methods on the objects for display. This means that you're not able to use stringifiers with these objects. It is where this class comes to he rescue.


Field Summary
protected  java.lang.Object object
           
protected  StringifierIF stringifier
           
 
Constructor Summary
Stringified(java.lang.Object object, StringifierIF stringifier)
           
 
Method Summary
 java.lang.Object getObject()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

object

protected java.lang.Object object

stringifier

protected StringifierIF stringifier
Constructor Detail

Stringified

public Stringified(java.lang.Object object,
                   StringifierIF stringifier)
Method Detail

getObject

public java.lang.Object getObject()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2000-2012 Ontopia.