Merge "Added move of branding jar to assembly"
[controller.git] / opendaylight / commons / filter-valve / src / main / java / org / opendaylight / controller / filtervalve / cors / jaxb / Parser.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.controller.filtervalve.cors.jaxb;
10
11 import java.io.StringReader;
12 import javax.xml.bind.JAXBContext;
13 import javax.xml.bind.JAXBException;
14
15 public class Parser {
16
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);
22         return host;
23     }
24
25 }