Produced by Araxis Merge on 6/9/2017 3:49:57 PM Eastern Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | Fri Jun 9 19:49:57 2017 UTC | ||
| 2 | eHealth_Exch (eHealth Exchange Enhancements) Build 3 docs & code_May_2017.zip\VAP_CIF_CODE0502.zip\VAP_CIF_CODE0502\VAP_CIF_CODE0502\nvap-common\src\main\java\gov\va\nvap\common\jaxb | JaxbUtil.java | Fri Apr 21 20:03:26 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 1 | 69 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | package go v.va.nvap. common.jax b; | |||||
| 2 | ||||||
| 3 | import gov .va.nvap.c ommon.vali dation.Nul lChecker; | |||||
| 4 | ||||||
| 5 | import jav a.io.Strin gWriter; | |||||
| 6 | ||||||
| 7 | import jav ax.xml.bin d.JAXBCont ext; | |||||
| 8 | import jav ax.xml.bin d.JAXBExce ption; | |||||
| 9 | import jav ax.xml.bin d.Marshall er; | |||||
| 10 | import jav ax.xml.bin d.Unmarsha ller; | |||||
| 11 | import jav ax.xml.par sers.Docum entBuilder Factory; | |||||
| 12 | import jav ax.xml.par sers.Parse rConfigura tionExcept ion; | |||||
| 13 | ||||||
| 14 | import org .w3c.dom.D ocument; | |||||
| 15 | ||||||
| 16 | /** | |||||
| 17 | * The JAX B Helper. | |||||
| 18 | * | |||||
| 19 | * @author Asha Amri traj | |||||
| 20 | */ | |||||
| 21 | public cla ss JaxbUti l { | |||||
| 22 | ||||||
| 23 | /* * | |||||
| 24 | * JAXB Cont ext. | |||||
| 25 | * / | |||||
| 26 | pr ivate JAXB Context co ntext; | |||||
| 27 | ||||||
| 28 | pu blic JaxbU til(final String fac toryName) { | |||||
| 29 | try { | |||||
| 30 | this.c ontext = J AXBContext .newInstan ce(factory Name); | |||||
| 31 | } ca tch (final JAXBExcep tion ex) { | |||||
| 32 | throw new Runtim eException (ex); | |||||
| 33 | } | |||||
| 34 | } | |||||
| 35 | ||||||
| 36 | pu blic final Document marshal(fi nal Object obj) thro ws JAXBExc eption { | |||||
| 37 | try { | |||||
| 38 | if (Nu llChecker. isEmpty(ob j)) { | |||||
| 39 | return n ull; | |||||
| 40 | } | |||||
| 41 | final Marshaller marshalle r = this.c ontext.cre ateMarshal ler(); | |||||
| 42 | final Document m arshalledD oc = Docum entBuilder Factory.ne wInstance( ) | |||||
| 43 | .newDocume ntBuilder( ).newDocum ent(); | |||||
| 44 | marsha ller.marsh al(obj, ma rshalledDo c); | |||||
| 45 | return marshalle dDoc; | |||||
| 46 | } ca tch (final ParserCon figuration Exception ex) { | |||||
| 47 | throw new JAXBEx ception(ex ); | |||||
| 48 | } | |||||
| 49 | } | |||||
| 50 | ||||||
| 51 | pu blic final String ma rshalStrin g(final Ob ject obj) throws JAX BException { | |||||
| 52 | if ( NullChecke r.isEmpty( obj)) { | |||||
| 53 | return null; | |||||
| 54 | } | |||||
| 55 | fina l Marshall er marshal ler = this .context.c reateMarsh aller(); | |||||
| 56 | fina l StringWr iter strin gWriter = new String Writer(); | |||||
| 57 | mars haller.mar shal(obj, stringWrit er); | |||||
| 58 | retu rn stringW riter.toSt ring(); | |||||
| 59 | } | |||||
| 60 | ||||||
| 61 | pu blic final Object un marshal(fi nal Docume nt doc) th rows JAXBE xception { | |||||
| 62 | if ( NullChecke r.isEmpty( doc)) { | |||||
| 63 | return null; | |||||
| 64 | } | |||||
| 65 | fina l Unmarsha ller unmar shaller = this.conte xt.createU nmarshalle r(); | |||||
| 66 | retu rn unmarsh aller.unma rshal(doc) ; | |||||
| 67 | } | |||||
| 68 | ||||||
| 69 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.