Produced by Araxis Merge on 3/24/2017 5:17:19 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 | MHV_2017.2.0.0 Code In Flight.zip\National Portal\mhv_rxrefill\mhv-rx-refill-portal-main\src\main\java\gov\va\med\framework\conversion\converter | TypeCodeConverter.java | Thu Feb 11 17:10:28 2016 UTC |
| 2 | MHV_2017.2.0.0 Code In Flight.zip\National Portal\mhv_rxrefill\mhv-rx-refill-portal-main\src\main\java\gov\va\med\framework\conversion\converter | TypeCodeConverter.java | Fri Mar 24 20:34:09 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 94 |
| 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 | package go v.va.med.f ramework.c onversion. converter; | |
| 2 | ||
| 3 | import org .apache.co mmons.bean utils.Conv erter; | |
| 4 | ||
| 5 | import gov .va.med.do main.typec ode.Numeri cTypeCodeA bstract; | |
| 6 | import gov .va.med.do main.typec ode.TypeCo de; | |
| 7 | import gov .va.med.do main.typec ode.TypeCo deAbstract ; | |
| 8 | ||
| 9 | /** | |
| 10 | * Convert er impleme ntation re sponsible for conver ting an ob ject into a TypeCode instance. | |
| 11 | * @author PII Apr 26, 2 005 10:38: 30 AM | |
| 12 | * @versio n $Id: Typ eCodeConve rter.java, v 1.1.1.1 2005/05/13 19:40:48 jon.crater Exp $ | |
| 13 | */ | |
| 14 | public cla ss TypeCod eConverter implement s Converte r { | |
| 15 | ||
| 16 | /* * | |
| 17 | * For purpo ses of thi s conversi on, it is assumed th at the val ue paramet er is eith er already | |
| 18 | * a TypeCod e instance (in which case it w ill be ret urned unch anged), or it is a v alue | |
| 19 | * that maps to an enu merated ty pe with th at value a s its code . | |
| 20 | * @see org. apache.com mons.beanu tils.Conve rter#conve rt(java.la ng.Class, java.lang. Object) | |
| 21 | * @see gov. va.med.dom ain.typeco de.TypeCod e | |
| 22 | * @see gov. va.med.dom ain.typeco de.TypeCod eAbstract# codeForVal ue(Class, Object) | |
| 23 | * / | |
| 24 | pu blic Objec t convert( Class type , Object v alue) { | |
| 25 | if(v alue == nu ll || valu e instance of TypeCod e) | |
| 26 | return value; | |
| 27 | ||
| 28 | Obje ct code = value; | |
| 29 | ||
| 30 | // i f we're co nverting f or a numer ic type co de, parse to Integer object fi rst | |
| 31 | if(N umericType CodeAbstra ct.class.i sAssignabl eFrom(type )) | |
| 32 | code = Integer.v alueOf(val ue.toStrin g()); | |
| 33 | ||
| 34 | // M ake sure t he target class is l oaded. Th is is nece ssary beca use if thi s class is loaded | |
| 35 | // f or the fir st time by a process that uses reflectio n (e.g., c onversion) , then the JVM | |
| 36 | // d oesn't ini tialize th e static v ariables e ven though we get a valid clas s object | |
| 37 | // a s a parame ter to thi s method. | |
| 38 | try { | |
| 39 | Class. forName(ty pe.getName ()); | |
| 40 | } | |
| 41 | catc h (ClassNo tFoundExce ption e) { | |
| 42 | throw new Runtim eException (e); | |
| 43 | } | |
| 44 | ||
| 45 | retu rn TypeCod eAbstract. codeForVal ue(type, c ode); | |
| 46 | } | |
| 47 | ||
| 48 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.