| java.lang.Object org.zkoss.idom.impl.AbstractItem
All known Subclasses: org.zkoss.idom.impl.AbstractGroup, org.zkoss.idom.ProcessingInstruction, org.zkoss.idom.DocType, org.zkoss.idom.impl.AbstractTextual, org.zkoss.idom.Attribute,
AbstractItem | abstract public class AbstractItem implements Item,Node,Serializable,Cloneable(Code) | | A semi-implemented item for leaf vertices.
A leaf item is a item without any children.
For cores having child cores, use Group.
Important methods that the deriving might want to override.
- Item.getName
- It must be overrided to provide a local name.
- Item.setName
- Overrid it if it allows to change the name.
Default: throws an exception.
- Item.getText
- Override it if it has a text representation.
Default: returns null.
- Item.setText
- Overrid it if it allows to change the text.
Default: throws an exception.
- Node.getNodeType
- It must be overrided to provide the type.
- Item.clone
- Override it if any other members to handle specially.
Note: by definition, we do deep clone only.
- Object.toString
- Override if you want a representation other than
XMLOutputter does.
author: tomyeh See Also: org.zkoss.idom.Item |
Field Summary | |
protected transient boolean | _modified The modification flag. |
Method Summary | |
public Node | appendChild(Node newChild) | final protected void | checkWritable() Checks whether this item is writable (ie, isReady). | public void | clearModified(boolean includingDescendant) | public Item | clone(boolean preserveModified) | public Object | clone() Clones this object (a deep cloning not including contents contained
in Textual nodes). | final public Node | cloneNode(boolean deep) | public short | compareDocumentPosition(Node other) | public Item | detach() | final public boolean | equals(Object o) Overriding this method is prohibited. | public NamedNodeMap | getAttributes() | public String | getBaseURI() | public NodeList | getChildNodes() | public Document | getDocument() | public Object | getFeature(String feature, String version) | public Node | getFirstChild() | public Node | getLastChild() | public String | getLocalName() | final public Locator | getLocator() | public String | getNamespaceURI() | final public Node | getNextSibling() | public String | getNodeName() | public String | getNodeValue() | public org.w3c.dom.Document | getOwnerDocument() | final public Group | getParent() | final public Node | getParentNode() | public String | getPrefix() | final public Node | getPreviousSibling() | public String | getText() | public String | getTextContent() | public Object | getUserData(String key) | public boolean | hasAttributes() | public boolean | hasChildNodes() | final public int | hashCode() Overriding this method is prohibited. | public Node | insertBefore(Node newChild, Node refChild) | public boolean | isDefaultNamespace(String namespaceURI) | public boolean | isEqualNode(Node arg) | public boolean | isModified() | public boolean | isReadonly() | public boolean | isSameNode(Node other) | final public boolean | isSupported(String feature, String version) | public String | lookupNamespaceURI(String prefix) | public String | lookupPrefix(String namespaceURI) | protected static boolean | match(Namespaceable vtx, String namespace, String name, Pattern ptn, int mode) Tests whether a namespaceable item matches the criteria. | final public void | normalize() | public Node | removeChild(Node oldChild) | public Node | replaceChild(Node newChild, Node oldChild) | final public void | setLocator(Locator loc) | public void | setModified() | public void | setName(String name) | public void | setNodeValue(String nodeValue) | public void | setParent(Group parent) | public void | setPrefix(String prefix) | public void | setReadonly(boolean readonly) Sets the read-only flag of this item. | public void | setText(String text) | public void | setTextContent(String textContent) | public Object | setUserData(String key, Object data, UserDataHandler handler) |
_modified | protected transient boolean _modified(Code) | | The modification flag.
|
AbstractItem | protected AbstractItem()(Code) | | Constructor.
|
checkWritable | final protected void checkWritable()(Code) | | Checks whether this item is writable (ie, isReady).
exception: DOMException - with NO_MODIFICATION_ALLOWED_ERR if not writable |
clearModified | public void clearModified(boolean includingDescendant)(Code) | | |
clone | public Item clone(boolean preserveModified)(Code) | | |
clone | public Object clone()(Code) | | Clones this object (a deep cloning not including contents contained
in Textual nodes).
Note: after cloning, the read-only flag always becomes false,
and the parent becomes null (i.e., detached).
|
cloneNode | final public Node cloneNode(boolean deep)(Code) | | |
equals | final public boolean equals(Object o)(Code) | | Overriding this method is prohibited.
|
getNextSibling | final public Node getNextSibling()(Code) | | |
getParentNode | final public Node getParentNode()(Code) | | |
getPreviousSibling | final public Node getPreviousSibling()(Code) | | |
hasAttributes | public boolean hasAttributes()(Code) | | |
hasChildNodes | public boolean hasChildNodes()(Code) | | |
hashCode | final public int hashCode()(Code) | | Overriding this method is prohibited.
|
isDefaultNamespace | public boolean isDefaultNamespace(String namespaceURI)(Code) | | |
isEqualNode | public boolean isEqualNode(Node arg)(Code) | | |
isModified | public boolean isModified()(Code) | | |
isReadonly | public boolean isReadonly()(Code) | | |
isSameNode | public boolean isSameNode(Node other)(Code) | | |
match | protected static boolean match(Namespaceable vtx, String namespace, String name, Pattern ptn, int mode)(Code) | | Tests whether a namespaceable item matches the criteria.
If mode don't contain FIND_BY_REGEX, ptn is ignored.
|
normalize | final public void normalize()(Code) | | |
setModified | public void setModified()(Code) | | |
setNodeValue | public void setNodeValue(String nodeValue)(Code) | | |
setReadonly | public void setReadonly(boolean readonly)(Code) | | Sets the read-only flag of this item. It causes this item
and all its descendants read-only, see
AbstractItem.isReadonly .
Deriving class might restrict more conditions here.
|
|
|