Produced by Araxis Merge on 6/11/2019 10:54:12 AM 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 | HTRE_P3_v14.5_iter_4_build_14.zip\java\gov\va\med\fw\io | FileFieldMetaData.java | Wed May 29 15:26:34 2019 UTC |
| 2 | HTRE_P3_v14.5_iter_4_build_14.zip\java\gov\va\med\fw\io | FileFieldMetaData.java | Mon Jun 10 19:30:05 2019 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 432 |
| 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 | * Copyrii ght 2005 V HA. All ri ghts reser ved | |
| 3 | ********* ********** ********** ********** ********** ********** *********/ | |
| 4 | ||
| 5 | package go v.va.med.f w.io; | |
| 6 | ||
| 7 | import org .apache.co mmons.lang .Validate; | |
| 8 | ||
| 9 | import gov .va.med.fw .service.A bstractCom ponent; | |
| 10 | import gov .va.med.fw .util.Inva lidConfigu rationExce ption; | |
| 11 | import gov .va.med.fw .util.Stri ngUtils; | |
| 12 | ||
| 13 | /** | |
| 14 | * Contain s metadata about a f ield in a File, eith er for inp ut or outp ut. | |
| 15 | * | |
| 16 | * Created Feb 15, 2 006 2:13:1 4 PM | |
| 17 | * | |
| 18 | * @author DNS DN S
|
|
| 19 | */ | |
| 20 | public cla ss FileFie ldMetaData extends A bstractCom ponent { | |
| 21 | pr ivate Stri ng name; | |
| 22 | ||
| 23 | pr ivate int length; | |
| 24 | ||
| 25 | pr ivate int maxLength; | |
| 26 | ||
| 27 | pr ivate int minLength; | |
| 28 | ||
| 29 | pr ivate int startPosit ion; | |
| 30 | ||
| 31 | pr ivate int endPositio n; | |
| 32 | ||
| 33 | pr ivate bool ean requir ed; | |
| 34 | ||
| 35 | pr ivate Fiel dTransform er transfo rmer; | |
| 36 | ||
| 37 | /* * | |
| 38 | * @return R eturns the endPositi on. | |
| 39 | * / | |
| 40 | pu blic int g etEndPosit ion() { | |
| 41 | retu rn endPosi tion; | |
| 42 | } | |
| 43 | ||
| 44 | /* * | |
| 45 | * @param en dPosition | |
| 46 | * The endP osition to set. | |
| 47 | * / | |
| 48 | pu blic void setEndPosi tion(int e ndPosition ) { | |
| 49 | this .endPositi on = endPo sition; | |
| 50 | } | |
| 51 | ||
| 52 | /* * | |
| 53 | * @return R eturns the length. | |
| 54 | * / | |
| 55 | pu blic int g etLength() { | |
| 56 | retu rn length; | |
| 57 | } | |
| 58 | ||
| 59 | /* * | |
| 60 | * @param le ngth | |
| 61 | * The leng th to set. | |
| 62 | * / | |
| 63 | pu blic void setLength( int length ) { | |
| 64 | this .length = length; | |
| 65 | } | |
| 66 | ||
| 67 | /* * | |
| 68 | * @return R eturns the name. | |
| 69 | * / | |
| 70 | pu blic Strin g getName( ) { | |
| 71 | retu rn name; | |
| 72 | } | |
| 73 | ||
| 74 | /* * | |
| 75 | * @param na me | |
| 76 | * The name to set. | |
| 77 | * / | |
| 78 | pu blic void setName(St ring name) { | |
| 79 | this .name = na me; | |
| 80 | } | |
| 81 | ||
| 82 | /* * | |
| 83 | * @return R eturns the required. | |
| 84 | * / | |
| 85 | pu blic boole an isRequi red() { | |
| 86 | retu rn require d; | |
| 87 | } | |
| 88 | ||
| 89 | /* * | |
| 90 | * @param re quired | |
| 91 | * The requ ired to se t. | |
| 92 | * / | |
| 93 | pu blic void setRequire d(boolean required) { | |
| 94 | this .required = required ; | |
| 95 | } | |
| 96 | ||
| 97 | /* * | |
| 98 | * @return R eturns the startPosi tion. | |
| 99 | * / | |
| 100 | pu blic int g etStartPos ition() { | |
| 101 | retu rn startPo sition; | |
| 102 | } | |
| 103 | ||
| 104 | /* * | |
| 105 | * @param st artPositio n | |
| 106 | * The star tPosition to set. | |
| 107 | * / | |
| 108 | pu blic void setStartPo sition(int startPosi tion) { | |
| 109 | this .startPosi tion = sta rtPosition ; | |
| 110 | } | |
| 111 | ||
| 112 | pu blic int g etFixedFie ldWidth() { | |
| 113 | retu rn getEndP osition() != 0 ? (ge tEndPositi on() - get StartPosit ion()) + 1 : 0; | |
| 114 | } | |
| 115 | ||
| 116 | pu blic Strin g validate (String ra wValue) { | |
| 117 | Stri ng strValu e = rawVal ue.trim(); | |
| 118 | if ( isRequired () && Stri ngUtils.is Empty(strV alue)) | |
| 119 | throw new Illega lStateExce ption(getN ame() + " is require d"); | |
| 120 | if ( getLength( ) > 0 && ! StringUtil s.isEmpty( strValue) && strValu e.length() != getLen gth()) | |
| 121 | throw new Illega lStateExce ption(getN ame() + " does not e qual size " + getLen gth()); | |
| 122 | if ( !StringUti ls.isEmpty (strValue) && getMax Length() > 0 | |
| 123 | && strVa lue.length () > getMa xLength()) | |
| 124 | throw new Illega lStateExce ption(getN ame() + " must have max size " + getMaxL ength()); | |
| 125 | if ( !StringUti ls.isEmpty (strValue) && getMin Length() > 0 | |
| 126 | && strVa lue.length () < getMi nLength()) | |
| 127 | throw new Illega lStateExce ption(getN ame() + " must have min size " + getMinL ength()); | |
| 128 | ||
| 129 | retu rn strValu e; | |
| 130 | } | |
| 131 | ||
| 132 | pu blic Objec t transfor m(Object r awValue) { | |
| 133 | Obje ct transfo rmedValue = rawValue ; | |
| 134 | if ( transforme r != null) { | |
| 135 | try { | |
| 136 | transfor medValue = transform er.transfo rmData(nam e, rawValu e); | |
| 137 | } catc h (Excepti on e) { | |
| 138 | RuntimeE xception e 1 = new Il legalArgum entExcepti on("Unable to transf orm data: " | |
| 139 | + rawValue); | |
| 140 | e1.initC ause(e); | |
| 141 | throw e1 ; | |
| 142 | } | |
| 143 | } | |
| 144 | retu rn transfo rmedValue; | |
| 145 | } | |
| 146 | ||
| 147 | /* * | |
| 148 | * @return R eturns the maxLength . | |
| 149 | * / | |
| 150 | pu blic int g etMaxLengt h() { | |
| 151 | retu rn maxLeng th; | |
| 152 | } | |
| 153 | ||
| 154 | /* * | |
| 155 | * @param ma xLength | |
| 156 | * The maxL ength to s et. | |
| 157 | * / | |
| 158 | pu blic void setMaxLeng th(int max Length) { | |
| 159 | this .maxLength = maxLeng th; | |
| 160 | } | |
| 161 | ||
| 162 | pu blic void afterPrope rtiesSet() { | |
| 163 | Vali date.notNu ll(name, " A FileFiel dMetaData needs a na me"); | |
| 164 | veri fySettings (); | |
| 165 | } | |
| 166 | ||
| 167 | pr otected vo id verifyS ettings() { | |
| 168 | if ( getLength( ) < 0 || g etMinLengt h() < 0 || getMaxLen gth() < 0 || getStar tPosition( ) < 0 | |
| 169 | || getEn dPosition( ) < 0) | |
| 170 | throw new Invali dConfigura tionExcept ion( | |
| 171 | "Can not n egative va lues for p roperties of FileFie ldMetaData "); | |
| 172 | if ( getLength( ) > 0 && g etMaxLengt h() > 0) | |
| 173 | throw new Invali dConfigura tionExcept ion( | |
| 174 | "Can not h ave a fixe d length a nd max len gth at the same time "); | |
| 175 | if ( getLength( ) > 0 && g etMinLengt h() > 0) | |
| 176 | throw new Invali dConfigura tionExcept ion( | |
| 177 | "Can not h ave a fixe d length a nd min len gth at the same time "); | |
| 178 | if ( getStartPo sition() > 0 && getE ndPosition () == 0 || getStartP osition() == 0 | |
| 179 | && getEn dPosition( ) > 0) | |
| 180 | throw new Invali dConfigura tionExcept ion( | |
| 181 | "Must have positive values for start and end posit ion"); | |
| 182 | } | |
| 183 | ||
| 184 | /* * | |
| 185 | * @return R eturns the minLength . | |
| 186 | * / | |
| 187 | pu blic int g etMinLengt h() { | |
| 188 | retu rn minLeng th; | |
| 189 | } | |
| 190 | ||
| 191 | /* * | |
| 192 | * @param mi nLength | |
| 193 | * The minL ength to s et. | |
| 194 | * / | |
| 195 | pu blic void setMinLeng th(int min Length) { | |
| 196 | this .minLength = minLeng th; | |
| 197 | } | |
| 198 | ||
| 199 | pr otected bo olean isFi xedWidthFo rmat() { | |
| 200 | retu rn getStar tPosition( ) > 0 || g etEndPosit ion() > 0; | |
| 201 | } | |
| 202 | ||
| 203 | /* * | |
| 204 | * @return R eturns the transform er. | |
| 205 | * / | |
| 206 | pu blic Field Transforme r getTrans former() { | |
| 207 | retu rn transfo rmer; | |
| 208 | } | |
| 209 | ||
| 210 | /* * | |
| 211 | * @param tr ansformer | |
| 212 | * The tran sformer to set. | |
| 213 | * / | |
| 214 | pu blic void setTransfo rmer(Field Transforme r transfor mer) { | |
| 215 | this .transform er = trans former; | |
| 216 | } | |
| 217 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.