input
stringlengths
10
828
output
stringlengths
5
107
public void set node value string value set node value internal value notify document owner document replaced text this
sets the content possibly firing related events
public string get data if needs sync data synchronize data return data
retrieve character data currently stored in this node
public named node map get attributes if needs sync data synchronize data if attributes null attributes new attribute map this null return attributes get attributes named node map
retrieve all the attributes as a set
public void append data string data if is read only throw new domexception domexception no modification allowed err dom001 modification not allowed if needs sync data synchronize data set node value this data data append data string
concatenate additional characters onto the end of the data
public node clone node boolean deep element impl newnode element impl super clone node deep replicate named node map rather than sharing it if attributes null newnode attributes attribute map attributes clone map newnode return newnode clone node boolean node
return a duplicate copy of this element
public string get attribute string name if needs sync data synchronize data if attributes null return attr attr attr attributes get named item name return attr null attr get value get attribute string string
look up a single attribute by name
public attr get attribute node string name if needs sync data synchronize data if attributes null return null return attr attributes get named item name get attribute node string attr
look up a single attribute by name
public int get length preload all matching elements stops when we run out of subtree item java lang integer max value return nodes size
returns the length of the node list
public node list get elements by tag name string tagname return new deep node list impl this tagname
returns a node list of all descendent nodes children
public string get tag name if needs sync data synchronize data return name
returns the name of the element
protected void set event listeners node impl n vector listeners if event listeners null event listeners new hashtable if listeners null event listeners remove n if event listeners is empty stop firing events when there isn t any listener mutation events false else event listeners put n listeners turn mutation events on mutation events true
store event listener registered on a given node
public void remove attribute string name if owner document error checking is read only throw new domexception domexception no modification allowed err dom001 modification not allowed if needs sync data synchronize data if attributes null return attributes safe remove named item name remove attribute string
remove the named attribute from this element
public short get node type return node attribute node
a short integer indicating what type of node this is
public void set attribute string name string value if owner document error checking is read only throw new domexception domexception no modification allowed err dom001 modification not allowed if needs sync data synchronize data attr new attr get attribute node name if new attr null new attr get owner document create attribute name if attributes null attributes new attribute map this null new attr set node value value attributes set named item new attr else new attr set node value value set attribute string string
add a new name value pair or replace the value of the existing
public void set node value string value throws domexception set value value
implicit in the rerouting of get node value to get value is the
public string get attribute ns string namespace uri string local name if needs sync data synchronize data if attributes null return attr attr attr attributes get named item ns namespace uri local name return attr null attr get value get attribute ns string string string
introduced in dom level 2
public string get node value return get value
in attribute objects node value is considered a synonym for
public string get name if needs sync data synchronize data return name get name string
in attributes node name is considered a synonym for the
public void remove attribute ns string namespace uri string local name if owner document error checking is read only throw new domexception domexception no modification allowed err dom001 modification not allowed if needs sync data synchronize data if attributes null return attributes safe remove named item ns namespace uri local name remove attribute ns string string
introduced in dom level 2
public attr get attribute node ns string namespace uri string local name if needs sync data synchronize data if attributes null return null return attr attributes get named item ns namespace uri local name get attribute node ns string string attr
retrieves an attr node by local name and namespace uri
public string get value if needs sync children synchronize children if value null return if has string value return string value child node first child child node value child node node first child next sibling if node null return first child get node value string buffer value new string buffer first child get node value while node null value append node get node value node node next sibling return value to string get value string
the string value of an attribute is its text representation
protected void dispatch aggregate events node impl node enclosing attr ea if ea null dispatch aggregate events node ea node ea oldvalue mutation event modification else dispatch aggregate events node null null short 0 dispatch aggregate events node impl enclosing attr void
non dom internal convenience wrapper for calling
public boolean has attributes if needs sync data synchronize data return attributes null attributes get length 0
introduced in dom level 2
public boolean get specified if needs sync data synchronize data return is specified get specified boolean
the specified flag is true if and only if this attributes
public boolean has attribute string name return get attribute node name null
introduced in dom level 2
public element get element if we have an owner owner node is our owner element otherwise it s our owner document and we don t have an owner element return element is owned owner node null
returns the element node that this attribute is associated with
public boolean has attribute ns string namespace uri string local name return get attribute node ns namespace uri local name null
introduced in dom level 2
public element get owner element if we have an owner owner node is our owner element otherwise it s our owner document and we don t have an owner element return element is owned owner node null
returns the element node that this attribute is associated with
public void set read only boolean read only boolean deep super set read only read only deep if attributes null attributes set read only read only true
non dom subclassed to flip the attributes readonly switch as well
protected void synchronize data no need to sync in the future needs sync data false we don t want to generate any event for this so turn them off boolean orig owner document get mutation events owner document set mutation events false attributes setup default attributes set mutation events flag back to its original value owner document set mutation events orig synchronize data
synchronizes the data name and value for fast nodes
public void set specified boolean arg if needs sync data synchronize data is specified arg set specified boolean
non dom for use by parser
protected void setup default attributes named node map impl defaults get default attributes if defaults null attributes new attribute map this defaults
setup the default attributes
public string to string return get name get value
non dom method for debugging convenience
protected named node map impl get default attributes document type impl doctype document type impl owner document get doctype if doctype null return null element definition impl eldef element definition impl doctype get elements get named item get node name if eldef null return null return named node map impl eldef get attributes get default attributes
get the default attributes
public boolean has child nodes if needs sync children synchronize children return value null
test whether this node has any children
public node list get child nodes jkess known issue here if needs sync children synchronize children return this get child nodes node list
obtain a node list enumerating all children of this node
public node get first child if needs sync children synchronize children make child node return node value get first child node
the first child of this node or null if none
public node get last child if needs sync children synchronize children return last child get last child node
the last child of this node or null if none
public int get length if has string value return 1 child node node child node value int length 0 for node null node node next sibling length return length get length int
node list method count the immediate children of this node
public node item int index if has string value if index 0 value null return null else make child node return node value child node node child node value for int i 0 i index node null i node node next sibling return node item int node
node list method return the nth immediate child of this node or
public void set read only boolean read only boolean deep super set read only read only deep if deep if needs sync children synchronize children if has string value return recursively set kids for child node mykid child node value mykid null mykid mykid next sibling if mykid get node type node entity reference node mykid set read only read only true set read only boolean boolean
override default behavior so that if deep is true children are also
public short get node type return node impl element definition node
a short integer indicating what type of node this is
protected void synchronize children by default just change the flag to avoid calling this method again needs sync children false
override this method in subclass to hook in efficient
public node clone node boolean deep element definition impl newnode element definition impl super clone node deep named node map must be explicitly replicated to avoid sharing newnode attributes attributes clone map newnode return newnode clone node boolean node
replicate this object
public named node map get attributes if needs sync children synchronize children return attributes get attributes named node map
query the attributes defined on this element
public int get what to show return f what to show
return the what to show value
public node filter get filter return f node filter
return the node filter
public boolean get expand entity references return f entity reference expansion
return whether children entity references are included in the iterator
public node get current node return f current node
return the current node
public void set current node node node f current node node
return the current node
public node parent node if f current node null return null node node get parent node f current node if node null f current node node return node
return the parent node from the current node
public node first child if f current node null return null node node get first child f current node if node null f current node node return node
return the first child node from the current node
public node last child if f current node null return null node node get last child f current node if node null f current node node return node
return the last child node from the current node
public node previous sibling if f current node null return null node node get previous sibling f current node if node null f current node node return node
return the previous sibling node from the current node
public node next sibling if f current node null return null node node get next sibling f current node if node null f current node node return node
return the next sibling node from the current node
public string get node value return null overridden in some subclasses
returns the node value
public node next node if f current node null return null node result get first child f current node if result null f current node result return result result get next sibling f current node if result null f current node result return result return parent s 1st sibling node parent get parent node f current node while parent null result get next sibling parent if result null f current node result return result else parent get parent node parent end return null return null
return the next node from the current node
public short get node type return node cdata section node
a short integer indicating what type of node this is
public string get node name return cdata section
returns the node name
public node clone node boolean deep if needs sync data synchronize data node impl newnode try newnode node impl clone catch clone not supported exception e revisit don t fail silently but don t want to tie to parser guts system out println unexpected e return null need to break the association w original kids newnode owner node owner document newnode is owned false revisit what to do when read only ac newnode is read only false return newnode clone node boolean node
returns a duplicate of a given node
public short get node type return node entity node
a short integer indicating what type of node this is
public document get owner document if we have an owner simply forward the request otherwise owner node is our owner document if is owned return owner node owner document else return document owner node
find the document that this node belongs to the document in
public string get public id if needs sync data synchronize data return public id get public id string
the public identifier associated with the entity
public string get system id if needs sync data synchronize data return system id get system id string
the system identifier associated with the entity
public string get version if needs sync data synchronize data return version get version string
dom level 3 wd experimental
public string get encoding if needs sync data synchronize data return encoding get version string
dom level 3 wd experimental
public string get notation name if needs sync data synchronize data return notation name get notation name string
unparsed entities which contain non xml data have a
public void set public id string id if needs sync data synchronize data public id id set public id string
dom level 2 the public identifier associated with the entity
public void set encoding string value if needs sync data synchronize data encoding value set encoding string
dom level 3 wd experimental
public void set version string value if needs sync data synchronize data version value set version string
dom level 3 wd experimental
public void set system id string id if needs sync data synchronize data system id id set system id string
dom level 2 the system identifier associated with the entity
public void set notation name string name if needs sync data synchronize data notation name name set notation name string
dom level 2 unparsed entities which contain non xml data have a
public node get next sibling return null default behavior overriden in child node
the next child of this nodes parent or null if none
public node get previous sibling return null default behavior overriden in child node
the previous child of this nodes parent or null if none
public named node map get attributes return null overridden in element impl
return the collection of attributes associated with this node
public boolean has attributes return false overridden in element impl
returns whether this node if it is an element has any attributes
public void save changes throws messaging exception modified true saved true update headers
updates the appropriate header fields of this message to be
public boolean has child nodes return false
test whether this node has any children
public string get node name return document
returns the node name
public node get first child return null
the first child of this node or null if none
public node clone node boolean deep core document impl newdoc new core document impl clone node newdoc deep return newdoc clone node boolean node
deep clone a document including fixing owner doc for the cloned
protected void update message id throws messaging exception set header message id unique value get unique message idvalue session
update the message id header
public node get last child return null
the first child of this node or null if none
protected void update headers throws messaging exception mime body part update headers this set header mime version 1 0 update message id if we ve cached a multipart or message object then we re now committed to using this instance of the object and we discard any stream data used to create this object if cached content null dh new data handler cached content get content type cached content null content null if content stream null try content stream close catch ioexception ioex nothing to do content stream null
called by the code save changes code method to actually
public node item int index return null
node list method return the nth immediate child of this node or
public node clone node boolean deep child node newnode child node super clone node deep need to break the association w original kids newnode previous sibling null newnode next sibling null newnode is first child false return newnode clone node boolean node
returns a duplicate of a given node
public node get parent node if we have an owner owner node is our parent otherwise it s our owner document and we don t have a parent return is owned owner node null
returns the parent node of this node
public node get next sibling return next sibling
the next child of this nodes parent or null if none
public node get previous sibling if we are the first child previous sibling actually refers to our parent s last child but we hide that return is first child null previous sibling
the previous child of this nodes parent or null if none
public comment create comment string data return new comment impl this data
factory method creates a comment having this document as its
public node clone node boolean deep if needs sync children synchronize children parent node newnode parent node super clone node deep set owner document newnode owner document owner document need to break the association w original kids newnode first child null invalidate cache for children node list newnode f cached child index 1 newnode f cached length 1 then if deep clone the kids too if deep for child node child first child child null child child next sibling newnode append child child clone node true return newnode clone node boolean node
returns a duplicate of a given node
public document fragment create document fragment return new document fragment impl this
factory method creates a document fragment having this document
public document get owner document return owner document
find the document that this node belongs to the document in
public boolean has child nodes if needs sync children synchronize children return first child null
test whether this node has any children
public node list get child nodes if needs sync children synchronize children return this get child nodes node list
obtain a node list enumerating all children of this node
public void set read only boolean read only boolean deep if needs sync data synchronize data is read only read only set read only boolean boolean
non dom pr dom level 1 19980818 mentions readonly nodes in conjunction
public node get first child if needs sync children synchronize children return first child get first child node
the first child of this node or null if none
public boolean get read only if needs sync data synchronize data return is read only get read only boolean
non dom returns true if this node is read only
public void set user data object data owner document set user data this data
non dom as an alternative to subclassing the dom this implementation
protected void changed we do not actually store this information on every node we only have a global indicator on the document doing otherwise cost us too much for little gain owner document changed
denotes that this node has changed