// Path: core/src/main/java/org/mvcspec/ozark/binding/BindingErrorImpl.java
// public class BindingErrorImpl implements BindingError {
// 
//     private String message;
// 
//     private String paramName;
// 
//     private String submittedValue;
// 
//     public BindingErrorImpl(String message, String paramName, String submittedValue) {
//         this.message = message;
//         this.paramName = paramName;
//         this.submittedValue = submittedValue;
//     }
// 
//     @Override
//     public String getMessage() {
//         return message;
//     }
// 
//     public void setMessage(String message) {
//         this.message = message;
//     }
// 
//     @Override
//     public String getParamName() {
//         return paramName;
//     }
// 
//     public void setParamName(String paramName) {
//         this.paramName = paramName;
//     }
// 
//     @Override
//     public String getSubmittedValue() {
//         return submittedValue;
//     }
// }
// 
// Path: core/src/main/java/org/mvcspec/ozark/binding/BindingResultImpl.java
// @Vetoed // produced by BindingResultManager
// public class BindingResultImpl implements BindingResult {
// 
//     private final Set<BindingError> bindingErrors = new LinkedHashSet<>();
// 
//     private final Set<ValidationError> validationErrors = new LinkedHashSet<>();
// 
//     private boolean consumed;
// 
//     @Override
//     public boolean isFailed() {
//         this.consumed = true;
//         return validationErrors.size() > 0 || bindingErrors.size() > 0;
//     }
// 
//     @Override
//     public List<String> getAllMessages() {
//         this.consumed = true;
//         return Stream.concat(bindingErrors.stream(), validationErrors.stream())
//                 .map(ParamError::getMessage)
//                 .collect(Collectors.collectingAndThen(Collectors.toList(), Collections::unmodifiableList));
//     }
// 
//     @Override
//     public Set<ParamError> getAllErrors() {
//         this.consumed = true;
//         return Stream.concat(bindingErrors.stream(), validationErrors.stream())
//                 .collect(Collectors.collectingAndThen(Collectors.toSet(), Collections::unmodifiableSet));
//     }
// 
//     @Override
//     public Set<ParamError> getErrors(String param) {
//         Objects.requireNonNull(param, "Parameter name is required");
//         this.consumed = true;
//         return Stream.concat(bindingErrors.stream(), validationErrors.stream())
//                 .filter(paramError -> Objects.equals(paramError.getParamName(), param))
//                 .collect(Collectors.collectingAndThen(Collectors.toSet(), Collections::unmodifiableSet));
//     }
// 
//     public void addValidationErrors(Set<ValidationError> validationErrors) {
//         this.validationErrors.addAll(validationErrors);
//     }
// 
//     public void addBindingError(BindingError bindingError) {
//         this.bindingErrors.add(bindingError);
//     }
// 
//     public boolean hasUnconsumedErrors() {
//         return !consumed && (!bindingErrors.isEmpty() || !validationErrors.isEmpty());
//     }
// 
// }


import java.util.Locale;
import java.util.stream.Stream;
import org.mvcspec.ozark.binding.BindingErrorImpl;
import org.mvcspec.ozark.binding.BindingResultImpl;
import javax.inject.Inject;
import javax.mvc.MvcContext;
import javax.mvc.binding.MvcBinding;
import javax.ws.rs.CookieParam;
import javax.ws.rs.FormParam;
import javax.ws.rs.MatrixParam;
import javax.ws.rs.PathParam;
import javax.ws.rs.QueryParam;
import javax.ws.rs.ext.ParamConverter;
import javax.ws.rs.ext.ParamConverterProvider;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
/*
 * Copyright © 2017 Ivar Grimstad (ivar.grimstad@gmail.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.mvcspec.ozark.binding.convert;



/**
 * Implementation if the JAX-RS {@link ParamConverterProvider} contract which delegates conversion
 * to the custom implementations for MVC.
 *
 * @author Christian Kaltepoth
 */
public class MvcConverterProvider implements ParamConverterProvider {

    @Inject
    private ConverterRegistry converterRegistry;

    @Inject
    private MvcContext mvcContext;

