com.vgrs.xcode.idna
Class Ace

java.lang.Object
  extended by com.vgrs.xcode.idna.Ace
Direct Known Subclasses:
Punycode, Race

public abstract class Ace
extends java.lang.Object

An abstract class implementing logic common to all ASCII Compatible Encodings.


Field Summary
static boolean DEFAULT_USE_STD_3_ASCII_RULES
           
 
Constructor Summary
Ace(java.lang.String aPrefix, boolean aUseStd3AsciiRules)
           
 
Method Summary
 int[] decode(char[] aInput)
          Decode a single domain label using the Ace algorithm.
 int[] domainDecode(char[] aInput)
          Decode an entire domain using the Ace algorithm.
 char[] domainEncode(int[] aInput)
          Encode an entire domain using the Ace algorithm.
 char[] encode(int[] aInput)
          Encode a single domain label using the Ace algorithm.
protected abstract  int[] internalDecode(char[] aInput)
          Ace specific decoding to be performed on the given input.
protected abstract  char[] internalEncode(int[] input)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_USE_STD_3_ASCII_RULES

public static final boolean DEFAULT_USE_STD_3_ASCII_RULES
See Also:
Constant Field Values
Constructor Detail

Ace

public Ace(java.lang.String aPrefix,
           boolean aUseStd3AsciiRules)
Parameters:
aPrefix - Prefix for this Ace
aUseStd3AsciiRules - boolean indicating if only letters, digits and hyphens are allowed in the IDN.
Method Detail

domainEncode

public char[] domainEncode(int[] aInput)
                    throws XcodeException
Encode an entire domain using the Ace algorithm.

Parameters:
aInput - An int array representing a domain name
Returns:
A char array with Ace encoded domain name
Throws:
XcodeException - when the input is null or empty or the input contains non-standard 3 ASCII character or the encoded domain name is empty or longer than 63.

domainDecode

public int[] domainDecode(char[] aInput)
                   throws XcodeException
Decode an entire domain using the Ace algorithm.

Parameters:
aInput - A char array representing an encoded domain name
Returns:
An int array with unicode codepooints
Throws:
XcodeException - when the input is null or empty

encode

public char[] encode(int[] aInput)
              throws XcodeException
Encode a single domain label using the Ace algorithm.

Parameters:
aInput - An int array representing a domain name
Returns:
A char array with Ace encoded domain name
Throws:
XcodeException - when the input is null or empty or the input contains non-standard 3 ASCII character or the encoded domain name is empty or longer than 63.

internalEncode

protected abstract char[] internalEncode(int[] input)
                                  throws XcodeException
Throws:
XcodeException

decode

public int[] decode(char[] aInput)
             throws XcodeException
Decode a single domain label using the Ace algorithm.

Parameters:
aInput - A char array representing an encoded domain name
Returns:
An int array with unicode codepooints
Throws:
XcodeException - when the input is null or empty

internalDecode

protected abstract int[] internalDecode(char[] aInput)
                                 throws XcodeException
Ace specific decoding to be performed on the given input.

Parameters:
aInput - a UTF16 character array to be decoded into Unicode code points.
Returns:
decoded Unicode code points
Throws:
XcodeException


Copyright © 2000-2010 VeriSign Inc. All Rights Reserved