Here you can find the source of marshal(JAXBElement> e, File f)
Parameter | Description |
---|---|
e | The element. |
f | The file. |
Parameter | Description |
---|---|
JAXBException | If any unexpected problem occurs during themarshalling. |
MarshalException | If the ValidationEventHandler returns false fromits handleEvent method or the Marshaller is unable to marshal obj(or any object reachable from obj). |
IllegalArgumentException | If any of the method parameters are null |
public static void marshal(JAXBElement<?> e, File f) throws JAXBException
//package com.java2s; /*// w w w . j av a 2 s. c om * Copyright 2010 The Rabbit Eclipse Plug-in Project * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ import java.io.File; import javax.xml.bind.JAXBElement; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; public class Main { private static Marshaller mar; /** * Marshals the given element to file. * * @param e The element. * @param f The file. * @throws JAXBException If any unexpected problem occurs during the * marshalling. * @throws MarshalException If the ValidationEventHandler returns false from * its handleEvent method or the Marshaller is unable to marshal obj * (or any object reachable from obj). * @throws IllegalArgumentException If any of the method parameters are null */ public static void marshal(JAXBElement<?> e, File f) throws JAXBException { mar.marshal(e, f); } }