|
0.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.metagloss.xml.DOMFeeder
public class DOMFeeder
The DOMFeeder
is capable of injecting XMLBind
-annotated
objects from XML sources.
inject(Object)
method several times, should different
objects only request a limited set of data from the current node and children.
Note:
It currently only works on a single level below the root element supplied upon initialization.
Field Summary | |
---|---|
boolean |
debug
|
Constructor Summary | |
---|---|
DOMFeeder(org.w3c.dom.Element root)
Creates the DOMFeeder with a single element. |
|
DOMFeeder(java.util.List<org.w3c.dom.Element> elements)
Creates the DOMFeeder with a list of elements. |
Method Summary | |
---|---|
void |
inject(java.lang.Object obj)
Sets up object via setter injection. |
boolean |
isStrictChecking()
Returns whether strict checking is enabled or not. |
boolean |
next()
Tries to move to the next element in the list. |
void |
setStrictChecking(boolean strictChecking)
Sets whether an injection-related error will throw XMLBindException upon error. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public boolean debug
Constructor Detail |
---|
public DOMFeeder(org.w3c.dom.Element root)
DOMFeeder
with a single element. When injecting several
objects of the same type, it is adviced to initialize the DOMFeeder
with a list
instead.
This constructor will cause next()
cause next to throw an
InjectorException
.
root
- Starting element.DOMUtils.getChildren(Element, String)
public DOMFeeder(java.util.List<org.w3c.dom.Element> elements)
DOMFeeder
with a list of elements. The element index
initializes before the first element in the list. Traverse forward
through the list by calling next()
.
The elements should be of the same type, that is, operate on the same
class of objects.
elements
- Starting elements.Method Detail |
---|
public boolean isStrictChecking()
setStrictChecking(boolean)
public void setStrictChecking(boolean strictChecking)
XMLBindException
upon error.
If
set to false, will continue parsing, discarding the element with
a logcat stacktrace.
Defaults to false
.
strictChecking
- If true, aborts injection upon error.public void inject(java.lang.Object obj)
Injector
inject
in interface Injector
obj
- Object to inject.public boolean next()
next
in interface Injector
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |