나는 preprocessor
단계에서 mirth에 자바 객체를 전달했으며,이 자바 객체를 마샬링하기 위해 XML에 마샬링하려고한다. 마샬링을 위해 사용자 정의 자바 클래스를 작성 했으므로 jar 파일로이 자바 클래스를 작성하고 사용자 정의 lib 폴더에 배치했다. 환락. 들어오는 메시지는 로깅하는 동안 은밀하지만 mirth에서 java 개체 (@something 해시 코드)를 표시하면서이 개체를 String으로 변환합니다. 하지만 내 요구 사항은 그대로 개체를 얻는 것입니다 또는 내가 문자열 preprocessor
위상에 전달한 실제 사용자 정의 자바 객체로 문자열 표현 개체를 변환하는 방법입니다. 이것은 마샬링을 위해 작성한 자바 클래스입니다.자바 객체가 Mirth의 전 처리기에서 String으로 변환 중입니까?
public class JAXBMarshalling {
public void marshallJavaObjectToXml(OrderDetails orderDetails) {
JAXBContext jaxbContext;
try {
File file = new File(
"C:\\Program Files (x86)\\Mirth Connect\\conf\\xml\\xmlrepresentation.xml");
jaxbContext = JAXBContext.newInstance(OrderDetails.class);
Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
// output pretty printed
jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
jaxbMarshaller.marshal(orderDetails, file);
jaxbMarshaller.marshal(orderDetails, System.out);
} catch (JAXBException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}