草庐IT

MySchemaObject

全部标签

java - JAXB unmarshaller.unmarshal 何时返回 JAXBElement<MySchemaObject> 或 MySchemaObject?

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

java - JAXB unmarshaller.unmarshal 何时返回 JAXBElement<MySchemaObject> 或 MySchemaObject?

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