Package javax.xml.bind

Examples of javax.xml.bind.MarshalException


  public void marshal(Object object, File file) throws JAXBException {
    try {
      java.io.FileWriter writer = new java.io.FileWriter(file);
      marshal(object, writer);
    } catch(Exception ex) {
      throw new MarshalException(ex);
    }
  }
View Full Code Here


      object = createXMLRootFromJAXBElement((JAXBElement) object);
    }
    try {
      xmlMarshaller.marshal(object, result);
    } catch (Exception e) {
      throw new MarshalException(e);
    }
  }
View Full Code Here

      Class staxResult = PrivilegedAccessHelper.getClassForName(STAX_RESULT_CLASS_NAME);
      Constructor cons = PrivilegedAccessHelper.getDeclaredConstructorFor(staxResult, new Class[]{XMLStreamWriter.class}, false);
      Result result = (Result)PrivilegedAccessHelper.invokeConstructor(cons, new Object[]{streamWriter});
      this.marshal(object, result);
    } catch(Exception ex) {
      throw new MarshalException(ex);
    }   
  }
View Full Code Here

      object = createXMLRootFromJAXBElement((JAXBElement) object);
    }
    try {
      xmlMarshaller.marshal(object, writer);
    } catch (Exception e) {
      throw new MarshalException(e);
    }
  }
View Full Code Here

      try {
      Class staxResult = PrivilegedAccessHelper.getClassForName(STAX_SOURCE_CLASS_NAME);
      Constructor cons = PrivilegedAccessHelper.getDeclaredConstructorFor(staxResult, new Class[]{XMLStreamReader.class}, false);
      source = (Source)PrivilegedAccessHelper.invokeConstructor(cons, new Object[]{streamReader});
    } catch(Exception ex) {
      throw new MarshalException(ex);
    }     
    return this.unmarshal(source, javaClass);
    }
View Full Code Here

      try {
      Class staxResult = PrivilegedAccessHelper.getClassForName(STAX_SOURCE_CLASS_NAME);
      Constructor cons = PrivilegedAccessHelper.getDeclaredConstructorFor(staxResult, new Class[]{XMLStreamReader.class}, false);
      source = (Source)PrivilegedAccessHelper.invokeConstructor(cons, new Object[]{streamReader});
    } catch(Exception ex) {
      throw new MarshalException(ex);
    }     
    return this.unmarshal(source);
    }
View Full Code Here

      try {
      Class staxResult = PrivilegedAccessHelper.getClassForName(STAX_SOURCE_CLASS_NAME);
      Constructor cons = PrivilegedAccessHelper.getDeclaredConstructorFor(staxResult, new Class[]{XMLEventReader.class}, false);
      source = (Source)PrivilegedAccessHelper.invokeConstructor(cons, new Object[]{eventReader});
    } catch(Exception ex) {
      throw new MarshalException(ex);
    }     
    return this.unmarshal(source, javaClass);   
    }
View Full Code Here

      try {
      Class staxResult = PrivilegedAccessHelper.getClassForName(STAX_SOURCE_CLASS_NAME);
      Constructor cons = PrivilegedAccessHelper.getDeclaredConstructorFor(staxResult, new Class[]{XMLEventReader.class}, false);
      source = (Source)PrivilegedAccessHelper.invokeConstructor(cons, new Object[]{eventReader});
    } catch(Exception ex) {
      throw new MarshalException(ex);
    }     
    return this.unmarshal(source);
    }
View Full Code Here

        object = modifyObjectIfNeeded(object);

        try {
            xmlMarshaller.marshal(object, contentHandler);
        } catch (Exception e) {
            throw new MarshalException(e);
        }
    }
View Full Code Here

        try {
            XMLEventWriterRecord record = new XMLEventWriterRecord(eventWriter);
            record.setMarshaller(this.xmlMarshaller);
            this.xmlMarshaller.marshal(object, record);
        } catch (Exception ex) {
            throw new MarshalException(ex);
        }
    }
View Full Code Here

TOP

Related Classes of javax.xml.bind.MarshalException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.