1 6 7 package com.raptus.owxv3.api.usermgr.db; 8 9 import com.raptus.owxv3.api.usermgr.*; 10 import java.util.*; 11 12 16 public class dbUser implements User 17 { 18 21 String name = null; 22 23 26 String password = null; 27 28 31 String username = null; 32 33 36 String email = null; 37 String locale = null; 38 39 Locale llocale = null; 40 41 42 public dbUser(String name, String username, String password, String email, String locale) 43 { 44 this.email = email; 45 this.locale = locale; 46 this.password = password; 47 this.username = username; 48 this.name = name; 49 } 50 51 56 public String getEmail() 57 { 58 return email; 59 } 60 61 66 public Locale getLocale() 67 { 68 if(llocale ==null) 69 { 70 String sres[] = split(locale, "_"); 71 if(sres.length==1) 72 { 73 llocale = new Locale(sres[0]); 74 } 75 else 76 { 77 llocale = new Locale(sres[0],sres[1]); 78 } 79 } 80 return llocale; 81 } 82 83 88 public String getName() 89 { 90 return name; 91 } 92 93 98 public String getPassword() 99 { 100 return password; 101 } 102 103 108 public String getUsername() 109 { 110 return username; 111 } 112 113 118 public Iterator getRoles() 119 { 120 return null; 121 } 122 123 public String [] split(String str, String delim) 124 { 125 StringTokenizer st = new StringTokenizer(str, delim); 126 String [] res = new String [st.countTokens()]; 127 int i=0; 128 while(st.hasMoreTokens()) 129 { 130 res[i++] = st.nextToken(); 131 } 132 133 return res; 134 } 135 } 136 | Popular Tags |