@Override
    public ValidationResult<?> validate(final OptionalConfigurationComponent<?> configurationComponent) {
        if (configurationComponent instanceof ValidatingConfigurationComponent) {
            @SuppressWarnings("rawtypes")
            final ValidatingConfigurationComponent<?> validatingComponent = (ValidatingConfigurationComponent) configurationComponent;
            return validatingComponent.validate();
        } else {
            final Class<?> componentClass = configurationComponent.getClass();
            final Validator<?> validator = validators.get(componentClass);
            if (validator != null) {
                @SuppressWarnings({"unchecked", "rawtypes"})
                final ValidationResult<?> validationResult = ((Validator) validator).validate(configurationComponent);
                return validationResult;
            } else {
                throw new IllegalArgumentException("No validator for class " + componentClass.getCanonicalName());
            }
        }
    }
@ Override public ValidationResult < ? > validate ( final OptionalConfigurationComponent < ? > configurationComponent ) { if ( configurationComponent instanceof ValidatingConfigurationComponent ) { @ SuppressWarnings ( "rawtypes" ) final ValidatingConfigurationComponent < ? > validatingComponent = ( ValidatingConfigurationComponent ) configurationComponent ; return validatingComponent . validate ( ) ; } else { final Class < ? > componentClass = configurationComponent . getClass ( ) ; final Validator < ? > validator = validators . get ( componentClass ) ; if ( validator != null ) { @ SuppressWarnings ( { "unchecked" , "rawtypes" } ) final ValidationResult < ? > validationResult = ( ( Validator ) validator ) . validate ( configurationComponent ) ; return validationResult ; } else { throw new IllegalArgumentException ( "No validator for class " + componentClass . getCanonicalName ( ) ) ; } } }
{@inheritDoc}

@throws IllegalArgumentException If no validator is found for the given component