我有两个代码,在两个不同的java项目中,做几乎相同的事情,(根据xsd文件解码web服务的输入)。但在一种情况下,我应该这样写:(输入是占位符名称)(元素是OMElement输入)ClassLoaderclInput=input.ObjectFactory.class.getClassLoader();JAXBContextjc=JAXBContext.newInstance("input",clInput);Unmarshallerunmarshaller=jc.createUnmarshaller();Inputinput=(Input)unmarshaller.unmarsha
我有两个代码,在两个不同的java项目中,做几乎相同的事情,(根据xsd文件解码web服务的输入)。但在一种情况下,我应该这样写:(输入是占位符名称)(元素是OMElement输入)ClassLoaderclInput=input.ObjectFactory.class.getClassLoader();JAXBContextjc=JAXBContext.newInstance("input",clInput);Unmarshallerunmarshaller=jc.createUnmarshaller();Inputinput=(Input)unmarshaller.unmarsha