Produced by Araxis Merge on 7/3/2018 11:43:41 AM Central 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 | eHealth_v8.2.0_build_8.2.0.1.zip\NHIN_adapter\AdapterLIB\src\main\java\gov\va\med\nhin\adapter\datamanager\translators | ReplaceAllDataTranslator.java | Tue Jun 26 18:27:12 2018 UTC |
| 2 | eHealth_v8.2.0_build_8.2.0.1.zip\NHIN_adapter\AdapterLIB\src\main\java\gov\va\med\nhin\adapter\datamanager\translators | ReplaceAllDataTranslator.java | Fri Jun 29 20:37:15 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 84 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| 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 | /* | |
| 2 | * To chan ge this li cense head er, choose License H eaders in Project Pr operties. | |
| 3 | * To chan ge this te mplate fil e, choose Tools | Te mplates | |
| 4 | * and ope n the temp late in th e editor. | |
| 5 | */ | |
| 6 | package go v.va.med.n hin.adapte r.datamana ger.transl ators; | |
| 7 | ||
| 8 | import jav a.util.reg ex.*; | |
| 9 | ||
| 10 | import gov .va.med.nh in.adapter .datamanag er.*; | |
| 11 | import gov .va.med.nh in.adapter .utils.*; | |
| 12 | ||
| 13 | /** | |
| 14 | * | |
| 15 | * @author PI I
|
|
| 16 | */ | |
| 17 | public cla ss Replace AllDataTra nslator im plements D ataTransla tor | |
| 18 | { | |
| 19 | @Overr ide | |
| 20 | public Object tr anslate(Ob ject input , Object r esult, Ref erence tra nslation, DataQuery dataQuery) | |
| 21 | { | |
| 22 | St ring ret = null; | |
| 23 | ||
| 24 | if (input != null) { | |
| 25 | String r egex = tra nslation.g etProperty ("regex"); | |
| 26 | if (Null Checker.is NullOrEmpt y(regex)) { | |
| 27 | thro w new Data ManagerExc eption("re gex proper ty must be set."); | |
| 28 | } | |
| 29 | String r eplacement = transla tion.getPr operty("re placement" ); | |
| 30 | // we ch eck for nu ll instead of isNull OrEmpty so that we c an replace regex wit h empty st rings. | |
| 31 | if (repl acement == null) { | |
| 32 | thro w new Data ManagerExc eption("re placement property m ust be set ."); | |
| 33 | } | |
| 34 | if (!(in put instan ceof Strin g)) { | |
| 35 | thro w new Data ManagerExc eption("in put must b e of type java.lang. String."); | |
| 36 | } | |
| 37 | String i nputAsStri ng = (Stri ng)input; | |
| 38 | ret = in putAsStrin g.replaceA ll(regex, Matcher.qu oteReplace ment(repla cement)); | |
| 39 | } | |
| 40 | ||
| 41 | re turn ret; | |
| 42 | } | |
| 43 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.