Beispiel #1
0
 @Override
 public Desire apply(Desire desire) {
   // TODO Separate bind rules into different classes based on sat vs. type targets
   if (satisfaction != null) {
     return desire.restrict(satisfaction);
   } else {
     return desire.restrict(implType);
   }
 }
Beispiel #2
0
  @Override
  public boolean matches(Desire desire) {
    // bind rules match type by equality
    if (desire.getDesiredType().equals(depType)) {
      // if the type is equal, then rely on the qualifier matcher
      return qualifier.matches(desire.getInjectionPoint().getQualifier());
    }

    // the type and {@link Qualifier}s are not a match, so return false
    return false;
  }