Java Utililty Methods XML JAXB Unmarshaller

List of utility methods to do XML JAXB Unmarshaller

Description

The list of methods to do XML JAXB Unmarshaller are organized into topic(s).

Method

TcastUnmarshalled(Object unmarshalled, Class clazz)
cast Unmarshalled
if (clazz.isInstance(unmarshalled)) {
    return clazz.cast(unmarshalled);
} else if (unmarshalled instanceof JAXBElement) {
    return castUnmarshalled(((JAXBElement<?>) unmarshalled).getValue(), clazz);
} else {
    throw new ClassCastException("Unmarshalled object is neither a " + clazz.getName() + " nor a "
            + JAXBElement.class.getName() + ": classname = " + unmarshalled.getClass().getName());
voidcloseUnmarshaller(Unmarshaller u)
close Unmarshaller
if (u instanceof Closeable) {
    try {
        ((Closeable) u).close();
    } catch (IOException e) {
UnmarshallercreateUnmarshaller()
create Unmarshaller
return jxbc.createUnmarshaller();
UnmarshallercreateUnmarshaller()
Create an unmarshaller for XML parsing.
return getContext().createUnmarshaller();
UnmarshallercreateUnmarshaller()
create Unmarshaller
if (unmarshaller == null) {
    JAXBContext jaxbContext = JAXBContext.newInstance(Gml_NS);
    unmarshaller = jaxbContext.createUnmarshaller();
return unmarshaller;
UnmarshallercreateUnmarshaller(Class jaxbBindClass)
create Unmarshaller
Unmarshaller unmarshaller = newJAXBContext(jaxbBindClass).createUnmarshaller();
return unmarshaller;
UnmarshallercreateUnmarshaller(Class clazz)
create Unmarshaller
try {
    JAXBContext jaxbContext = getJaxbContext(clazz);
    return jaxbContext.createUnmarshaller();
} catch (JAXBException e) {
    throw new RuntimeException(e);
UnmarshallercreateUnmarshaller(Class clazz)
create Unmarshaller
JAXBContext context = JAXBContext.newInstance(clazz);
Unmarshaller unmarshaller = context.createUnmarshaller();
return unmarshaller;
UnmarshallercreateUnmarshaller(Class clazz)
Creates a unmarshaller for the given class.
return getJAXBContext(clazz).createUnmarshaller();
UnmarshallercreateUnmarshaller(Object object)
create Unmarshaller
Class objectClass = object.getClass();
if (objectClass.getSimpleName().equals("Class")) {
    objectClass = (Class) object;
JAXBContext context;
Unmarshaller unmarshaller = null;
try {
    context = JAXBContext.newInstance(objectClass);
...