org.picocontainer.gems.constraints
Class AbstractConstraint

java.lang.Object
  extended by org.picocontainer.parameters.AbstractParameter
      extended by org.picocontainer.parameters.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.

Author:
Nick Sieger
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.picocontainer.Parameter
Parameter.DelegateResolver, Parameter.NotResolved, Parameter.Resolver, Parameter.ValueResolver
 
Field Summary
 
Fields inherited from class org.picocontainer.parameters.CollectionComponentParameter
ARRAY, ARRAY_ALLOW_EMPTY
 
Fields inherited from interface org.picocontainer.Parameter
DEFAULT, ZERO
 
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<Object,ComponentAdapter<?>> getMatchingComponentAdapters(PicoContainer container, ComponentAdapter adapter, Class keyType, Class valueType)
           
 Parameter.Resolver resolve(PicoContainer container, ComponentAdapter<?> forAdapter, ComponentAdapter<?> injecteeAdapter, Type expectedType, NameBinding expectedNameBinding, boolean useNames, Annotation binding)
           
 void verify(PicoContainer container, ComponentAdapter<?> adapter, Type expectedType, NameBinding expectedNameBinding, boolean useNames, Annotation binding)
           
 
Methods inherited from class org.picocontainer.parameters.CollectionComponentParameter
accept
 
Methods inherited from class org.picocontainer.parameters.AbstractParameter
isResolvable, resolveInstance
 
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, isResolvable, resolveInstance
 

Constructor Detail

AbstractConstraint

protected AbstractConstraint()
Construct an AbstractContraint.

Method Detail

resolve

public Parameter.Resolver resolve(PicoContainer container,
                                  ComponentAdapter<?> forAdapter,
                                  ComponentAdapter<?> injecteeAdapter,
                                  Type expectedType,
                                  NameBinding expectedNameBinding,
                                  boolean useNames,
                                  Annotation binding)
                           throws PicoCompositionException
Specified by:
resolve in interface Parameter
Overrides:
resolve in class CollectionComponentParameter
Throws:
PicoCompositionException

verify

public void verify(PicoContainer container,
                   ComponentAdapter<?> adapter,
                   Type expectedType,
                   NameBinding expectedNameBinding,
                   boolean useNames,
                   Annotation binding)
            throws PicoCompositionException
Specified by:
verify in interface Parameter
Overrides:
verify in class CollectionComponentParameter
Throws:
PicoCompositionException

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<Object,ComponentAdapter<?>> getMatchingComponentAdapters(PicoContainer container,
                                                                       ComponentAdapter adapter,
                                                                       Class keyType,
                                                                       Class valueType)
Overrides:
getMatchingComponentAdapters in class CollectionComponentParameter


Copyright © 2003-2010 Codehaus. All Rights Reserved.