Package org.jboss.weld.resolution
Class AbstractAssignabilityRules
- java.lang.Object
-
- org.jboss.weld.resolution.AbstractAssignabilityRules
-
- All Implemented Interfaces:
AssignabilityRules
- Direct Known Subclasses:
BeanTypeAssignabilityRules
,EventTypeAssignabilityRules
public abstract class AbstractAssignabilityRules extends Object implements AssignabilityRules
Base class for AssignabilityRules implementations.- Author:
- Jozef Hartinger
-
-
Constructor Summary
Constructors Constructor Description AbstractAssignabilityRules()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
boundsMatch(Type[] upperBounds, Type[] stricterUpperBounds)
Returns true iff for each upper bound T, there is at least one bound from stricterUpperBounds assignable to T.protected Type[]
getUppermostTypeVariableBounds(TypeVariable<?> bound)
protected boolean
lowerBoundsOfWildcardMatch(Type[] beanParameterBounds, WildcardType requiredParameter)
protected boolean
lowerBoundsOfWildcardMatch(Type parameter, WildcardType requiredParameter)
boolean
matches(Type requiredType, Set<? extends Type> beanTypes)
Check whether requiredType matches a type in beanTypesboolean
matches(Set<Type> requiredTypes, Set<Type> beanTypes)
Check whether at least one of the requiredTypes matches a type in beanTypesprotected boolean
upperBoundsOfWildcardMatch(WildcardType requiredParameter, Type parameter)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jboss.weld.resolution.AssignabilityRules
matches
-
-
-
-
Method Detail
-
matches
public boolean matches(Set<Type> requiredTypes, Set<Type> beanTypes)
Description copied from interface:AssignabilityRules
Check whether at least one of the requiredTypes matches a type in beanTypes- Specified by:
matches
in interfaceAssignabilityRules
- Parameters:
requiredTypes
- the requiredTypesbeanTypes
- the beanTypes- Returns:
- can we assign some type from requiredTypes to some type in beanTypes
-
matches
public boolean matches(Type requiredType, Set<? extends Type> beanTypes)
Description copied from interface:AssignabilityRules
Check whether requiredType matches a type in beanTypes- Specified by:
matches
in interfaceAssignabilityRules
- Parameters:
requiredType
- the requiredTypebeanTypes
- the beanTypes- Returns:
- can we assign requiredType to some type in beanTypes
-
getUppermostTypeVariableBounds
protected Type[] getUppermostTypeVariableBounds(TypeVariable<?> bound)
-
boundsMatch
protected boolean boundsMatch(Type[] upperBounds, Type[] stricterUpperBounds)
Returns true iff for each upper bound T, there is at least one bound from stricterUpperBounds assignable to T. This reflects that stricterUpperBounds are at least as strict as upperBounds are.Arguments passed to this method must be legal java bounds, i.e. bounds returned by
TypeVariable.getBounds()
,WildcardType.getUpperBounds()
orWildcardType.getLowerBounds()
.
-
lowerBoundsOfWildcardMatch
protected boolean lowerBoundsOfWildcardMatch(Type parameter, WildcardType requiredParameter)
-
lowerBoundsOfWildcardMatch
protected boolean lowerBoundsOfWildcardMatch(Type[] beanParameterBounds, WildcardType requiredParameter)
-
upperBoundsOfWildcardMatch
protected boolean upperBoundsOfWildcardMatch(WildcardType requiredParameter, Type parameter)
-
-