001/*002 * Copyright 2002-2014 the original author or authors.003 *004 * Licensed under the Apache License, Version 2.0 (the "License");005 * you may not use this file except in compliance with the License.006 * You may obtain a copy of the License at007 *008 * https://www.apache.org/licenses/LICENSE-2.0009 *010 * Unless required by applicable law or agreed to in writing, software011 * distributed under the License is distributed on an "AS IS" BASIS,012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.013 * See the License for the specific language governing permissions and014 * limitations under the License.015 */016017package org.springframework.web.portlet.handler;018019import java.util.ArrayList;020import java.util.Arrays;021import java.util.List;022import javax.portlet.PortletRequest;023024import org.springframework.beans.BeansException;025import org.springframework.context.support.ApplicationObjectSupport;026import org.springframework.core.Ordered;027import org.springframework.web.context.request.WebRequestInterceptor;028import org.springframework.web.portlet.HandlerExecutionChain;029import org.springframework.web.portlet.HandlerInterceptor;030import org.springframework.web.portlet.HandlerMapping;031032/**033 * Abstract base class for {@link org.springframework.web.portlet.HandlerMapping}034 * implementations. Supports ordering, a default handler, and handler interceptors.035 *036 * @author Juergen Hoeller037 * @author John A. Lewis038 * @since 2.0039 * @see #getHandlerInternal040 * @see #setDefaultHandler041 * @see #setInterceptors042 * @see org.springframework.web.portlet.HandlerInterceptor043 */044public abstract class AbstractHandlerMapping extends ApplicationObjectSupport implements HandlerMapping, Ordered {045046 private int order = Integer.MAX_VALUE; // default: same as non-Ordered047048 private Object defaultHandler;049050 private final List<Object> interceptors = new ArrayList<Object>();051052 private boolean applyWebRequestInterceptorsToRenderPhaseOnly = true;053054 private HandlerInterceptor[] adaptedInterceptors;055056057 /**058 * Specify the order value for this HandlerMapping bean.059 * <p>Default value is {@code Integer.MAX_VALUE}, meaning that it's non-ordered.060 * @see org.springframework.core.Ordered#getOrder()061 */062 public final void setOrder(int order) {063 this.order = order;064 }065066 @Override067 public final int getOrder() {068 return this.order;069 }070071 /**072 * Set the default handler for this handler mapping.073 * This handler will be returned if no specific mapping was found.074 * <p>Default is {@code null}, indicating no default handler.075 */076 public void setDefaultHandler(Object defaultHandler) {077 this.d