public interface XmlRootHandle<T>
Modifier and Type | Method and Description |
---|---|
void |
addRoot()
This method can be used if the root of the
tree has no required fields, and is the
combination of
XmlService.createBean(Class)
and addRoot(Object) . |
void |
addRoot(T root)
If this handle does not already have a
root bean this method will add the one
given
|
T |
getReadOnlyRoot(boolean representDefaults)
This method returns a read-only copy of the existing
tree.
|
T |
getRoot()
Gets the root of the JavaBean tree
|
Class<T> |
getRootClass()
Returns the root interface of this handle
|
URI |
getURI()
Represents the original URI from which this
tree was parsed (or null if this tree did not
come from a URI)
|
XmlRootCopy<T> |
getXmlRootCopy()
Creates a copy of this tree that is not advertised.
|
boolean |
isAdvertisedInHub()
Returns true if this handles root and children
are advertised in the
Hub |
boolean |
isAdvertisedInLocator()
Returns true if this handles root and children
are advertised in it service locator
|
void |
overlay(XmlRootHandle<T> newRoot)
This method overlays the current root and children with
the root and children from newRoot.
|
T |
removeRoot()
If this handle has a root this method
will delete it and all children, leaving
the root of this tree null
|
T getRoot()
Class<T> getRootClass()
URI getURI()
boolean isAdvertisedInLocator()
boolean isAdvertisedInHub()
Hub
Hub
T getReadOnlyRoot(boolean representDefaults)
If representsDefaults is true then getters for unset fields will return the default value. If representsDefaults is false then getters for unset fields will return null (or 0 (and false) for scalars). Setting representsDefault to false is useful if this tree is to be used to marshall back to XML, since JAXB will then not write the values back out to the file
representDefaults
- If true getters will return default values,
if false getters will return null (or zero/false for scalars)XmlRootCopy<T> getXmlRootCopy()
There is no requirement to call XmlRootCopy.merge()
since the parent keeps no track of children. However,
the XmlRootCopy.merge()
method will fail if
a modification has been made to the parent since the
time the copy was created
void overlay(XmlRootHandle<T> newRoot)
All nodes that are at the same spot in the tree (have the same xpath and same instance name) will not be modified, but will instead have attributes changed. All nodes present in newRoot but not in this root will be considered adds. All nodes not present in newRoot but in this root will be considered deletes
The URI will not be modified by this call, nor will the state of advertisement
newRoot
- The non-null root that will be overlayed
onto this handlevoid addRoot(T root)
root
- The non-null instance of the
root type of this handleIllegalStateException
- if this handle
already has a rootvoid addRoot()
XmlService.createBean(Class)
and addRoot(Object)
. This method
will throw an exception from the validator
(if validation is enabled) if the root type
has required fields or fails other validationT removeRoot()
Copyright © 2009–2018 Oracle Corporation. All rights reserved.