|
vSphere Client SDK API Documentation : version 5.5.0.1300321 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vmware.vise.search.JaxbPropertyUnmarshaller
public final class JaxbPropertyUnmarshaller
JAXB-based unmarshaller for object model data.
By default supports unmarshalling of primitive and redirect types. To support unmarshalling of complex or custom types, additional JAXB bindings can be registered as a package or at the individual class level.
If a default unmarshaller is not specified, returns raw xml for any non-primitive, non-reference types that do not have registered JAXB bindings.
Implementation is safe to be shared by multiple threads.
Constructor Summary | |
---|---|
JaxbPropertyUnmarshaller(PropertyUnmarshaller defaultUnmarshaller,
Collection<String> bindingPackages,
ClassLoader classLoader,
boolean loadPrimitiveBindings)
Create a new instance. |
Method Summary | |
---|---|
ValueEx<Object> |
getValue(PropertyInfo propertyInfo,
XMLStreamReader reader)
Unmarshal and return the value of the property described by propertyInfo from the reader. |
static JaxbPropertyUnmarshaller |
newInstance(Collection<String> bindingPackages,
ClassLoader classLoader)
Create a new instance with bindings for primitive and reference types in addition to the bindings specified in bindingPackages. |
static JaxbPropertyUnmarshaller |
newPrimitiveInstance()
Create a new instance with bindings for primitive and reference types. |
void |
registerJaxbBindingClass(String xmlType,
Class<?> javaType)
Register a JAXB binding class for an xml object type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JaxbPropertyUnmarshaller(@optional PropertyUnmarshaller defaultUnmarshaller, @optional Collection<String> bindingPackages, @optional ClassLoader classLoader, boolean loadPrimitiveBindings)
defaultUnmarshaller
- Unmarshaller that handles properties that do not have registered
JAXB bindings. If null, a pass-through unmarshaller will return
raw xml for any response elements without their own bindings.bindingPackages
- Packages containing binding classes:
classLoader
- ClassLoader for classes within the binding packages. Can be null
if bindingPackages is null or empty.loadPrimitiveBindings
- If true, then initialize bindings for primitive types (byte,
short, int, long, float, double, boolean, string and date).
IllegalArgumentException
- if classLoader is null and bindingPackages is not empty.Method Detail |
---|
public static JaxbPropertyUnmarshaller newInstance(Collection<String> bindingPackages, ClassLoader classLoader)
bindingPackages
- Packages containing binding classes:
classLoader
- ClassLoader for classes within the binding packages.
IllegalArgumentException
- If any parameters are null.public static JaxbPropertyUnmarshaller newPrimitiveInstance()
public void registerJaxbBindingClass(String xmlType, Class<?> javaType)
xmlType
- An xml object type.javaType
- A JAXB binding class.
IllegalArgumentException
- if any parameters are null.public ValueEx<Object> getValue(PropertyInfo propertyInfo, XMLStreamReader reader) throws XMLStreamException
PropertyUnmarshaller
getValue
in interface PropertyUnmarshaller
propertyInfo
- Metadata on the property to be unmarshalled from the reader.reader
- An xml stream reader.
ValueEx
instance containing the value of
the property as well as any non-fatal exceptions (that may have
occurred while getting the value) which the unmarshaller chose
not to propagate but to swallow for whatever reason. By using
the ValueEx
instance, the unmarshaller can still report
the exception(s) that occurred, thus indicating to the caller
that something went wrong but not fatally. The caller is free
to decide what to do with the information, e.g. it may log it.
This value should never be null
.
XMLStreamException
- if any XML stream specific issues are encountered while deserializing.
|
vSphere Client SDK API Documentation : version 5.5.0.1300321 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |