|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jibx.extras.BindingSelector
public class BindingSelector
Binding selector that supports versioned XML documents. This looks for a version attribute on the root element of the document, and selects the mapping to be used for unmarshalling based on the value. It also supports selecting the version for marshalling based on a supplied version argument value.
Constructor Summary | |
---|---|
BindingSelector(java.lang.String uri,
java.lang.String name,
java.lang.String[] versions,
java.lang.String[] bindings)
Constructor. |
Method Summary | |
---|---|
IUnmarshallingContext |
getContext()
Get initial unmarshalling context. |
void |
marshalVersioned(java.lang.Object obj,
java.lang.String version)
Marshal according to supplied version. |
void |
setIndent(int indent)
Set nesting indent spaces. |
void |
setOutput(java.io.OutputStream outs,
java.lang.String enc)
Set output stream and encoding. |
void |
setOutput(java.io.Writer outw)
Set output writer. |
java.lang.Object |
unmarshalVersioned(java.lang.Class clas)
Unmarshal according to document version. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BindingSelector(java.lang.String uri, java.lang.String name, java.lang.String[] versions, java.lang.String[] bindings)
uri
- version selection attribute URI (null
if none)name
- version selection attribute nameversions
- array of version texts (first is default)bindings
- array of binding names corresponding to versionsMethod Detail |
---|
public IUnmarshallingContext getContext()
unmarshalVersioned(java.lang.Class)
.
public void setOutput(java.io.OutputStream outs, java.lang.String enc)
outs
- stream for document data outputenc
- document output encoding, or null
for defaultpublic void setOutput(java.io.Writer outw)
outw
- writer for document data outputpublic void setIndent(int indent)
indent
- number of spaces to indent per level, or disable
indentation if negativepublic void marshalVersioned(java.lang.Object obj, java.lang.String version) throws JiBXException
obj
- root object to be marshalledversion
- identifier for version to be used in marshalling
JiBXException
- if error in marshallingpublic java.lang.Object unmarshalVersioned(java.lang.Class clas) throws JiBXException
clas
- expected class mapped to root element of document (used only
to look up the binding)
JiBXException
- if error in unmarshalling
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |