JIDE 3.5.15

com.jidesoft.converter
Class AbstractContext

java.lang.Object
  extended by com.jidesoft.converter.AbstractContext
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ComparatorContext, ConverterContext, EditorContext, GrouperContext, IntrospectorContext

public abstract class AbstractContext
extends Object
implements Serializable

AbstractContext is a generic context class. It has two fields: name and userObject. The name is just the name of the context. You can use a meaningful string to name it. The userObject is customizable portion of Context. You can set whatever you want as userObject. It's just a convention between whoever set it and whoever use it. For example, in ConverterContext, we sometimes used it to pass in a Format.

See Also:
Serialized Form

Constructor Summary
AbstractContext(String name)
          Creates a named AbstractContext.
AbstractContext(String name, Object object)
          Creates an abstract context with a name and an object.
 
Method Summary
 boolean equals(Object o)
          Override equals.
 String getName()
          Gets the name of the abstract context.
 Object getUserObject()
          Gets the user object.
 int hashCode()
           
 void setName(String name)
          Sets the name of the abstract context.
 void setUserObject(Object userObject)
          Sets the user object.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractContext

public AbstractContext(String name)
Creates a named AbstractContext.

Parameters:
name - the name of the AbstractContext.

AbstractContext

public AbstractContext(String name,
                       Object object)
Creates an abstract context with a name and an object.

Parameters:
name - the name of the AbstractContext.
object - the user object. It can be used any object to pass information along.
Method Detail

getName

public String getName()
Gets the name of the abstract context.

Returns:
the name of the abstract context

setName

public void setName(String name)
Sets the name of the abstract context.

Parameters:
name - the name of the abstract context

getUserObject

public Object getUserObject()
Gets the user object.

Returns:
the user object

setUserObject

public void setUserObject(Object userObject)
Sets the user object.

Parameters:
userObject - the user object.

equals

public boolean equals(Object o)
Override equals. Two abstract context equals as long as the name is the same.

Overrides:
equals in class Object
Parameters:
o - object to compare.
Returns:
if two objects equal.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

JIDE 3.5.15