// Path: core/src/main/java/org/mvcspec/ozark/bootstrap/ConfigProvider.java
// public interface ConfigProvider {
// 
//     void configure(FeatureContext context);
// 
// }
// 
// Path: jersey/src/main/java/org/mvcspec/ozark/jersey/validation/OzarkValidationInterceptor.java
// public class OzarkValidationInterceptor implements ValidationInterceptor {
// 
//     /**
//      * For some weird reason we cannot preserve the <code>throws ConstraintViolationException</code>
//      * in the method signature. Bundling Ozark as a Glassfish plugin starts failing as soon as
//      * this class uses any interface from the javax.validation package. My current guess is
//      * that this is related to the OSGi bundling.
//      */
//     @Override
//     public void onValidate(ValidationInterceptorContext context) {
// 
//         /*
//          * TODO: Won't work correctly for mixed controller/resource methods.
//          */
//         Class<?> resourceClass = context.getResource().getClass();
//         boolean mvcRequest = AnnotationUtils.hasAnnotationOnClassOrMethod(resourceClass, Controller.class);
// 
//         if (!mvcRequest) {
//             context.proceed();
//         }
// 
//     }
// 
// }


import org.mvcspec.ozark.bootstrap.ConfigProvider;
import org.mvcspec.ozark.jersey.model.OzarkModelProcessor;
import org.mvcspec.ozark.jersey.validation.OzarkValidationInterceptor;
import javax.ws.rs.core.FeatureContext;
/*
 * 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.jersey.bootstrap;



/**
 * Implementation of ConfigProvider for the Jersey module.
 *
 * @author Christian Kaltepoth
 */
public class JerseyConfigProvider implements ConfigProvider {

    @Override
    public void configure(FeatureContext context) {
        context.register(OzarkModelProcessor.class);
// Path: core/src/main/java/org/mvcspec/ozark/bootstrap/ConfigProvider.java
// public interface ConfigProvider {
// 
//     void configure(FeatureContext context);
// 
// }
// 
// Path: jersey/src/main/java/org/mvcspec/ozark/jersey/validation/OzarkValidationInterceptor.java
// public class OzarkValidationInterceptor implements ValidationInterceptor {
// 
//     /**
//      * For some weird reason we cannot preserve the <code>throws ConstraintViolationException</code>
//      * in the method signature. Bundling Ozark as a Glassfish plugin starts failing as soon as
//      * this class uses any interface from the javax.validation package. My current guess is
//      * that this is related to the OSGi bundling.
//      */
//     @Override
//     public void onValidate(ValidationInterceptorContext context) {
// 
//         /*
//          * TODO: Won't work correctly for mixed controller/resource methods.
//          */
//         Class<?> resourceClass = context.getResource().getClass();
//         boolean mvcRequest = AnnotationUtils.hasAnnotationOnClassOrMethod(resourceClass, Controller.class);
// 
//         if (!mvcRequest) {
//             context.proceed();
//         }
// 
//     }
// 
// }


// Path: jersey/src/main/java/org/mvcspec/ozark/jersey/bootstrap/JerseyConfigProvider.java
import org.mvcspec.ozark.bootstrap.ConfigProvider;
import org.mvcspec.ozark.jersey.model.OzarkModelProcessor;
import org.mvcspec.ozark.jersey.validation.OzarkValidationInterceptor;
import javax.ws.rs.core.FeatureContext;

/*
 * 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.jersey.bootstrap;



/**
 * Implementation of ConfigProvider for the Jersey module.
 *
 * @author Christian Kaltepoth
 */
public class JerseyConfigProvider implements ConfigProvider {

    @Override
    public void configure(FeatureContext context) {
        context.register(OzarkModelProcessor.class);
        context.register(OzarkValidationInterceptor.class);