Package javax.xml.bind

Examples of javax.xml.bind.MarshalException


        object = modifyObjectIfNeeded(object);

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


                marshal(object, outputStream);
            } finally {
                outputStream.close();
            }
        } catch (Exception ex) {
            throw new MarshalException(ex);
        }
    }
View Full Code Here

        object = modifyObjectIfNeeded(object);

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

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

        object = modifyObjectIfNeeded(object);

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

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

                    if (e instanceof XMLStreamException) {
                        final Throwable cause = e.getCause();
                        if (cause instanceof JAXBException) {
                            throw (JAXBException) e;
                        }
                        throw new MarshalException(cause == null ? e : cause);
                    }
                    throw new MarshalException(e);

                }

                w.writeEndDocument();
            } catch (final Exception e) {
                throw new MarshalException(e);
            }


        } catch (final XMLStreamException e) {
            throw new JAXBException("Could not close XMLStreamWriter.", e);
View Full Code Here

  public void marshal(Object pObject, OutputStream pStream) throws JAXBException {
    Writer writer;
    try {
      writer = new OutputStreamWriter(pStream, getEncoding());
    } catch(UnsupportedEncodingException e) {
      throw new MarshalException("Unsupported encoding: " + getEncoding(), e);
    }
    marshal(pObject, writer);
    try {
      writer.close();
    } catch (IOException e) {
      throw new MarshalException(e);
    }
  }
View Full Code Here

    JMElement element = (JMElement) pObject;
    try {
      JMXmlSerializer serializer = getJAXBContextImpl().getJMXmlSerializer(element.getQName());
      serializer.marshal(serializer.getData(this, pHandler), element.getQName(), element);
    } catch (SAXException e) {
      throw new MarshalException(e);
    }
  }
View Full Code Here

        pWriter.write("<?xml version='1.0' encoding='" + getEncoding() + "'?>");
        if (getIndentation()) {
          pWriter.write(getIndentationSeparator());
        }
      } catch (IOException e) {
        throw new MarshalException(e);
      }
    }
    XMLWriter w;
    Class c = getXMLWriterClass();
    try {
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.