1 20 21 25 26 package org.ozoneDB.xml.dom; 27 28 import org.w3c.dom.*; 29 30 31 37 public class ElementDeclImpl extends NodeImpl implements ElementDeclProxy { 38 39 final static long serialVersionUID = 1; 40 41 42 public short getNodeType() { 43 return ELEMENT_DECL_NODE; 44 } 45 46 47 public String getName() { 48 return getNodeName(); 49 } 50 51 52 public synchronized boolean equals( Object other ) { 53 65 return false; 66 } 67 68 69 76 public boolean isEmpty() { 77 return _empty; 78 } 79 80 81 87 public boolean isAny() { 88 return _any; 89 } 90 91 92 100 public boolean isMixed() { 101 return _mixed; 102 } 103 104 105 113 public boolean requiresOpeningTag() { 114 return _optionalOpen; 115 } 116 117 118 125 public boolean requiresClosingTag() { 126 return _optionalClose; 127 } 128 129 130 public final Object clone() { 131 ElementDeclProxy clone = null; 132 try { 133 clone = (ElementDeclProxy)database().createObject( ElementDeclImpl.class.getName() ); 134 (clone).init( _ownerDocument, getNodeName(), null, true ); 135 cloneInto( clone, true ); 136 } catch (Exception except) { 137 throw new DOMExceptionImpl( DOMExceptionImpl.PDOM_ERR, except.getMessage() ); 138 } 139 return clone; 140 } 141 142 143 public final Node cloneNode( boolean deep ) { 144 ElementDeclProxy clone = null; 145 try { 146 clone = (ElementDeclProxy)database().createObject( ElementDeclImpl.class.getName() ); 147 (clone).init( _ownerDocument, getNodeName(), null, true ); 148 cloneInto( clone, deep ); 149 } catch (Exception except) { 150 throw new DOMExceptionImpl( DOMExceptionImpl.PDOM_ERR, except.getMessage() ); 151 } 152 return clone; 153 } 154 155 156 163 ElementDeclImpl( DocumentImpl owner, String name, String definition ) { 164 this( owner, name, definition, false, false ); 165 } 166 167 168 179 ElementDeclImpl( DocumentImpl owner, String name, String definition, boolean optionalOpen, boolean optionalClose ) { 180 super( owner, name, null, true ); 181 _optionalOpen = optionalOpen; 182 if (_optionalOpen) { 183 _optionalClose = true; 184 } else { 185 _optionalClose = optionalClose; 186 } 187 if (definition.equals( "EMPTY" )) { 188 _empty = true; 189 } else if (definition.equals( "ANY" )) { 190 _any = true; 191 } else { 192 } 193 } 194 195 196 private ElementDeclImpl( DocumentImpl owner, String name ) { 197 super( owner, name, null, true ); 198 } 199 200 205 private boolean _optionalOpen; 206 207 208 212 private boolean _optionalClose; 213 214 215 218 private boolean _empty; 219 220 221 225 private boolean _any; 226 227 228 232 private boolean _mixed; 233 } 234 | Popular Tags |