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