Coverage Report - org.seasar.teeda.core.el.impl.MethodBindingFactoryImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
MethodBindingFactoryImpl
33%
3/9
0%
0/6
2
 
 1  
 /*
 2  
  * Copyright 2004-2011 the Seasar Foundation and the Others.
 3  
  *
 4  
  * Licensed under the Apache License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  *     http://www.apache.org/licenses/LICENSE-2.0
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 13  
  * either express or implied. See the License for the specific language
 14  
  * governing permissions and limitations under the License.
 15  
  */
 16  
 package org.seasar.teeda.core.el.impl;
 17  
 
 18  
 import javax.faces.application.Application;
 19  
 import javax.faces.el.MethodBinding;
 20  
 import javax.faces.el.ValueBinding;
 21  
 
 22  
 import org.seasar.teeda.core.el.ELParser;
 23  
 import org.seasar.teeda.core.el.MethodBindingFactory;
 24  
 import org.seasar.teeda.core.el.ValueBindingBase;
 25  
 import org.seasar.teeda.core.el.ValueBindingFactory;
 26  
 import org.seasar.teeda.core.exception.IllegalClassTypeException;
 27  
 
 28  
 /**
 29  
  * @author shot
 30  
  */
 31  1
 public class MethodBindingFactoryImpl implements MethodBindingFactory {
 32  
 
 33  
     private ValueBindingFactory valueBindingContextFactory;
 34  
 
 35  
     public void setValueBindingContext(
 36  
             ValueBindingFactory valueBindingContextFactory) {
 37  2
         this.valueBindingContextFactory = valueBindingContextFactory;
 38  2
     }
 39  
 
 40  
     public MethodBinding createMethodBinding(Application application,
 41  
             String ref, Class[] params) {
 42  0
         ValueBinding vb = valueBindingContextFactory.createValueBinding(
 43  
                 application, ref);
 44  0
         ELParser parser = valueBindingContextFactory.getELParser();
 45  0
         if (!(vb instanceof ValueBindingBase)) {
 46  0
             throw new IllegalClassTypeException(ValueBindingBase.class,
 47  
                     ValueBinding.class);
 48  
         }
 49  0
         MethodBinding mb = new MethodBindingImpl((ValueBindingBase) vb, params,
 50  
                 parser);
 51  0
         return mb;
 52  
     }
 53  
 
 54  
 }