/[projects]/dao/DaoAdresseService/src/main/java/dk/daoas/daoadresseservice/AddressUtils.java
ViewVC logotype

Diff of /dao/DaoAdresseService/src/main/java/dk/daoas/daoadresseservice/AddressUtils.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

dao/DaoAdresseService/src/dk/daoas/daoadresseservice/AddressUtils.java revision 2408 by torben, Fri Feb 27 15:42:08 2015 UTC dao/DaoAdresseService/src/main/java/dk/daoas/daoadresseservice/AddressUtils.java revision 2966 by torben, Mon Mar 7 20:40:40 2016 UTC
# Line 3  package dk.daoas.daoadresseservice; Line 3  package dk.daoas.daoadresseservice;
3  import org.apache.commons.lang3.StringUtils;  import org.apache.commons.lang3.StringUtils;
4  import org.apache.commons.lang3.text.WordUtils;  import org.apache.commons.lang3.text.WordUtils;
5    
6    import dk.daoas.daoadresseservice.beans.Address;
7    
8  public class AddressUtils {  public class AddressUtils {
9                    
10          public static class SplitResult {          public static class SplitResult {
# Line 32  public class AddressUtils { Line 34  public class AddressUtils {
34                          return 'u';                          return 'u';
35                                                    
36                  case 'ö':                  case 'ö':
37                          return 'o';                          return 'ø';
38                  case 'ô':                  case 'ô':
39                          return 'o';                          return 'o';
40    
41                  case 'ä':                  case 'ä':
42                          return 'a';                          return 'æ';
43                  case 'â':                  case 'â':
44                          return 'a';                          return 'a';
45                                                    
# Line 69  public class AddressUtils { Line 71  public class AddressUtils {
71          }          }
72                    
73          public static String injectIntoBk(String bkrute, String injected) {          public static String injectIntoBk(String bkrute, String injected) {
74                    if (bkrute == null)
75                            return null;
76                    
77                  String parts[] = bkrute.split("/");                  String parts[] = bkrute.split("/");
78                                    
79                  if (parts.length != 4) {                  if (parts.length != 4) {
                         System.out.println(">BK " + bkrute);  
80                          return bkrute;                          return bkrute;
81                  }                  }
82                                    
# Line 174  public class AddressUtils { Line 178  public class AddressUtils {
178                                                    
179                          if (current != 'Æ'&& current != 'Ø' && current != 'Å') {                          if (current != 'Æ'&& current != 'Ø' && current != 'Å') {
180                                  if ( (i+1 == len ||                                  if ( (i+1 == len ||
181                                                  (Character.isAlphabetic(indAdresse.charAt(i+1)) == false                                                  (Character.isAlphabetic(indAdresse.charAt(i+1) ) == false
182                                                  /*&& indAdresse.charAt(i+1) != '.'*/)                                                  /*&& indAdresse.charAt(i+1) != '.'*/
183                                                    
184                                                    && checkCo(indAdresse,i) == false // Fra sortér C/O
185                                                                    )
186                                                  )                                                  )
187                                          ) {                                          ) {
188                                          result.litra = "" + current;                                          result.litra = "" + current;
# Line 279  public class AddressUtils { Line 286  public class AddressUtils {
286                  return result;                  return result;
287          }          }
288                    
289            public static boolean checkCo(String addr, int pos) {
290                    
291                    if ( StringUtils.substring(addr, pos, pos+3).equalsIgnoreCase("C/O") )
292                            return true;
293                    
294                    return false;
295    
296            }
297            
298            public static void updateDaekningstype(Address a) {
299                    if (a.routingMandag.rute != null && a.routingMandag.rute.length()> 0) {
300                            a.daekningsType = DaekningsType.DAEKNING_DIREKTE;
301                    } else {
302                            a.daekningsType = DaekningsType.DAEKNING_IKKEDAEKKET;
303                    }                      
304            }
305            
306  }  }
307    
308    

Legend:
Removed from v.2408  
changed lines
  Added in v.2966

  ViewVC Help
Powered by ViewVC 1.1.20