All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.dropwizard.jersey.validation.ParamValueExtractor Maven / Gradle / Ivy

The newest version!
package io.dropwizard.jersey.validation;

import io.dropwizard.jersey.params.AbstractParam;
import jakarta.validation.valueextraction.ExtractedValue;
import jakarta.validation.valueextraction.UnwrapByDefault;
import jakarta.validation.valueextraction.ValueExtractor;
import org.hibernate.validator.internal.engine.valueextraction.ValueExtractorDescriptor;

/**
 * Lets the validator know that when validating a class that is an {@link AbstractParam} to
 * validate the underlying value.
 *
 * @since 2.0
 */
@UnwrapByDefault
public class ParamValueExtractor implements ValueExtractor> {
    static final ValueExtractorDescriptor DESCRIPTOR = new ValueExtractorDescriptor(new ParamValueExtractor());

    private ParamValueExtractor() {
    }

    @Override
    public void extractValues(AbstractParam originalValue, ValueExtractor.ValueReceiver receiver) {
        receiver.value(null, originalValue == null ? null : originalValue.get());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy