Produced by Araxis Merge on 6/9/2017 3:49:58 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:58 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\transformer\string | PatternTransformer.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 | 47 |
| 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.tra nsformer.s tring; | |||||
| 2 | ||||||
| 3 | import gov .va.nvap.c ommon.tran sformer.Tr ansformer; | |||||
| 4 | import gov .va.nvap.c ommon.tran sformer.Tr ansformerE xception; | |||||
| 5 | import gov .va.nvap.c ommon.vali dation.Nul lChecker; | |||||
| 6 | ||||||
| 7 | import jav a.util.reg ex.Matcher ; | |||||
| 8 | import jav a.util.reg ex.Pattern ; | |||||
| 9 | ||||||
| 10 | import org .springfra mework.bea ns.factory .annotatio n.Required ; | |||||
| 11 | ||||||
| 12 | public cla ss Pattern Transforme r implemen ts Transfo rmer<Strin g, Object> { | |||||
| 13 | ||||||
| 14 | pr ivate Inte ger groupP osition = 1; | |||||
| 15 | pr ivate Patt ern patter n; | |||||
| 16 | pr ivate bool ean trimRe sult = tru e; | |||||
| 17 | ||||||
| 18 | pu blic void setGroupPo sition(fin al Integer groupPosi tion) { | |||||
| 19 | this .groupPosi tion = gro upPosition ; | |||||
| 20 | } | |||||
| 21 | ||||||
| 22 | @R equired | |||||
| 23 | pu blic void setPattern (final Str ing patter n) { | |||||
| 24 | fina l Pattern expression Pattern = Pattern.co mpile(patt ern, | |||||
| 25 | Pattern. DOTALL | P attern.MUL TILINE); | |||||
| 26 | this .pattern = expressio nPattern; | |||||
| 27 | } | |||||
| 28 | ||||||
| 29 | pu blic void setTrimRes ult(final boolean tr imResult) { | |||||
| 30 | this .trimResul t = trimRe sult; | |||||
| 31 | } | |||||
| 32 | ||||||
| 33 | @O verride | |||||
| 34 | pu blic Objec t transfor m(final St ring sourc e) throws Transforme rException { | |||||
| 35 | fina l Matcher matcher = this.patte rn.matcher (source); | |||||
| 36 | if ( matcher.fi nd()) { | |||||
| 37 | if (ma tcher.grou pCount() > = this.gro upPosition ) { | |||||
| 38 | String v alue = mat cher.group (this.grou pPosition) ; | |||||
| 39 | if (Null Checker.is NotEmpty(v alue) && t his.trimRe sult) { | |||||
| 40 | value = va lue.trim() ; | |||||
| 41 | } | |||||
| 42 | return v alue; | |||||
| 43 | } | |||||
| 44 | } | |||||
| 45 | retu rn null; | |||||
| 46 | } | |||||
| 47 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.