abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r606389 [2/2] - in /incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n: lang/ rfc4646/ rfc4646/enums/
Date Sat, 22 Dec 2007 03:05:33 GMT
Added: incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/rfc4646/enums/Region.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/rfc4646/enums/Region.java?rev=606389&view=auto
==============================================================================
--- incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/rfc4646/enums/Region.java
(added)
+++ incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/rfc4646/enums/Region.java
Fri Dec 21 19:05:32 2007
@@ -0,0 +1,409 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  The ASF licenses this file to You
+* under the Apache License, Version 2.0 (the "License"); you may not
+* use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.  For additional information regarding
+* copyright in this work, please see the NOTICE file in the top level
+* directory of this distribution.
+*/
+package org.apache.abdera.i18n.rfc4646.enums;
+
+import java.util.Locale;
+
+import org.apache.abdera.i18n.rfc4646.Subtag;
+
+
+public enum Region {
+
+  AA(null,null,"PRIVATE USE"),
+  AD(null,null,"Andorra"),
+  AE(null,null,"United Arab Emirates"),
+  AF(null,null,"Afghanistan"),
+  AG(null,null,"Antigua and Barbuda"),
+  AI(null,null,"Anguilla"),
+  AL(null,null,"Albania"),
+  AM(null,null,"Armenia"),
+  AN(null,null,"Netherlands Antilles"),
+  AO(null,null,"Angola"),
+  AQ(null,null,"Antarctica"),
+  AR(null,null,"Argentina"),
+  AS(null,null,"American Samoa"),
+  AT(null,null,"Austria"),
+  AU(null,null,"Australia"),
+  AW(null,null,"Aruba"),
+  AX(null,null,"Åland Islands"),
+  AZ(null,null,"Azerbaijan"),
+  BA(null,null,"Bosnia and Herzegovina"),
+  BB(null,null,"Barbados"),
+  BD(null,null,"Bangladesh"),
+  BE(null,null,"Belgium"),
+  BF(null,null,"Burkina Faso"),
+  BG(null,null,"Bulgaria"),
+  BH(null,null,"Bahrain"),
+  BI(null,null,"Burundi"),
+  BJ(null,null,"Benin"),
+  BL(null,null,"Saint Barthélemy"),
+  BM(null,null,"Bermuda"),
+  BN(null,null,"Brunei Darussalam"),
+  BO(null,null,"Bolivia"),
+  BR(null,null,"Brazil"),
+  BS(null,null,"Bahamas"),
+  BT(null,null,"Bhutan"),
+  BU("1989-12-05","MM","Burma"),
+  BV(null,null,"Bouvet Island"),
+  BW(null,null,"Botswana"),
+  BY(null,null,"Belarus"),
+  BZ(null,null,"Belize"),
+  CA(null,null,"Canada"),
+  CC(null,null,"Cocos (Keeling) Islands"),
+  CD(null,null,"Congo, The Democratic Republic of the"),
+  CF(null,null,"Central African Republic"),
+  CG(null,null,"Congo"),
+  CH(null,null,"Switzerland"),
+  CI(null,null,"Côte d'Ivoire"),
+  CK(null,null,"Cook Islands"),
+  CL(null,null,"Chile"),
+  CM(null,null,"Cameroon"),
+  CN(null,null,"China"),
+  CO(null,null,"Colombia"),
+  CR(null,null,"Costa Rica"),
+  CS("2006-10-05",null,"Serbia and Montenegro"),
+  CU(null,null,"Cuba"),
+  CV(null,null,"Cape Verde"),
+  CX(null,null,"Christmas Island"),
+  CY(null,null,"Cyprus"),
+  CZ(null,null,"Czech Republic"),
+  DD("1990-10-30","DE","German Democratic Republic"),
+  DE(null,null,"Germany"),
+  DJ(null,null,"Djibouti"),
+  DK(null,null,"Denmark"),
+  DM(null,null,"Dominica"),
+  DO(null,null,"Dominican Republic"),
+  DZ(null,null,"Algeria"),
+  EC(null,null,"Ecuador"),
+  EE(null,null,"Estonia"),
+  EG(null,null,"Egypt"),
+  EH(null,null,"Western Sahara"),
+  ER(null,null,"Eritrea"),
+  ES(null,null,"Spain"),
+  ET(null,null,"Ethiopia"),
+  FI(null,null,"Finland"),
+  FJ(null,null,"Fiji"),
+  FK(null,null,"Falkland Islands (Malvinas)"),
+  FM(null,null,"Micronesia, Federated States of"),
+  FO(null,null,"Faroe Islands"),
+  FR(null,null,"France"),
+  FX("1997-07-14","FR","Metropolitan France"),
+  GA(null,null,"Gabon"),
+  GB(null,null,"United Kingdom"),
+  GD(null,null,"Grenada"),
+  GE(null,null,"Georgia"),
+  GF(null,null,"French Guiana"),
+  GG(null,null,"Guernsey"),
+  GH(null,null,"Ghana"),
+  GI(null,null,"Gibraltar"),
+  GL(null,null,"Greenland"),
+  GM(null,null,"Gambia"),
+  GN(null,null,"Guinea"),
+  GP(null,null,"Guadeloupe"),
+  GQ(null,null,"Equatorial Guinea"),
+  GR(null,null,"Greece"),
+  GS(null,null,"South Georgia and the South Sandwich Islands"),
+  GT(null,null,"Guatemala"),
+  GU(null,null,"Guam"),
+  GW(null,null,"Guinea-Bissau"),
+  GY(null,null,"Guyana"),
+  HK(null,null,"Hong Kong"),
+  HM(null,null,"Heard Island and McDonald Islands"),
+  HN(null,null,"Honduras"),
+  HR(null,null,"Croatia"),
+  HT(null,null,"Haiti"),
+  HU(null,null,"Hungary"),
+  ID(null,null,"Indonesia"),
+  IE(null,null,"Ireland"),
+  IL(null,null,"Israel"),
+  IM(null,null,"Isle of Man"),
+  IN(null,null,"India"),
+  IO(null,null,"British Indian Ocean Territory"),
+  IQ(null,null,"Iraq"),
+  IR(null,null,"Iran, Islamic Republic of"),
+  IS(null,null,"Iceland"),
+  IT(null,null,"Italy"),
+  JE(null,null,"Jersey"),
+  JM(null,null,"Jamaica"),
+  JO(null,null,"Jordan"),
+  JP(null,null,"Japan"),
+  KE(null,null,"Kenya"),
+  KG(null,null,"Kyrgyzstan"),
+  KH(null,null,"Cambodia"),
+  KI(null,null,"Kiribati"),
+  KM(null,null,"Comoros"),
+  KN(null,null,"Saint Kitts and Nevis"),
+  KP(null,null,"Korea, Democratic People's Republic of"),
+  KR(null,null,"Korea, Republic of"),
+  KW(null,null,"Kuwait"),
+  KY(null,null,"Cayman Islands"),
+  KZ(null,null,"Kazakhstan"),
+  LA(null,null,"Lao People's Democratic Republic"),
+  LB(null,null,"Lebanon"),
+  LC(null,null,"Saint Lucia"),
+  LI(null,null,"Liechtenstein"),
+  LK(null,null,"Sri Lanka"),
+  LR(null,null,"Liberia"),
+  LS(null,null,"Lesotho"),
+  LT(null,null,"Lithuania"),
+  LU(null,null,"Luxembourg"),
+  LV(null,null,"Latvia"),
+  LY(null,null,"Libyan Arab Jamahiriya"),
+  MA(null,null,"Morocco"),
+  MC(null,null,"Monaco"),
+  MD(null,null,"Moldova, Republic of"),
+  ME(null,null,"Montenegro"),
+  MF(null,null,"Saint Martin"),
+  MG(null,null,"Madagascar"),
+  MH(null,null,"Marshall Islands"),
+  MK(null,null,"Macedonia, The Former Yugoslav Republic of"),
+  ML(null,null,"Mali"),
+  MM(null,null,"Myanmar"),
+  MN(null,null,"Mongolia"),
+  MO(null,null,"Macao"),
+  MP(null,null,"Northern Mariana Islands"),
+  MQ(null,null,"Martinique"),
+  MR(null,null,"Mauritania"),
+  MS(null,null,"Montserrat"),
+  MT(null,null,"Malta"),
+  MU(null,null,"Mauritius"),
+  MV(null,null,"Maldives"),
+  MW(null,null,"Malawi"),
+  MX(null,null,"Mexico"),
+  MY(null,null,"Malaysia"),
+  MZ(null,null,"Mozambique"),
+  NA(null,null,"Namibia"),
+  NC(null,null,"New Caledonia"),
+  NE(null,null,"Niger"),
+  NF(null,null,"Norfolk Island"),
+  NG(null,null,"Nigeria"),
+  NI(null,null,"Nicaragua"),
+  NL(null,null,"Netherlands"),
+  NO(null,null,"Norway"),
+  NP(null,null,"Nepal"),
+  NR(null,null,"Nauru"),
+  NT("1993-07-12",null,"Neutral Zone"),
+  NU(null,null,"Niue"),
+  NZ(null,null,"New Zealand"),
+  OM(null,null,"Oman"),
+  PA(null,null,"Panama"),
+  PE(null,null,"Peru"),
+  PF(null,null,"French Polynesia"),
+  PG(null,null,"Papua New Guinea"),
+  PH(null,null,"Philippines"),
+  PK(null,null,"Pakistan"),
+  PL(null,null,"Poland"),
+  PM(null,null,"Saint Pierre and Miquelon"),
+  PN(null,null,"Pitcairn"),
+  PR(null,null,"Puerto Rico"),
+  PS(null,null,"Palestinian Territory, Occupied"),
+  PT(null,null,"Portugal"),
+  PW(null,null,"Palau"),
+  PY(null,null,"Paraguay"),
+  QA(null,null,"Qatar"),
+  QM(null,null,"PRIVATE USE"),
+  QN(null,null,"PRIVATE USE"),
+  QO(null,null,"PRIVATE USE"),
+  QP(null,null,"PRIVATE USE"),
+  QQ(null,null,"PRIVATE USE"),
+  QR(null,null,"PRIVATE USE"),
+  QS(null,null,"PRIVATE USE"),
+  QT(null,null,"PRIVATE USE"),
+  QU(null,null,"PRIVATE USE"),
+  QV(null,null,"PRIVATE USE"),
+  QW(null,null,"PRIVATE USE"),
+  QX(null,null,"PRIVATE USE"),
+  QY(null,null,"PRIVATE USE"),
+  QZ(null,null,"PRIVATE USE"),
+  RE(null,null,"Réunion"),
+  RO(null,null,"Romania"),
+  RS(null,null,"Serbia"),
+  RU(null,null,"Russian Federation"),
+  RW(null,null,"Rwanda"),
+  SA(null,null,"Saudi Arabia"),
+  SB(null,null,"Solomon Islands"),
+  SC(null,null,"Seychelles"),
+  SD(null,null,"Sudan"),
+  SE(null,null,"Sweden"),
+  SG(null,null,"Singapore"),
+  SH(null,null,"Saint Helena"),
+  SI(null,null,"Slovenia"),
+  SJ(null,null,"Svalbard and Jan Mayen"),
+  SK(null,null,"Slovakia"),
+  SL(null,null,"Sierra Leone"),
+  SM(null,null,"San Marino"),
+  SN(null,null,"Senegal"),
+  SO(null,null,"Somalia"),
+  SR(null,null,"Suriname"),
+  ST(null,null,"Sao Tome and Principe"),
+  SU("1992-08-30",null,"Union of Soviet Socialist Republics"),
+  SV(null,null,"El Salvador"),
+  SY(null,null,"Syrian Arab Republic"),
+  SZ(null,null,"Swaziland"),
+  TC(null,null,"Turks and Caicos Islands"),
+  TD(null,null,"Chad"),
+  TF(null,null,"French Southern Territories"),
+  TG(null,null,"Togo"),
+  TH(null,null,"Thailand"),
+  TJ(null,null,"Tajikistan"),
+  TK(null,null,"Tokelau"),
+  TL(null,null,"Timor-Leste"),
+  TM(null,null,"Turkmenistan"),
+  TN(null,null,"Tunisia"),
+  TO(null,null,"Tonga"),
+  TP("2002-11-15","TL","East Timor"),
+  TR(null,null,"Turkey"),
+  TT(null,null,"Trinidad and Tobago"),
+  TV(null,null,"Tuvalu"),
+  TW(null,null,"Taiwan, Province of China"),
+  TZ(null,null,"Tanzania, United Republic of"),
+  UA(null,null,"Ukraine"),
+  UG(null,null,"Uganda"),
+  UM(null,null,"United States Minor Outlying Islands"),
+  US(null,null,"United States"),
+  UY(null,null,"Uruguay"),
+  UZ(null,null,"Uzbekistan"),
+  VA(null,null,"Holy See (Vatican City State)"),
+  VC(null,null,"Saint Vincent and the Grenadines"),
+  VE(null,null,"Venezuela"),
+  VG(null,null,"Virgin Islands, British"),
+  VI(null,null,"Virgin Islands, U.S."),
+  VN(null,null,"Viet Nam"),
+  VU(null,null,"Vanuatu"),
+  WF(null,null,"Wallis and Futuna"),
+  WS(null,null,"Samoa"),
+  XA(null,null,"PRIVATE USE"),
+  XB(null,null,"PRIVATE USE"),
+  XC(null,null,"PRIVATE USE"),
+  XD(null,null,"PRIVATE USE"),
+  XE(null,null,"PRIVATE USE"),
+  XF(null,null,"PRIVATE USE"),
+  XG(null,null,"PRIVATE USE"),
+  XH(null,null,"PRIVATE USE"),
+  XI(null,null,"PRIVATE USE"),
+  XJ(null,null,"PRIVATE USE"),
+  XK(null,null,"PRIVATE USE"),
+  XL(null,null,"PRIVATE USE"),
+  XM(null,null,"PRIVATE USE"),
+  XN(null,null,"PRIVATE USE"),
+  XO(null,null,"PRIVATE USE"),
+  XP(null,null,"PRIVATE USE"),
+  XQ(null,null,"PRIVATE USE"),
+  XR(null,null,"PRIVATE USE"),
+  XS(null,null,"PRIVATE USE"),
+  XT(null,null,"PRIVATE USE"),
+  XU(null,null,"PRIVATE USE"),
+  XV(null,null,"PRIVATE USE"),
+  XW(null,null,"PRIVATE USE"),
+  XX(null,null,"PRIVATE USE"),
+  XY(null,null,"PRIVATE USE"),
+  XZ(null,null,"PRIVATE USE"),
+  YD("1990-08-14","YE","Yemen, Democratic"),
+  YE(null,null,"Yemen"),
+  YT(null,null,"Mayotte"),
+  YU("2003-07-23","CS","Yugoslavia"),
+  ZA(null,null,"South Africa"),
+  ZM(null,null,"Zambia"),
+  ZR("1997-07-14","CD","Zaire"),
+  ZW(null,null,"Zimbabwe"),
+  ZZ(null,null,"PRIVATE USE"),
+  UN001(null,null,"World"),
+  UN002(null,null,"Africa"),
+  UN005(null,null,"South America"),
+  UN009(null,null,"Oceania"),
+  UN011(null,null,"Western Africa"),
+  UN013(null,null,"Central America"),
+  UN014(null,null,"Eastern Africa"),
+  UN015(null,null,"Northern Africa"),
+  UN017(null,null,"Middle Africa"),
+  UN018(null,null,"Southern Africa"),
+  UN019(null,null,"Americas"),
+  UN021(null,null,"Northern America"),
+  UN029(null,null,"Caribbean"),
+  UN030(null,null,"Eastern Asia"),
+  UN034(null,null,"Southern Asia"),
+  UN035(null,null,"South-Eastern Asia"),
+  UN039(null,null,"Southern Europe"),
+  UN053(null,null,"Australia and New Zealand"),
+  UN054(null,null,"Melanesia"),
+  UN057(null,null,"Micronesia"),
+  UN061(null,null,"Polynesia"),
+  UN142(null,null,"Asia"),
+  UN143(null,null,"Central Asia"),
+  UN145(null,null,"Western Asia"),
+  UN150(null,null,"Europe"),
+  UN151(null,null,"Eastern Europe"),
+  UN154(null,null,"Northern Europe"),
+  UN155(null,null,"Western Europe"),
+  UN419(null,null,"Latin America and the Caribbean")
+;
+  
+  private final String deprecated;
+  private final String preferred;
+  private final String[] descriptions;
+  
+  private Region(
+    String dep, 
+    String pref, 
+    String... desc) {
+      this.deprecated = dep;
+      this.preferred = pref;
+      this.descriptions = desc;
+  }
+
+  public String getDeprecated() {
+    return deprecated;
+  }
+
+  public boolean isDeprecated() {
+    return deprecated != null;
+  }
+  
+  public Region getPreferred() {
+    return preferred != null ? 
+      valueOf(preferred.toUpperCase(Locale.US)) : this;
+  }
+  
+  public String getPreferredValue() {
+    return preferred;
+  }
+
+  public String getDescription() {
+    return descriptions.length > 0 ? descriptions[0] : null;
+  }
+  
+  public String[] getDescriptions() {
+    return descriptions;
+  }
+  
+  public Subtag newSubtag() {
+    return new Subtag(this);
+  }
+  
+  public static Region valueOf(Subtag subtag) {
+    if (subtag == null) return null;
+    if (subtag.getType() == Subtag.Type.REGION) {
+      String name = subtag.getName();
+      if (name.length() == 3) name = "UN" + name;
+      else name = name.toUpperCase(Locale.US);
+      return valueOf(name);
+    }
+    else throw new IllegalArgumentException("Wrong subtag type");
+  }
+  
+}

Added: incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/rfc4646/enums/Script.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/rfc4646/enums/Script.java?rev=606389&view=auto
==============================================================================
--- incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/rfc4646/enums/Script.java
(added)
+++ incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/rfc4646/enums/Script.java
Fri Dec 21 19:05:32 2007
@@ -0,0 +1,255 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  The ASF licenses this file to You
+* under the Apache License, Version 2.0 (the "License"); you may not
+* use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.  For additional information regarding
+* copyright in this work, please see the NOTICE file in the top level
+* directory of this distribution.
+*/
+package org.apache.abdera.i18n.rfc4646.enums;
+
+import java.util.Locale;
+
+import org.apache.abdera.i18n.rfc4646.Subtag;
+
+
+public enum Script {
+
+  ARAB(null,null,"Arabic"),
+  ARMI(null,null,"Imperial Aramaic"),
+  ARMN(null,null,"Armenian"),
+  AVST(null,null,"Avestan"),
+  BALI(null,null,"Balinese"),
+  BATK(null,null,"Batak"),
+  BENG(null,null,"Bengali"),
+  BLIS(null,null,"Blissymbols"),
+  BOPO(null,null,"Bopomofo"),
+  BRAH(null,null,"Brahmi"),
+  BRAI(null,null,"Braille"),
+  BUGI(null,null,"Buginese"),
+  BUHD(null,null,"Buhid"),
+  CAKM(null,null,"Chakma"),
+  CANS(null,null,"Unified Canadian Aboriginal Syllabics"),
+  CARI(null,null,"Carian"),
+  CHAM(null,null,"Cham"),
+  CHER(null,null,"Cherokee"),
+  CIRT(null,null,"Cirth"),
+  COPT(null,null,"Coptic"),
+  CPRT(null,null,"Cypriot"),
+  CYRL(null,null,"Cyrillic"),
+  CYRS(null,null,"Cyrillic (Old Church Slavonic variant)"),
+  DEVA(null,null,"Devanagari (Nagari)"),
+  DSRT(null,null,"Deseret (Mormon)"),
+  EGYD(null,null,"Egyptian demotic"),
+  EGYH(null,null,"Egyptian hieratic"),
+  EGYP(null,null,"Egyptian hieroglyphs"),
+  ETHI(null,null,"Ethiopic (Geʻez)","Ethiopic (Ge'ez)"),
+  GEOK(null,null,"Khutsuri (Asomtavruli and Nuskhuri)"),
+  GEOR(null,null,"Georgian (Mkhedruli)"),
+  GLAG(null,null,"Glagolitic"),
+  GOTH(null,null,"Gothic"),
+  GREK(null,null,"Greek"),
+  GUJR(null,null,"Gujarati"),
+  GURU(null,null,"Gurmukhi"),
+  HANG(null,null,"Hangul (Hangŭl, Hangeul)"),
+  HANI(null,null,"Han (Hanzi, Kanji, Hanja)"),
+  HANO(null,null,"Hanunoo (Hanunóo)"),
+  HANS(null,null,"Han (Simplified variant)"),
+  HANT(null,null,"Han (Traditional variant)"),
+  HEBR(null,null,"Hebrew"),
+  HIRA(null,null,"Hiragana"),
+  HMNG(null,null,"Pahawh Hmong"),
+  HRKT(null,null,"(alias for Hiragana + Katakana)"),
+  HUNG(null,null,"Old Hungarian"),
+  INDS(null,null,"Indus (Harappan)"),
+  ITAL(null,null,"Old Italic (Etruscan, Oscan, etc.)"),
+  JAVA(null,null,"Javanese"),
+  JPAN(null,null,"Japanese (alias for Han + Hiragana + Katakana)"),
+  KALI(null,null,"Kayah Li"),
+  KANA(null,null,"Katakana"),
+  KHAR(null,null,"Kharoshthi"),
+  KHMR(null,null,"Khmer"),
+  KNDA(null,null,"Kannada"),
+  KORE(null,null,"Korean (alias for Hangul + Han)"),
+  KTHI(null,null,"Kaithi"),
+  LANA(null,null,"Lanna","Tai Tham"),
+  LAOO(null,null,"Lao"),
+  LATF(null,null,"Latin (Fraktur variant)"),
+  LATG(null,null,"Latin (Gaelic variant)"),
+  LATN(null,null,"Latin"),
+  LEPC(null,null,"Lepcha (Róng)"),
+  LIMB(null,null,"Limbu"),
+  LINA(null,null,"Linear A"),
+  LINB(null,null,"Linear B"),
+  LYCI(null,null,"Lycian"),
+  LYDI(null,null,"Lydian"),
+  MAND(null,null,"Mandaic","Mandaean"),
+  MANI(null,null,"Manichaean"),
+  MAYA(null,null,"Mayan hieroglyphs"),
+  MERO(null,null,"Meroitic"),
+  MLYM(null,null,"Malayalam"),
+  MONG(null,null,"Mongolian"),
+  MOON(null,null,"Moon","Moon code","Moon script","Moon type"),
+  MTEI(null,null,"Meitei Mayek","Meithei","Meetei"),
+  MYMR(null,null,"Myanmar (Burmese)"),
+  NKOO(null,null,"N’Ko"),
+  OGAM(null,null,"Ogham"),
+  OLCK(null,null,"Ol Chiki (Ol Cemet', Ol, Santali)"),
+  ORKH(null,null,"Orkhon"),
+  ORYA(null,null,"Oriya"),
+  OSMA(null,null,"Osmanya"),
+  PERM(null,null,"Old Permic"),
+  PHAG(null,null,"Phags-pa"),
+  PHLI(null,null,"Inscriptional Pahlavi"),
+  PHLP(null,null,"Psalter Pahlavi"),
+  PHLV(null,null,"Book Pahlavi"),
+  PHNX(null,null,"Phoenician"),
+  PLRD(null,null,"Pollard Phonetic"),
+  PRTI(null,null,"Inscriptional Parthian"),
+  QAAA(null,null,"PRIVATE USE"),
+  QAAB(null,null,"PRIVATE USE"),
+  QAAC(null,null,"PRIVATE USE"),
+  QAAD(null,null,"PRIVATE USE"),
+  QAAE(null,null,"PRIVATE USE"),
+  QAAF(null,null,"PRIVATE USE"),
+  QAAG(null,null,"PRIVATE USE"),
+  QAAH(null,null,"PRIVATE USE"),
+  QAAI(null,null,"PRIVATE USE"),
+  QAAJ(null,null,"PRIVATE USE"),
+  QAAK(null,null,"PRIVATE USE"),
+  QAAL(null,null,"PRIVATE USE"),
+  QAAM(null,null,"PRIVATE USE"),
+  QAAN(null,null,"PRIVATE USE"),
+  QAAO(null,null,"PRIVATE USE"),
+  QAAP(null,null,"PRIVATE USE"),
+  QAAQ(null,null,"PRIVATE USE"),
+  QAAR(null,null,"PRIVATE USE"),
+  QAAS(null,null,"PRIVATE USE"),
+  QAAT(null,null,"PRIVATE USE"),
+  QAAU(null,null,"PRIVATE USE"),
+  QAAV(null,null,"PRIVATE USE"),
+  QAAW(null,null,"PRIVATE USE"),
+  QAAX(null,null,"PRIVATE USE"),
+  QABA(null,null,"PRIVATE USE"),
+  QABB(null,null,"PRIVATE USE"),
+  QABC(null,null,"PRIVATE USE"),
+  QABD(null,null,"PRIVATE USE"),
+  QABE(null,null,"PRIVATE USE"),
+  QABF(null,null,"PRIVATE USE"),
+  QABG(null,null,"PRIVATE USE"),
+  QABH(null,null,"PRIVATE USE"),
+  QABI(null,null,"PRIVATE USE"),
+  QABJ(null,null,"PRIVATE USE"),
+  QABK(null,null,"PRIVATE USE"),
+  QABL(null,null,"PRIVATE USE"),
+  QABM(null,null,"PRIVATE USE"),
+  QABN(null,null,"PRIVATE USE"),
+  QABO(null,null,"PRIVATE USE"),
+  QABP(null,null,"PRIVATE USE"),
+  QABQ(null,null,"PRIVATE USE"),
+  QABR(null,null,"PRIVATE USE"),
+  QABS(null,null,"PRIVATE USE"),
+  QABT(null,null,"PRIVATE USE"),
+  QABU(null,null,"PRIVATE USE"),
+  QABV(null,null,"PRIVATE USE"),
+  QABW(null,null,"PRIVATE USE"),
+  QABX(null,null,"PRIVATE USE"),
+  RJNG(null,null,"Rejang","Redjang","Kaganga"),
+  RORO(null,null,"Rongorongo"),
+  RUNR(null,null,"Runic"),
+  SAMR(null,null,"Samaritan"),
+  SARA(null,null,"Sarati"),
+  SAUR(null,null,"Saurashtra"),
+  SGNW(null,null,"SignWriting"),
+  SHAW(null,null,"Shavian (Shaw)"),
+  SINH(null,null,"Sinhala"),
+  SUND(null,null,"Sundanese"),
+  SYLO(null,null,"Syloti Nagri"),
+  SYRC(null,null,"Syriac"),
+  SYRE(null,null,"Syriac (Estrangelo variant)"),
+  SYRJ(null,null,"Syriac (Western variant)"),
+  SYRN(null,null,"Syriac (Eastern variant)"),
+  TAGB(null,null,"Tagbanwa"),
+  TALE(null,null,"Tai Le"),
+  TALU(null,null,"New Tai Lue"),
+  TAML(null,null,"Tamil"),
+  TAVT(null,null,"Tai Viet"),
+  TELU(null,null,"Telugu"),
+  TENG(null,null,"Tengwar"),
+  TFNG(null,null,"Tifinagh (Berber)"),
+  TGLG(null,null,"Tagalog"),
+  THAA(null,null,"Thaana"),
+  THAI(null,null,"Thai"),
+  TIBT(null,null,"Tibetan"),
+  UGAR(null,null,"Ugaritic"),
+  VAII(null,null,"Vai"),
+  VISP(null,null,"Visible Speech"),
+  XPEO(null,null,"Old Persian"),
+  XSUX(null,null,"Cuneiform, Sumero-Akkadian"),
+  YIII(null,null,"Yi"),
+  ZMTH(null,null,"Mathematical notation"),
+  ZSYM(null,null,"Symbols"),
+  ZXXX(null,null,"Code for unwritten documents"),
+  ZYYY(null,null,"Code for undetermined script"),
+  ZZZZ(null,null,"Code for uncoded script")
+;
+  
+  private final String deprecated;
+  private final String preferred;
+  private final String[] descriptions;
+  
+  private Script(
+    String dep, 
+    String pref, 
+    String... desc) {
+      this.deprecated = dep;
+      this.preferred = pref;
+      this.descriptions = desc;
+  }
+
+  public String getDeprecated() {
+    return deprecated;
+  }
+  
+  public boolean isDeprecated() {
+    return deprecated != null;
+  }
+
+  public String getPreferredValue() {
+    return preferred;
+  }
+
+  public Script getPreferred() {
+    return preferred != null ? 
+      valueOf(preferred.toUpperCase(Locale.US)) : this;
+  }
+  
+  public String getDescription() {
+    return descriptions.length > 0 ? descriptions[0] : null;
+  }
+  
+  public String[] getDescriptions() {
+    return descriptions;
+  }
+  
+  public Subtag newSubtag() {
+    return new Subtag(this);
+  }
+  
+  public static Script valueOf(Subtag subtag) {
+    if (subtag == null) return null;
+    if (subtag.getType() == Subtag.Type.SCRIPT)
+      return valueOf(subtag.getName().toUpperCase(Locale.US));
+    else throw new IllegalArgumentException("Wrong subtag type");
+  }
+  
+}

Added: incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/rfc4646/enums/Singleton.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/rfc4646/enums/Singleton.java?rev=606389&view=auto
==============================================================================
--- incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/rfc4646/enums/Singleton.java
(added)
+++ incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/rfc4646/enums/Singleton.java
Fri Dec 21 19:05:32 2007
@@ -0,0 +1,100 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  The ASF licenses this file to You
+* under the Apache License, Version 2.0 (the "License"); you may not
+* use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.  For additional information regarding
+* copyright in this work, please see the NOTICE file in the top level
+* directory of this distribution.
+*/
+package org.apache.abdera.i18n.rfc4646.enums;
+
+import java.util.Locale;
+
+import org.apache.abdera.i18n.rfc4646.Subtag;
+
+public enum Singleton {
+  A("Undefined", -1, null, null),
+  B("Undefined", -1, null, null),
+  C("Undefined", -1, null, null),
+  D("Undefined", -1, null, null),
+  E("Undefined", -1, null, null),
+  F("Undefined", -1, null, null),
+  G("Undefined", -1, null, null),
+  H("Undefined", -1, null, null),
+  I("Undefined", -1, null, null),
+  J("Undefined", -1, null, null),
+  K("Undefined", -1, null, null),
+  L("Undefined", -1, null, null),
+  M("Undefined", -1, null, null),
+  N("Undefined", -1, null, null),
+  O("Undefined", -1, null, null),
+  P("Undefined", -1, null, null),
+  Q("Undefined", -1, null, null),
+  R("Undefined", -1, null, null),
+  S("Undefined", -1, null, null),
+  T("Undefined", -1, null, null),
+  U("Undefined", -1, null, null),
+  V("Undefined", -1, null, null),
+  W("Undefined", -1, null, null),
+  X("Private Use", 4646, null, null),
+  Y("Undefined", -1, null, null),
+  Z("Undefined", -1, null, null)
+  ;
+  
+  private final String description;
+  private final int rfc;
+  private final String deprecated;
+  private final String preferred;
+  
+  private Singleton(String description, int rfc, String deprecated, String preferred) {
+    this.description = description;
+    this.rfc = rfc;
+    this.deprecated = deprecated;
+    this.preferred = preferred;
+  }
+  
+  public String getDescription() {
+    return description;
+  }
+  
+  public int getRFC() {
+    return rfc;
+  }
+  
+  public Subtag newSubtag() {
+    return new Subtag(this);
+  }
+  
+  public String getDeprecated() {
+    return deprecated;
+  }
+  
+  public boolean isDeprecated() {
+    return deprecated != null;
+  }
+
+  public String getPreferredValue() {
+    return preferred;
+  }
+  
+  public Singleton getPreferred() {
+    return preferred != null ? 
+      valueOf(preferred.toUpperCase(Locale.US)) : this;
+  }
+
+  public static Singleton valueOf(Subtag subtag) {
+    if (subtag == null) return null;
+    if (subtag.getType() == Subtag.Type.SINGLETON)
+      return valueOf(subtag.getName().toUpperCase(Locale.US));
+    else throw new IllegalArgumentException("Wrong subtag type");
+  }
+}

Added: incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/rfc4646/enums/Variant.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/rfc4646/enums/Variant.java?rev=606389&view=auto
==============================================================================
--- incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/rfc4646/enums/Variant.java
(added)
+++ incubator/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/rfc4646/enums/Variant.java
Fri Dec 21 19:05:32 2007
@@ -0,0 +1,123 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  The ASF licenses this file to You
+* under the Apache License, Version 2.0 (the "License"); you may not
+* use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.  For additional information regarding
+* copyright in this work, please see the NOTICE file in the top level
+* directory of this distribution.
+*/
+package org.apache.abdera.i18n.rfc4646.enums;
+
+import java.util.Locale;
+
+import org.apache.abdera.i18n.rfc4646.Subtag;
+
+
+public enum Variant {
+
+  _1606NICT(null,null,"frm","Late Middle French (to 1606)"),
+  _1694ACAD(null,null,"fr","Early Modern French"),
+  _1901(null,null,"de","Traditional German orthography"),
+  _1994(null,null,new String[] {"sl-rozaj","sl-rozaj-biske","sl-rozaj-njiva","sl-rozaj-osojs","sl-rozaj-solba"},"Standardized
Resian orthography"),
+  _1996(null,null,"de","German orthography of 1996"),
+  AREVELA(null,null,"hy","Eastern Armenian"),
+  AREVMDA(null,null,"hy","Western Armenian"),
+  BAKU1926(null,null,new String[] {"az","ba","crh","kk","krc","ky","sah","tk","tt","uz"},"Unified
Turkic Latin Alphabet (Historical)"),
+  BISKE(null,null,"sl-rozaj","The San Giorgio dialect of Resian","The Bila dialect of Resian"),
+  BOONT(null,null,"en","Boontling"),
+  FONIPA(null,null,(String)null,"International Phonetic Alphabet"),
+  FONUPA(null,null,(String)null,"Uralic Phonetic Alphabet"),
+  LIPAW(null,null,"sl-rozaj","The Lipovaz dialect of Resian","The Lipovec dialect of Resian"),
+  MONOTON(null,null,"el","Monotonic Greek"),
+  NEDIS(null,null,"sl","Natisone dialect","Nadiza dialect"),
+  NJIVA(null,null,"sl-rozaj","The Gniva dialect of Resian","The Njiva dialect of Resian"),
+  OSOJS(null,null,"sl-rozaj","The Oseacco dialect of Resian","The Osojane dialect of Resian"),
+  POLYTON(null,null,"el","Polytonic Greek"),
+  ROZAJ(null,null,"sl","Resian","Resianic","Rezijan"),
+  SCOTLAND(null,null,"en","Scottish Standard English"),
+  SCOUSE(null,null,"en","Scouse"),
+  SOLBA(null,null,"sl-rozaj","The Stolvizza dialect of Resian","The Solbica dialect of Resian"),
+  TARASK(null,null,"be","Belarusian in Taraskievica orthography"),
+  VALENCIA(null,null,"ca","Valencian")
+;
+  
+  private final String deprecated;
+  private final String preferred;
+  private final String[] prefixes;
+  private final String[] descriptions;
+
+  private Variant(
+    String dep, 
+    String pref, 
+    String prefix, 
+    String... desc) {
+      this(dep,pref,new String[] {prefix},desc);
+    }
+  
+  private Variant(
+    String dep, 
+    String pref, 
+    String[] prefixes, 
+    String... desc) {
+      this.deprecated = dep;
+      this.preferred = pref;
+      this.prefixes = prefixes;
+      this.descriptions = desc;
+  }
+
+  public boolean isDeprecated() {
+    return deprecated != null;
+  }
+  
+  public String getDeprecated() {
+    return deprecated;
+  }
+
+  public String getPreferredValue() {
+    return preferred;
+  }
+
+  public Variant getPreferred() {
+    return preferred != null ? 
+      valueOf(preferred.toUpperCase(Locale.US)) : this;
+  }
+  
+  public String getPrefix() {
+    return prefixes != null && prefixes.length > 0 ? prefixes[0] : null;
+  }
+  
+  public String[] getPrefixes() {
+    return prefixes;
+  }
+
+  public String getDescription() {
+    return descriptions.length > 0 ? descriptions[0] : null;
+  }
+  
+  public String[] getDescriptions() {
+    return descriptions;
+  }
+  
+  public Subtag newSubtag() {
+    return new Subtag(this);
+  }
+  
+  public static Variant valueOf(Subtag subtag) {
+    if (subtag == null) return null;
+    if (subtag.getType() == Subtag.Type.VARIANT) {
+      String name = subtag.getName();
+      if (name.startsWith("1")) name = "_" + name;
+      return valueOf(name.toUpperCase(Locale.US));
+    } else throw new IllegalArgumentException("Wrong subtag type");
+  }
+  
+}



Mime
View raw message