Coverage Report - org.trails.link.ModelLink
 
Classes in this File Line Coverage Branch Coverage Complexity
ModelLink
0% 
N/A 
0
 
 1  
 /*
 2  
  * Copyright 2004 Chris Nelson
 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 http://www.apache.org/licenses/LICENSE-2.0
 7  
  * Unless required by applicable law or agreed to in writing,
 8  
  * software distributed under the License is distributed on an "AS IS" BASIS,
 9  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 10  
  * See the License for the specific language governing permissions and limitations under the License.
 11  
  */
 12  
 package org.trails.link;
 13  
 
 14  
 import org.apache.hivemind.util.Defense;
 15  
 import org.apache.tapestry.annotations.InjectObject;
 16  
 import org.apache.tapestry.annotations.Parameter;
 17  
 import org.apache.tapestry.annotations.ComponentClass;
 18  
 import org.trails.util.Utils;
 19  
 import org.trails.descriptor.DescriptorService;
 20  
 import org.trails.descriptor.IClassDescriptor;
 21  
 
 22  
 @ComponentClass
 23  0
 public abstract class ModelLink extends TrailsLink
 24  
 {
 25  
 
 26  
         @Parameter(required = true)
 27  
         public abstract Object getModel();
 28  
 
 29  
         public IClassDescriptor getClassDescriptor()
 30  
         {
 31  0
                 Defense.notNull(getModel(), "model");
 32  0
                 return getDescriptorService().getClassDescriptor(Utils.checkForCGLIB(getModel().getClass()));
 33  
         }
 34  
 
 35  
         @InjectObject("spring:descriptorService")
 36  
         public abstract DescriptorService getDescriptorService();
 37  
 
 38  
 }