I've generated classes from my XML .xsd and am trying to set a field EndpointID
within in the class MeterSessionInputRF
. The problem I'm having is that the setEndpointID
method only accepts JAXBElement
as it's parameter.
私は現在、 setEndpointID
メソッドの入力を取得するためにデータベースに照会しています。この入力は、文字列、文字、それが欲しいものであれば何でもかまいません。
How do I create a JAXBElement
? I've tried using the ObjectFactory class but when I try and use it, I don't have the option of creating such an object.
ここで私はすでにいくつかの視点を与える必要があるコードです。
if(moduleResults.next()){
MeterSessionInputRF msiRF = new MeterSessionInputRF();
msiRF.setRFFrequency(moduleResults.getFloat("id_amr_module"));
JAXBElement endpointType;
byte epT = moduleResults.getByte("cd_module_typ");
endpointType.setValue(epT);
msiRF.setEndpointType(endpointType);
}
I keep getting the error that endpointType may have not been initialized. Is there a correct way to create the JAXBElement
?