@Test public void getProtocolConfigurationTest() throws Exception { XMLModel model = ProtocolConfig.getProtocolConfiguration("protocol.xml"); Assert.assertEquals("UTF-8", model.getStringEncoding()); }
public static XMLModel getProtocolConfiguration(String protocolLocation) throws JAXBException, IOException { JAXBContext context = JAXBContext.newInstance(XMLModel.class); Unmarshaller um = context.createUnmarshaller(); return (XMLModel) um.unmarshal(new ClassPathResource(protocolLocation).getInputStream()); }
ProtocolConfig { public static XMLModel getProtocolConfiguration(String protocolLocation) throws JAXBException, IOException { JAXBContext context = JAXBContext.newInstance(XMLModel.class); Unmarshaller um = context.createUnmarshaller(); return (XMLModel) um.unmarshal(new ClassPathResource(protocolLocation).getInputStream()); } }
ProtocolConfig { public static XMLModel getProtocolConfiguration(String protocolLocation) throws JAXBException, IOException { JAXBContext context = JAXBContext.newInstance(XMLModel.class); Unmarshaller um = context.createUnmarshaller(); return (XMLModel) um.unmarshal(new ClassPathResource(protocolLocation).getInputStream()); }  }
ProtocolConfig { public static XMLModel getProtocolConfiguration(String protocolLocation) throws JAXBException, IOException { JAXBContext context = JAXBContext.newInstance(XMLModel.class); Unmarshaller um = context.createUnmarshaller(); return (XMLModel) um.unmarshal(new ClassPathResource(protocolLocation).getInputStream()); }  static XMLModel getProtocolConfiguration(String protocolLocation); }
ProtocolConfig { public static XMLModel getProtocolConfiguration(String protocolLocation) throws JAXBException, IOException { JAXBContext context = JAXBContext.newInstance(XMLModel.class); Unmarshaller um = context.createUnmarshaller(); return (XMLModel) um.unmarshal(new ClassPathResource(protocolLocation).getInputStream()); }  static XMLModel getProtocolConfiguration(String protocolLocation);  }