    @Inject
// Path: core/src/main/java/org/mvcspec/ozark/binding/BindingErrorImpl.java
// public class BindingErrorImpl implements BindingError {
// 
//     private String message;
// 
//     private String paramName;
// 
//     private String submittedValue;
// 
//     public BindingErrorImpl(String message, String paramName, String submittedValue) {
//         this.message = message;
//         this.paramName = paramName;
//         this.submittedValue = submittedValue;
//     }
// 
//     @Override
//     public String getMessage() {
//         return message;
//     }
// 
//     public void setMessage(String message) {
//         this.message = message;
//     }
// 
//     @Override
//     public String getParamName() {
//         return paramName;
//     }
// 
//     public void setParamName(String paramName) {
//         this.paramName = paramName;
//     }
// 
//     @Override
//     public String getSubmittedValue() {
//         return submittedValue;
//     }
// }
// 
// Path: core/src/main/java/org/mvcspec/ozark/binding/BindingResultImpl.java
// @Vetoed // produced by BindingResultManager
// public class BindingResultImpl implements BindingResult {
// 
//     private final Set<BindingError> bindingErrors = new LinkedHashSet<>();
// 
//     private final Set<ValidationError> validationErrors = new LinkedHashSet<>();
// 
//     private boolean consumed;
// 
//     @Override
//     public boolean isFailed() {
//         this.consumed = true;
//         return validationErrors.size() > 0 || bindingErrors.size() > 0;
//     }
// 
//     @Override
//     public List<String> getAllMessages() {
//         this.consumed = true;
//         return Stream.concat(bindingErrors.stream(), validationErrors.stream())
//                 .map(ParamError::getMessage)
//                 .collect(Collectors.collectingAndThen(Collectors.toList(), Collections::unmodifiableList));
//     }
// 
//     @Override
//     public Set<ParamError> getAllErrors() {
//         this.consumed = true;
//         return Stream.concat(bindingErrors.stream(), validationErrors.stream())
//                 .collect(Collectors.collectingAndThen(Collectors.toSet(), Collections::unmodifiableSet));
//     }
// 
//     @Override
//     public Set<ParamError> getErrors(String param) {
//         Objects.requireNonNull(param, "Parameter name is required");
//         this.consumed = true;
//         return Stream.concat(bindingErrors.stream(), validationErrors.stream())
//                 .filter(paramError -> Objects.equals(paramError.getParamName(), param))
//                 .collect(Collectors.collectingAndThen(Collectors.toSet(), Collections::unmodifiableSet));
//     }
// 
//     public void addValidationErrors(Set<ValidationError> validationErrors) {
//         this.validationErrors.addAll(validationErrors);
//     }
// 
//     public void addBindingError(BindingError bindingError) {
//         this.bindingErrors.add(bindingError);
//     }
// 
//     public boolean hasUnconsumedErrors() {
//         return !consumed && (!bindingErrors.isEmpty() || !validationErrors.isEmpty());
//     }
// 
// }


// Path: core/src/main/java/org/mvcspec/ozark/binding/convert/MvcConverterProvider.java
import java.util.Locale;
import java.util.stream.Stream;
import org.mvcspec.ozark.binding.BindingErrorImpl;
import org.mvcspec.ozark.binding.BindingResultImpl;
import javax.inject.Inject;
import javax.mvc.MvcContext;
import javax.mvc.binding.MvcBinding;
import javax.ws.rs.CookieParam;
import javax.ws.rs.FormParam;
import javax.ws.rs.MatrixParam;
import javax.ws.rs.PathParam;
import javax.ws.rs.QueryParam;
import javax.ws.rs.ext.ParamConverter;
import javax.ws.rs.ext.ParamConverterProvider;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;

/*
 * Copyright © 2017 Ivar Grimstad (ivar.grimstad@gmail.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.mvcspec.ozark.binding.convert;



/**
 * Implementation if the JAX-RS {@link ParamConverterProvider} contract which delegates conversion
 * to the custom implementations for MVC.
 *
 * @author Christian Kaltepoth
 */
public class MvcConverterProvider implements ParamConverterProvider {

    @Inject
    private ConverterRegistry converterRegistry;

    @Inject
    private MvcContext mvcContext;

    @Inject
    private BindingResultImpl bindingResult;