Clover coverage report - JBind Project
Coverage timestamp: Fr Mai 28 2004 11:17:36 CEST
file stats: LOC: 108   Methods: 16
NCLOC: 68   Classes: 1
This license of Clover is provided to support the development of JBind only. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover.
 
 Source file Conditionals Statements Methods TOTAL
AttributeImpl.java - 63,2% 50% 57,1%
 1   
 /*
 2   
  * JBind
 3   
  *
 4   
  * Copyright (c) by Stefan Wachter. All rights reserved.
 5   
  *
 6   
  * Usage, modification, and redistribution is subject to license terms that are
 7   
  * available at 'http://www.jbind.org'. The JBind license is like the
 8   
  * 'Apache Software License V 1.1'.
 9   
  */
 10   
 package org.jbind.xml.instance.impl;
 11   
 
 12   
 import java.util.Collections;
 13   
 import java.util.Iterator;
 14   
 import java.util.ListIterator;
 15   
 import java.util.Map;
 16   
 
 17   
 import org.jbind.xml.base.ILocation;
 18   
 import org.jbind.xml.core.base.ITextContentMemento;
 19   
 import org.jbind.xml.core.base.ITextContentProvider;
 20   
 import org.jbind.xml.core.bridge.IAttributeImpl;
 21   
 import org.jbind.xml.core.bridge.IDataImplVisitor;
 22   
 import org.jbind.xml.core.bridge.IElementImpl;
 23   
 import org.jbind.xml.core.data.IAnyTypeData;
 24   
 import org.jbind.xml.msg.XmlException;
 25   
 
 26   
 public class AttributeImpl extends DataImpl implements IAttributeImpl {
 27   
 
 28   
   private boolean myIsDefault;
 29   
   private TextContent myTextContent = new TextContent();
 30   
 
 31  6
   public AttributeImpl(IElementImpl aParent, String aNamespace, String aName, ITextContentProvider aProvider, boolean anIsDefault, ILocation aLocation) {
 32  6
     super(aParent, aNamespace, aName, aLocation);
 33  6
     myIsDefault = anIsDefault;
 34  6
     setTextContent(aProvider);
 35   
   }
 36   
 
 37  2196
   public AttributeImpl(IElementImpl aParent, String aNamespace, String aName, String aValue, boolean anIsDefault, ILocation aLocation) {
 38  2196
     super(aParent, aNamespace, aName, aLocation);
 39  2196
     myIsDefault = anIsDefault;
 40  2196
     setTextContent(aValue);
 41   
   }
 42   
 
 43  0
   public void accept(IDataImplVisitor aVisitor) throws XmlException {
 44   
     // attributes are not visited
 45   
   }
 46   
 
 47  0
   public IAnyTypeData getAttributeData(String aNamespace, String aLocalName) {
 48  0
     return null;
 49   
   }
 50   
 
 51  0
   public boolean isDefault() {
 52  0
     return myIsDefault;
 53   
   }
 54   
 
 55  0
   public boolean isNil() {
 56  0
     return false;
 57   
   }
 58   
 
 59  0
   public Iterator iterAttributes(String aNamespace, String aName) {
 60  0
     return Collections.EMPTY_LIST.iterator();
 61   
   }
 62   
 
 63  0
   public ListIterator iterChildren() {
 64  0
     return Collections.EMPTY_LIST.listIterator();
 65   
   }
 66   
 
 67  0
   public ListIterator iterElementData(String aNamespace, String aLocalName) {
 68  0
     return Collections.EMPTY_LIST.listIterator();
 69   
   }
 70   
 
 71   
   //
 72   
   // namespace
 73   
   //
 74   
 
 75  16
   public Map getPrefixToNamespaceMapping() {
 76  16
     return ((IElementImpl)getParentImpl()).getPrefixToNamespaceMapping();
 77   
   }
 78   
 
 79   
   //
 80   
   // text content
 81   
   //
 82   
 
 83  0
   public boolean hasTextContent() {
 84  0
     return true;
 85   
   }
 86   
 
 87  1
   public void restoreTextContent(ITextContentMemento aMemento) {
 88  1
     myTextContent.restoreTextContent(aMemento);
 89   
   }
 90   
 
 91  6
   public ITextContentMemento saveTextContent() {
 92  6
     return myTextContent.saveTextContent();
 93   
   }
 94   
 
 95  1992
   public String getTextContent() {
 96  1992
     return myTextContent.getTextContent();
 97   
   }
 98   
 
 99  12
   public void setTextContent(ITextContentProvider aTextContentProvider) {
 100  12
     myTextContent.setTextContent(aTextContentProvider);
 101   
   }
 102   
 
 103  2196
   public void setTextContent(String aString) {
 104  2196
     myTextContent.setTextContent(aString);
 105   
   }
 106   
 
 107   
 }
 108