Example #1
0
  public void assignRequirement(
      Object component,
      ComponentDescriptor descriptor,
      ComponentRequirement requirement,
      PlexusContainer container,
      Map compositionContext,
      ClassRealm lookupRealm)
      throws CompositionException {
    PropertyDescriptor[] propertyDescriptors =
        (PropertyDescriptor[]) compositionContext.get(PROPERTY_DESCRIPTORS);

    PropertyDescriptor propertyDescriptor =
        findMatchingPropertyDescriptor(requirement, propertyDescriptors);

    if (propertyDescriptor != null) {
      setProperty(component, descriptor, requirement, propertyDescriptor, container, lookupRealm);
    } else {
      reportErrorNoSuchProperty(descriptor, requirement);
    }
  }