Here you can find the source of unmarshal(File f)
Parameter | Description |
---|---|
f | The file. |
Parameter | Description |
---|---|
JAXBException | If any unexpected errors occur while unmarshalling |
UnmarshalException | If the ValidationEventHandler returns false fromits handleEvent method or the Unmarshaller is unable to performthe XML to Java binding. |
IllegalArgumentException | If the file parameter is null |
public static Object unmarshal(File f) throws JAXBException
//package com.java2s; /*// w w w . j av a 2 s .co m * 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.JAXBException; import javax.xml.bind.Unmarshaller; public class Main { private static Unmarshaller unmar; /** * Unmarshals a file. * * @param f The file. * @return The object unmarshaled. * @throws JAXBException If any unexpected errors occur while unmarshalling * @throws UnmarshalException If the ValidationEventHandler returns false from * its handleEvent method or the Unmarshaller is unable to perform * the XML to Java binding. * @throws IllegalArgumentException If the file parameter is null */ public static Object unmarshal(File f) throws JAXBException { return unmar.unmarshal(f); } }