1 23 24 package org.enhydra.xml.lazydom; 25 26 import java.io.PrintWriter ; 27 28 import org.enhydra.xml.dom.DOMInfoPrinter; 29 import org.enhydra.xml.dom.DOMTraversal; 30 import org.w3c.dom.Element ; 31 import org.w3c.dom.Node ; 32 33 36 final public class LazyDOMInfoPrinter extends DOMInfoPrinter { 37 40 public LazyDOMInfoPrinter(int options, 41 DOMTraversal traverser, 42 PrintWriter out) { 43 super(options, traverser, out); 44 } 45 46 49 protected void printNodeName(Node node) { 50 super.printNodeName(node); 51 if (((LazyNode)node).isTemplateNode()) { 52 fOut.print("%[T]"); 53 } 54 } 55 56 61 protected boolean hasPrintAttributes(Element element) { 62 LazyElement lazyElement = (LazyElement)element; 63 if (lazyElement.isTemplateNode()) { 64 return super.hasPrintAttributes(lazyElement); 66 } else if (lazyElement.areAttributesExpanded()) { 67 return super.hasPrintAttributes(lazyElement); 69 } else { 70 return super.hasPrintAttributes(lazyElement.getTemplateElement()); 72 } 73 } 74 } 75 | Popular Tags |