org.picocontainer.gems.constraints
Class AbstractConstraint

java.lang.Object
  extended by org.picocontainer.defaults.CollectionComponentParameter
      extended by org.picocontainer.gems.constraints.AbstractConstraint
All Implemented Interfaces:
Serializable, Constraint, Parameter
Direct Known Subclasses:
And, Anything, IsExactType, IsKey, IsKeyType, IsType, Not, Or

public abstract class AbstractConstraint
extends CollectionComponentParameter
implements Constraint

Base class for parameter constraints.

Version:
1.1
Author:
Nick Sieger
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.picocontainer.defaults.CollectionComponentParameter
ARRAY, ARRAY_ALLOW_EMPTY
 
Constructor Summary
protected AbstractConstraint()
          Construct an AbstractContraint.
 
Method Summary
abstract  boolean evaluate(ComponentAdapter adapter)
          Evaluate whether the given component adapter matches this constraint.
protected  Map getMatchingComponentAdapters(PicoContainer container, ComponentAdapter adapter, Class keyType, Class valueType)
           
 boolean isResolvable(PicoContainer container, ComponentAdapter adapter, Class expectedType)
           
 Object resolveInstance(PicoContainer container, ComponentAdapter adapter, Class expectedType)
           
 void verify(PicoContainer container, ComponentAdapter adapter, Class expectedType)
           
 
Methods inherited from class org.picocontainer.defaults.CollectionComponentParameter
accept
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.picocontainer.Parameter
accept
 

Constructor Detail

AbstractConstraint

protected AbstractConstraint()
Construct an AbstractContraint.

Method Detail

resolveInstance

public Object resolveInstance(PicoContainer container,
                              ComponentAdapter adapter,
                              Class expectedType)
                       throws PicoIntrospectionException
Specified by:
resolveInstance in interface Parameter
Overrides:
resolveInstance in class CollectionComponentParameter
Throws:
PicoIntrospectionException

isResolvable

public boolean isResolvable(PicoContainer container,
                            ComponentAdapter adapter,
                            Class expectedType)
                     throws PicoIntrospectionException
Specified by:
isResolvable in interface Parameter
Overrides:
isResolvable in class CollectionComponentParameter
Throws:
PicoIntrospectionException

verify

public void verify(PicoContainer container,
                   ComponentAdapter adapter,
                   Class expectedType)
            throws PicoIntrospectionException
Specified by:
verify in interface Parameter
Overrides:
verify in class CollectionComponentParameter
Throws:
PicoIntrospectionException

evaluate

public abstract boolean evaluate(ComponentAdapter adapter)
Description copied from interface: Constraint
Evaluate whether the given component adapter matches this constraint.

Specified by:
evaluate in interface Constraint
Overrides:
evaluate in class CollectionComponentParameter
Parameters:
adapter - a ComponentAdapter value
Returns:
true if the adapter matches the constraint

getMatchingComponentAdapters

protected Map getMatchingComponentAdapters(PicoContainer container,
                                           ComponentAdapter adapter,
                                           Class keyType,
                                           Class valueType)
Overrides:
getMatchingComponentAdapters in class CollectionComponentParameter


Copyright © 2003-2010 Codehaus. All Rights Reserved.