Coverage Report - org.kuali.rice.kew.api.document.attribute.DocumentAttribute
 
Classes in this File Line Coverage Branch Coverage Complexity
DocumentAttribute
0%
0/10
0%
0/2
1.4
DocumentAttribute$Constants
0%
0/1
N/A
1.4
DocumentAttribute$Elements
0%
0/1
N/A
1.4
 
 1  
 package org.kuali.rice.kew.api.document.attribute;
 2  
 
 3  
 /**
 4  
  * TODO...
 5  
  */
 6  
 
 7  
 import org.apache.commons.lang.StringUtils;
 8  
 import org.kuali.rice.core.api.CoreConstants;
 9  
 import org.kuali.rice.core.api.mo.AbstractDataTransferObject;
 10  
 import org.w3c.dom.Element;
 11  
 
 12  
 import javax.xml.bind.annotation.XmlAccessType;
 13  
 import javax.xml.bind.annotation.XmlAccessorType;
 14  
 import javax.xml.bind.annotation.XmlAnyElement;
 15  
 import javax.xml.bind.annotation.XmlElement;
 16  
 import javax.xml.bind.annotation.XmlSeeAlso;
 17  
 import javax.xml.bind.annotation.XmlType;
 18  
 import java.util.Collection;
 19  
 
 20  
 @XmlAccessorType(XmlAccessType.NONE)
 21  
 @XmlType(name = DocumentAttribute.Constants.TYPE_NAME, propOrder = {
 22  
     DocumentAttribute.Elements.NAME,
 23  
     CoreConstants.CommonElements.FUTURE_ELEMENTS
 24  
 })
 25  
 @XmlSeeAlso( { DocumentAttributeString.class, DocumentAttributeDateTime.class, DocumentAttributeInteger.class, DocumentAttributeDecimal.class } )
 26  
 public abstract class DocumentAttribute<T> extends AbstractDataTransferObject {
 27  
 
 28  
     @XmlElement(name = Elements.NAME, required = true)
 29  
     private final String name;
 30  
 
 31  0
     @SuppressWarnings("unused")
 32  
     @XmlAnyElement
 33  
     private final Collection<Element> _futureElements = null;
 34  
 
 35  0
     protected DocumentAttribute() {
 36  0
         this.name = null;
 37  0
     }
 38  
 
 39  0
     DocumentAttribute(String name) {
 40  0
         if (StringUtils.isBlank(name)) {
 41  0
             throw new IllegalArgumentException("name was null or blank");
 42  
         }
 43  0
         this.name = name;
 44  0
     }
 45  
 
 46  
     public String getName() {
 47  0
         return name;
 48  
     }
 49  
 
 50  
     public abstract T getValue();
 51  
 
 52  
     public abstract DocumentAttributeDataType getDataType();
 53  
 
 54  
     /**
 55  
      * Defines some internal constants used on this class.
 56  
      */
 57  0
     static class Constants {
 58  
         final static String TYPE_NAME = "DocumentAttributeType";
 59  
     }
 60  
 
 61  
     /**
 62  
      * A private class which exposes constants which define the XML element names to use when this object is marshalled to XML.
 63  
      */
 64  0
     static class Elements {
 65  
         final static String NAME = "name";
 66  
     }
 67  
 
 68  
 }