jfun.yan.etc
Class TypedBinder<From,To>

java.lang.Object
  extended by jfun.yan.etc.TypedBinder<From,To>
All Implemented Interfaces:
java.io.Serializable, Binder<From,To>, ComponentBinder<From,To>

public abstract class TypedBinder<From,To>
extends java.lang.Object
implements ComponentBinder<From,To>

This class represents a ComponentBinder whose component type is already known.

Author:
Ben Yu Apr 13, 2007 8:52:22 PM
See Also:
Serialized Form

Constructor Summary
TypedBinder(java.lang.Class<To> componentType)
          Create a TypedBinder.
 
Method Summary
 java.lang.Class<To> bindType(java.lang.Class<From> type)
          Get the type of the component being bound.
 java.lang.Class<To> getType()
          Get the component type.
 Verifiable verify(java.lang.Class<From> type)
          Get a Verifiable object that's responsible for verifying the component being bound.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jfun.yan.Binder
bind
 

Constructor Detail

TypedBinder

public TypedBinder(java.lang.Class<To> componentType)
Create a TypedBinder.

Parameters:
componentType - the component type.
Method Detail

getType

public java.lang.Class<To> getType()
Get the component type.


bindType

public java.lang.Class<To> bindType(java.lang.Class<From> type)
Description copied from interface: ComponentBinder
Get the type of the component being bound.

Specified by:
bindType in interface ComponentBinder<From,To>
Parameters:
type - the type of the previous component, it can be null.
Returns:
the type.

verify

public Verifiable verify(java.lang.Class<From> type)
Description copied from interface: ComponentBinder
Get a Verifiable object that's responsible for verifying the component being bound.

Specified by:
verify in interface ComponentBinder<From,To>
Parameters:
type - the type of the previous component. It cannot be null.
Returns:
the Verifiable object.