1 23 24 package org.enhydra.xml.lazydom; 25 26 import org.enhydra.apache.xerces.dom.CDATASectionImpl; 27 import org.w3c.dom.Document ; 28 import org.w3c.dom.Node ; 29 30 33 public class LazyCDATASection extends CDATASectionImpl implements LazyNode { 34 40 protected LazyCDATASection(LazyDocument ownerDoc, 41 LazyCDATASection template, 42 String data) { 43 super(ownerDoc, 44 (template != null) ? template.getData() : data); 45 if (template != null) { 46 fTemplateNode = template; 47 fNodeId = template.getNodeId(); 48 } 49 } 50 51 55 58 private LazyCDATASection fTemplateNode = null; 59 60 64 public LazyCDATASection getTemplateCDATASection() { 65 return fTemplateNode; 66 } 67 68 71 public Node cloneNode(boolean deep) { 72 return super.cloneNode(deep); 74 } 75 76 80 83 private int fNodeId = NULL_NODE_ID; 84 85 88 private boolean fIsTemplateNode; 89 90 93 public void makeTemplateNode(int nodeId) { 94 fNodeId = nodeId; 95 fIsTemplateNode = true; 96 } 97 98 101 public int getNodeId() { 102 return fNodeId; 103 } 104 105 108 public boolean isTemplateNode() { 109 return fIsTemplateNode; 110 } 111 112 115 public LazyNode getTemplateNode() { 116 return fTemplateNode; 117 } 118 119 122 public LazyNode templateClone(Document ownerDocument) { 123 return new LazyCDATASection((LazyDocument)ownerDocument, this, null); 124 } 125 126 131 public void setNodeValue(String value) { 132 fNodeId = NULL_NODE_ID; 133 super.setNodeValue(value); 134 } 135 136 } 137 | Popular Tags |