org.whattf.datatype
Class Language

java.lang.Object
  extended by org.whattf.datatype.AbstractDatatype
      extended by org.whattf.datatype.Language
All Implemented Interfaces:
Datatype

public final class Language
extends AbstractDatatype

Version:
$Id: Language.java,v 1.5 2006/11/18 11:51:44 hsivonen Exp $
Author:
hsivonen

Field Summary
private static String[] GRANDFATHERED
          List extracted from http://www.iana.org/assignments/language-tags on 2006-04-13.
private static Pattern HYPHEN
           
private static String[] languages
           
private static String[][] prefixesByVariant
           
private static String[] regions
           
private static String[] scripts
           
private static int[] suppressedScriptByLanguage
           
static Language THE_INSTANCE
          The singleton instance.
private static String[] variants
           
 
Fields inherited from interface org.relaxng.datatype.Datatype
ID_TYPE_ID, ID_TYPE_IDREF, ID_TYPE_IDREFS, ID_TYPE_NULL
 
Constructor Summary
private Language()
          Package-private constructor
 
Method Summary
private  void checkPrivateUse(int i, String[] subtags)
           
 void checkValid(CharSequence lit)
           
private  boolean isDigit(char c)
           
private  boolean isDigit(String str)
           
private  boolean isGrandfathered(String literal)
           
private  boolean isLanguage(String language)
           
private  boolean isLowerCaseAlpha(char c)
           
private  boolean isLowerCaseAlpha(String str)
           
private  boolean isLowerCaseAlphaNumeric(char c)
           
private  boolean isLowerCaseAlphaNumeric(String str)
           
private  boolean isRegion(String subtag)
           
private  boolean isScript(String subtag)
           
private  boolean isVariant(String subtag)
           
 
Methods inherited from class org.whattf.datatype.AbstractDatatype
checkValid, createStreamingValidator, createValue, getIdType, isContextDependent, isValid, isWhitespace, sameValue, toAsciiLowerCase, toAsciiLowerCase, valueHashCode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

THE_INSTANCE

public static final Language THE_INSTANCE
The singleton instance.


HYPHEN

private static final Pattern HYPHEN

languages

private static String[] languages

scripts

private static String[] scripts

regions

private static String[] regions

variants

private static String[] variants

suppressedScriptByLanguage

private static int[] suppressedScriptByLanguage

prefixesByVariant

private static String[][] prefixesByVariant

GRANDFATHERED

private static final String[] GRANDFATHERED
List extracted from http://www.iana.org/assignments/language-tags on 2006-04-13. List dated 2005-09-09.

Constructor Detail

Language

private Language()
Package-private constructor

Method Detail

checkValid

public void checkValid(CharSequence lit)
                throws DatatypeException
Specified by:
checkValid in class AbstractDatatype
Throws:
DatatypeException

isVariant

private boolean isVariant(String subtag)

isRegion

private boolean isRegion(String subtag)

isScript

private boolean isScript(String subtag)

isLanguage

private boolean isLanguage(String language)

checkPrivateUse

private void checkPrivateUse(int i,
                             String[] subtags)
                      throws DatatypeException
Throws:
DatatypeException

isLowerCaseAlphaNumeric

private final boolean isLowerCaseAlphaNumeric(char c)

isLowerCaseAlphaNumeric

private final boolean isLowerCaseAlphaNumeric(String str)

isDigit

private final boolean isDigit(char c)
Parameters:
c -
Returns:

isDigit

private final boolean isDigit(String str)

isLowerCaseAlpha

private final boolean isLowerCaseAlpha(char c)
Parameters:
c -
Returns:

isLowerCaseAlpha

private final boolean isLowerCaseAlpha(String str)

isGrandfathered

private boolean isGrandfathered(String literal)