1 21 24 package org.lobobrowser.html.domimpl; 25 26 import org.w3c.dom.*; 27 28 public class AttrImpl extends NodeImpl implements Attr { 29 private String name; 30 private String value; 31 private boolean specified; 32 private Element ownerElement; 33 private boolean isId; 34 35 39 public AttrImpl(String name, String value, boolean specified, Element owner, boolean isId) { 40 super(); 41 this.name = name; 42 this.value = value; 43 this.specified = specified; 44 this.ownerElement = owner; 45 this.isId = isId; 46 } 47 48 51 public AttrImpl(String name) { 52 super(); 53 this.name = name; 54 this.value = ""; 55 this.specified = false; 56 this.ownerElement = null; 57 this.isId = false; 58 } 59 60 public String getLocalName() { 61 return this.name; 62 } 63 64 public String getNodeName() { 65 return this.name; 66 } 67 68 public String getNodeValue() throws DOMException { 69 return this.value; 70 } 71 72 public void setNodeValue(String nodeValue) throws DOMException { 73 this.value = nodeValue; 74 } 75 76 public short getNodeType() { 77 return Node.ATTRIBUTE_NODE; 78 } 79 80 public String getName() { 81 return this.name; 82 } 83 84 public boolean getSpecified() { 85 return this.specified; 86 } 87 88 public String getValue() { 89 return this.value; 90 } 91 92 public void setValue(String value) throws DOMException { 93 this.value = value; 94 } 95 96 public Element getOwnerElement() { 97 return this.ownerElement; 98 } 99 100 public TypeInfo getSchemaTypeInfo() { 101 throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Namespaces not supported"); 102 } 103 104 public boolean isId() { 105 return this.isId; 106 } 107 108 public void setId(boolean value) { 109 this.isId = value; 110 } 111 112 protected Node createSimilarNode() { 113 return new AttrImpl(this.name, this.value, this.specified, this.ownerElement, this.isId); 114 } 115 } 116 | Popular Tags |