All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.brandao.brutos.web.WebControllerManager Maven / Gradle / Ivy

There is a newer version: 2.0-rc3
Show newest version
/*
 * Brutos Web MVC http://www.brutosframework.com.br/
 * Copyright (C) 2009 Afonso Brandao. ([email protected])
 *
 * 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.brandao.brutos.web;

import org.brandao.brutos.ActionType;
import org.brandao.brutos.ControllerBuilder;
import org.brandao.brutos.ControllerManagerImp;
import org.brandao.brutos.DispatcherType;
import org.brandao.brutos.web.util.WebUtil;

/**
 *
 * @author Brandao
 */
public class WebControllerManager extends ControllerManagerImp{
 
    public WebControllerManager(){
        super();
    }
    
    public ControllerBuilder addController( String id, String view, 
            boolean resolvedView, DispatcherType dispatcherType,
            String name, Class classType, String actionId ){
            return addController( id, view, resolvedView,
                    dispatcherType, name, classType, actionId, 
                    ActionType.HIERARCHY);
    }
    
    public ControllerBuilder addController( String id, String view, 
            boolean resolvedView, DispatcherType dispatcherType, String name, 
            Class classType, 
            String actionId, ActionType actionType ){
        
        if(!ActionType.DETACHED.equals(actionType))
            WebUtil.checkURI(id, true);
        
        if(resolvedView && view != null)
            WebUtil.checkURI(view, true);
        
        ControllerBuilder builder =  
            super.addController( id, view,
                resolvedView,
                dispatcherType, name, classType, actionId, actionType );
        
        return new WebControllerBuilder(builder, this.internalUpdate);
    }
    
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy