Coverage Report - org.kuali.student.r2.common.datadictionary.Student2RiceDictionaryEntryConverter
 
Classes in this File Line Coverage Branch Coverage Complexity
Student2RiceDictionaryEntryConverter
0%
0/18
0%
0/4
5
 
 1  
 /*
 2  
  * Copyright 2011 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 1.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.opensource.org/licenses/ecl1.php
 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, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.kuali.student.r2.common.datadictionary;
 17  
 
 18  
 import java.util.ArrayList;
 19  
 import java.util.List;
 20  
 import org.kuali.rice.krad.datadictionary.AttributeDefinition;
 21  
 import org.kuali.rice.krad.datadictionary.DataObjectEntry;
 22  
 import org.kuali.student.r2.common.datadictionary.infc.AttributeDefinitionInfc;
 23  
 import org.kuali.student.r2.common.datadictionary.infc.DictionaryEntry;
 24  
 
 25  
 /**
 26  
  *
 27  
  * @author nwright
 28  
  */
 29  0
 public class Student2RiceDictionaryEntryConverter {
 30  
 
 31  0
     private static org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(Student2RiceDictionaryEntryConverter.class);
 32  
 
 33  
     public DataObjectEntry convert(DictionaryEntry student) {
 34  0
         DataObjectEntry rice = new DataObjectEntry ();
 35  
         try {
 36  0
             rice.setDataObjectClass(Class.forName(student.getObjectClass()));
 37  0
         } catch (ClassNotFoundException ex) {
 38  0
            throw new IllegalArgumentException (student.getObjectClass(), ex);
 39  0
         }
 40  0
         rice.setName(student.getName());
 41  0
         rice.setObjectLabel(student.getObjectLabel());
 42  0
         rice.setObjectDescription(student.getObjectDescription());
 43  0
         rice.setTitleAttribute(student.getTitleAttribute());
 44  0
         rice.setPrimaryKeys(student.getPrimaryKeys());
 45  0
         if (student.getAttributes() != null) {
 46  0
             List<AttributeDefinition> list = new ArrayList(student.getAttributes().size());
 47  0
             for (AttributeDefinitionInfc ad : student.getAttributes()) {
 48  0
                 list.add(new Student2RiceAttributeDefinitionConverter ().convert(ad));
 49  
             }
 50  0
             rice.setAttributes (list);
 51  
         }
 52  0
         return rice;
 53  
     }
 54  
 }