Coverage Report - org.kuali.student.r2.common.dto.HasAttributesInfo
 
Classes in this File Line Coverage Branch Coverage Complexity
HasAttributesInfo
0%
0/14
0%
0/8
2
 
 1  
 /*
 2  
  * Copyright 2010 The Kuali Foundation 
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.0 (the
 5  
  * "License"); you may not use this file except in compliance with the
 6  
  * License. You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.osedu.org/licenses/ECL-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, either express or
 13  
  * implied. See the License for the specific language governing
 14  
  * permissions and limitations under the License.
 15  
  */
 16  
 
 17  
 package org.kuali.student.r2.common.dto;
 18  
 
 19  
 import java.io.Serializable;
 20  
 import java.util.ArrayList;
 21  
 import java.util.List;
 22  
 
 23  
 import javax.xml.bind.annotation.XmlElement;
 24  
 import javax.xml.bind.annotation.XmlTransient;
 25  
 
 26  
 import org.kuali.student.r2.common.infc.Attribute;
 27  
 import org.kuali.student.r2.common.infc.HasAttributes;
 28  
 
 29  
 /**
 30  
  * Information about a entities with attributes.
 31  
  *
 32  
  * @author tom
 33  
  */
 34  
 
 35  
 @SuppressWarnings("serial")
 36  
 @XmlTransient
 37  
 public abstract class HasAttributesInfo 
 38  
     implements HasAttributes, Serializable {
 39  
 
 40  
     @XmlElement
 41  
     private List<AttributeInfo> attributes;
 42  
 
 43  
 
 44  
     /**
 45  
      * Constructs a new HasAttributesInfo.
 46  
      */
 47  0
     public HasAttributesInfo() {
 48  0
     }
 49  
     
 50  
     /**
 51  
      * Constructs a new HasAttributesInfo from another HasAttributes.
 52  
      *
 53  
      * @param hasAttrs the HasAttributes to copy
 54  
      */
 55  0
     public HasAttributesInfo(HasAttributes hasAttrs) {
 56  0
         if (null != hasAttrs) {
 57  0
             if (null != hasAttrs.getAttributes()) {
 58  0
                 attributes = new ArrayList<AttributeInfo>();
 59  0
                 for (Attribute attr : hasAttrs.getAttributes()) {
 60  0
                     attributes.add(new AttributeInfo(attr));
 61  
                 }
 62  
             }
 63  
         }
 64  0
     }
 65  
     
 66  
     @Override
 67  
     public List<AttributeInfo> getAttributes() {
 68  0
         if (attributes == null) {
 69  0
             attributes = new ArrayList<AttributeInfo>();
 70  
         }
 71  0
         return attributes;
 72  
     }
 73  
     
 74  
     public void setAttributes(List<AttributeInfo> attributes) {
 75  0
         this.attributes = attributes;
 76  0
     }
 77  
 }