Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright 2004-2005 the original author or authors.
  *
  * 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.codehaus.groovy.grails.beans.factory;
A factory bean that creates the URL mappings, checking if there is a bean called urlMap in the ctx and merging that with the mappings set explicitly on this bean.

Author(s):
Graeme Rocher
Since:
0.3
@SuppressWarnings({"unchecked","rawtypes"})
    private static final Log LOG = LogFactory.getLog(UrlMappingFactoryBean.class);
    private static final String URL_MAP_BEAN = "urlMappings";
    private Map mappings = new HashMap();
    /* (non-Javadoc)
     * @see org.springframework.beans.factory.config.AbstractFactoryBean#createInstance()
     */
    @Override
    protected Map createInstance() {
            if (o instanceof Map) {
                .putAll((Map)o);
            }
        }
        if (.isDebugEnabled()) {
            .debug("[UrlMappingFactoryBean] Creating URL mappings as...");
            for (Object key : .keySet()) {
                .debug("[UrlMappingFactoryBean] " + key + "=" + .get(key));
            }
        }
        return ;
    }
    /* (non-Javadoc)
     * @see org.springframework.beans.factory.FactoryBean#getObjectType()
     */
    @Override
    public Class<?> getObjectType() {
        return Map.class;
    }
    public void setMappings(Map mappings) {
        this. = mappings;
    }
    public void setApplicationContext(ApplicationContext applicationContext) {
        this. = applicationContext;
    }
New to GrepCode? Check out our FAQ X