2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.controller.filtervalve.cors.jaxb;
11 import java.io.StringReader;
12 import javax.xml.bind.JAXBContext;
13 import javax.xml.bind.JAXBException;
17 public static Host parse(String xmlFileContent, String fileName) throws JAXBException {
18 JAXBContext context = JAXBContext.newInstance(Host.class);
19 javax.xml.bind.Unmarshaller um = context.createUnmarshaller();
20 Host host = (Host) um.unmarshal(new StringReader(xmlFileContent));
21 host.initialize(fileName);