JAXBElement <bayt> deklaratsiyasi

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.

Hozirda setEndpointID usuli uchun kirishni olish uchun ma'lumotlar bazasini so'rayapman. Ushbu kiritish bir string, char bo'lishi mumkin, nima bo'lishini istayman.

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.

Mana, bir necha kuzatishlarim bor kodim bor.

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?

1
Ahhh rahmat. CreateMeterSessionInputRFEndpointType ostida edi. Oson topish juda qiyin!
qo'shib qo'ydi muallif TyC, manba

1 javoblar

XJC tomonidan ishlab chiqarilgan ObjectFactory sinfida siz uchun bu usulni bajarish kerak. Bilasizmi, u erda yo'q, lekin qayta tekshirib ko'ring, bunday turdagi ob'ektni qaytaradigan usul bo'lishi kerak.

3
qo'shib qo'ydi