Coverage Report - net.sf.jolene.dom.Label
 
Classes in this File Line Coverage Branch Coverage Complexity
Label
85%
11/13
33%
2/6
0
 
 1  
 package net.sf.jolene.dom;
 2  
 
 3  
 import net.sf.jolene.constants.Tags;
 4  
 
 5  
 /**
 6  
  * A lable in an html document.
 7  
  *
 8  
  * @author Dan Howard
 9  
  * @since Oct 19, 2003
 10  
  */
 11  1
 public final class Label extends HTMLElement {
 12  
 
 13  
     /**
 14  
      * Default constructor.
 15  
      */
 16  18
     public Label() {
 17  18
         tag = Tags.label;
 18  18
     }
 19  
 
 20  
 
 21  
     /**
 22  
      * Returns a clone of the label object.
 23  
      *
 24  
      * @return Label object.
 25  
      */
 26  
     @Override
 27  
     public Label clone() {
 28  1
         return (Label) super.clone();
 29  
     }
 30  
 
 31  
     /**
 32  
      * Sets the value of the label. Same as setText.
 33  
      * @param value text value of the label.
 34  
      */
 35  
     @Override
 36  
     public void setValue(String value) {
 37  20
         super.setValue(value);
 38  20
         setContent(value);
 39  20
     }
 40  
 
 41  
 
 42  
     /**
 43  
      * Renders the label.
 44  
      *
 45  
      * @return The label as a html string.
 46  
      */
 47  
     @Override
 48  
     public String toString() {
 49  
 
 50  31
         if (swapWith != null) {
 51  0
             return swapWith.toString();
 52  
         }
 53  
 
 54  31
         if (!isRenderable() && !log.isDebugEnabled()) {
 55  0
             return "";
 56  
         }
 57  
 
 58  31
         return super.toString() + getContent() + "</" + tag + '>';
 59  
     }
 60  
 }