org.whattf.datatype
Class Language
java.lang.Object
org.whattf.datatype.AbstractDatatype
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
Constructor Summary |
private |
Language()
Package-private constructor |
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 |
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.
Language
private Language()
- Package-private constructor
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)