내 XML .xsd에서 클래스를 생성했으며 MeterSessionInputRF
클래스에 EndpointID
필드를 설정하려고합니다. 문제는 setEndpointID
메서드가 매개 변수로 JAXBElement<Byte>
만 허용한다는 것입니다.JAXBElement <Byte> 선언
저는 setEndpointID
메소드에 대한 입력을 얻기 위해 현재 데이터베이스를 쿼리하고 있습니다. 이 입력은 원하는대로 문자열, char 일 수 있습니다.
JAXBElement<Byte>
은 어떻게 만듭니 까? ObjectFactory 클래스를 사용하여 시도했지만 시도하고 사용할 때 이러한 개체를 만들 수있는 옵션이 없습니다.
다음은 이미 일부 시각을 제공해야하는 코드입니다.
if(moduleResults.next()){
MeterSessionInputRF msiRF = new MeterSessionInputRF();
msiRF.setRFFrequency(moduleResults.getFloat("id_amr_module"));
JAXBElement<Byte> endpointType;
byte epT = moduleResults.getByte("cd_module_typ");
endpointType.setValue(epT);
msiRF.setEndpointType(endpointType);
}
endpointType이 초기화되지 않았을 수 있다는 오류가 계속 발생합니다. JAXBElement<Byte>
을 만드는 올바른 방법이 있습니까?
감사합니다. 그것은 createMeterSessionInputRFEndpointType 아래에있었습니다. 그렇게 찾기가 어렵다! – TyC