Package org.glassfish.hk2.xml.api
Interface XmlRootCopy<T>
- All Known Implementing Classes:
XmlRootCopyImpl
public interface XmlRootCopy<T>
This represents a copy of the parent
XmlRootHandle. This tree can
be traversed and modified without those
modifications being reflected in the parent.
When the merge() method is called
the parent tree will get all the changes
made to this tree in one commit. The XmlRootCopy
allows for multiple changes to be made to the
root and its children in one atomic unit (either
all changes are made to the parent or none of them)
If the parent was changed after this copy
was created then the merge will fail. The
method isMergeable() can be used
to determine if this copy can still be merged
back into the parent
- Author:
- jwells
-
Method Summary
Modifier and TypeMethodDescriptionGets the root of the JavaBean treeGets the XmlRootHandle from which this copy was createdbooleanReturns true if this child copy can still have merge called on it succesfullyvoidmerge()Merges the changes made to this tree into the parent tree
-
Method Details
-
getParent
XmlRootHandle<T> getParent()Gets the XmlRootHandle from which this copy was created- Returns:
-
getChildRoot
T getChildRoot()Gets the root of the JavaBean tree- Returns:
- The root of the JavaBean tree. Will only return null if the tree has not yet been created
-
isMergeable
boolean isMergeable()Returns true if this child copy can still have merge called on it succesfully- Returns:
- true if it is still possible to call merge (i.e., there has not been a change to the parent tree since this copy was made)
-
merge
void merge()Merges the changes made to this tree into the parent tree
-