Skip to content

Instantly share code, notes, and snippets.

@daemin-hwang
Created September 29, 2016 15:15
Show Gist options
  • Select an option

  • Save daemin-hwang/0692c10455083f2361c5126df33e438b to your computer and use it in GitHub Desktop.

Select an option

Save daemin-hwang/0692c10455083f2361c5126df33e438b to your computer and use it in GitHub Desktop.
Jaxb2 마샬러 toString 변환 예제
출처)
http://bigdatazone.blogspot.kr/2013/04/jaxb2marshaller-marshaling-and.html
final StringWriter out = new StringWriter();
marshaller.marshal(query, new StreamResult(out));
String xml = out.toString();
이부분을 보고 이해 했다.
StringWriter을 생성하고 StreamResult에 라이터를 랩핑해서 넘겨주면 내부 처리 결과를 String 으로 담아주나보다.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment