001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.juneau.rest.server.processor;
018
019import org.apache.juneau.rest.server.view.*;
020
021/**
022 * Marker interface for response processors that act as catch-alls — i.e. processors that
023 * accept any non-null return value when no more-specific processor matches.
024 *
025 * <p>
026 * During {@link ResponseProcessorList} construction, any processor implementing
027 * {@link ViewRenderer} is automatically repositioned to run before the first
028 * {@code CatchAllResponseProcessor} in the chain.  This ensures that
029 * {@code View}-returning {@code @RestOp} methods reach the appropriate renderer rather than
030 * falling through to the catch-all serializer.
031 *
032 * <p>
033 * {@link SerializedPojoProcessor} is the canonical catch-all and implements this interface.
034 * Future catch-all processors should also implement this interface to preserve the ordering
035 * invariant for any registered {@link ViewRenderer}.
036 *
037 * <h5 class='section'>See Also:</h5><ul>
038 *    <li class='jc'>{@link ViewRenderer}
039 *    <li class='jc'>{@link ResponseProcessorList}
040 *    <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/ResponseProcessors">Response Processors</a>
041 * </ul>
042 *
043 * @since 10.0.0
044 */
045public interface CatchAllResponseProcessor extends ResponseProcessor {}