at.molindo.utils.tools
Enum URLCoder

java.lang.Object
  extended by java.lang.Enum<URLCoder>
      extended by at.molindo.utils.tools.URLCoder
All Implemented Interfaces:
Serializable, Comparable<URLCoder>

public enum URLCoder
extends Enum<URLCoder>

wrapper around UriUtils.encode*(..) methods

Author:
stf@molindo.at

Nested Class Summary
static class URLCoder.Utf8Unsupported
           
 
Enum Constant Summary
FRAGMENT
           
HOST
           
HTTP_URL
           
PATH
           
PATH_SEGMENT
           
PORT
           
QUERY
           
QUERY_PARAM
           
SCHEME
           
URI
           
USER_INFO
           
 
Method Summary
 String decode(String string)
           
 String decode(String string, String encoding)
           
 String encode(String string)
           
abstract  String encode(String string, String encoding)
           
static URLCoder valueOf(String name)
          Returns the enum constant of this type with the specified name.
static URLCoder[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

SCHEME

public static final URLCoder SCHEME

USER_INFO

public static final URLCoder USER_INFO

HOST

public static final URLCoder HOST

PORT

public static final URLCoder PORT

PATH

public static final URLCoder PATH

PATH_SEGMENT

public static final URLCoder PATH_SEGMENT

QUERY

public static final URLCoder QUERY

QUERY_PARAM

public static final URLCoder QUERY_PARAM

FRAGMENT

public static final URLCoder FRAGMENT

URI

public static final URLCoder URI

HTTP_URL

public static final URLCoder HTTP_URL
Method Detail

values

public static URLCoder[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (URLCoder c : URLCoder.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static URLCoder valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

encode

public abstract String encode(String string,
                              String encoding)
                       throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

encode

public final String encode(String string)

decode

public final String decode(String string)

decode

public final String decode(String string,
                           String encoding)
                    throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException


Copyright © 2013 Molindo GmbH. All Rights Reserved.