Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mortbay.util
Class TypeUtil  view TypeUtil download TypeUtil.java

java.lang.Object
  extended byorg.mortbay.util.TypeUtil
Direct Known Subclasses:
Primitive

public class TypeUtil
extends java.lang.Object

TYPE Utilities. Provides various static utiltiy methods for manipulating types and their string representations.

Since:
Jetty 4.1
Version:
$Revision: 1.10 $

Field Summary
private static java.util.HashMap class2Name
           
private static java.util.HashMap class2Value
           
private static int intCacheSize
           
private static java.lang.Integer[] integerCache
           
private static java.lang.String[] integerStrCache
           
private static org.apache.commons.logging.Log log
           
private static java.lang.Integer minusOne
           
private static java.util.HashMap name2Class
           
private static java.lang.Class[] stringArg
           
 
Constructor Summary
TypeUtil()
           
 
Method Summary
static byte convertHexDigit(byte b)
           
static byte[] fromHexString(java.lang.String s)
           
static java.lang.Class fromName(java.lang.String name)
          Class from a canonical name for a type.
static java.lang.Integer newInteger(int i)
          Convert int to Integer using cache.
static byte[] parseBytes(java.lang.String s, int base)
           
static int parseInt(java.lang.String s, int offset, int length, int base)
          Parse an int from a substring.
static java.lang.String toHexString(byte[] b)
           
static java.lang.String toHexString(byte[] b, int offset, int length)
           
static java.lang.String toName(java.lang.Class type)
          Canonical name for a type.
static java.lang.String toString(byte[] bytes, int base)
           
static java.lang.String toString(int i)
          Convert int to String using cache.
static java.lang.Object valueOf(java.lang.Class type, java.lang.String value)
          Convert String value to instance.
static java.lang.Object valueOf(java.lang.String type, java.lang.String value)
          Convert String value to instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static org.apache.commons.logging.Log log

name2Class

private static final java.util.HashMap name2Class

class2Name

private static final java.util.HashMap class2Name

class2Value

private static final java.util.HashMap class2Value

stringArg

private static java.lang.Class[] stringArg

intCacheSize

private static int intCacheSize

integerCache

private static java.lang.Integer[] integerCache

integerStrCache

private static java.lang.String[] integerStrCache

minusOne

private static java.lang.Integer minusOne
Constructor Detail

TypeUtil

public TypeUtil()
Method Detail

fromName

public static java.lang.Class fromName(java.lang.String name)
Class from a canonical name for a type.


toName

public static java.lang.String toName(java.lang.Class type)
Canonical name for a type.


valueOf

public static java.lang.Object valueOf(java.lang.Class type,
                                       java.lang.String value)
Convert String value to instance.


valueOf

public static java.lang.Object valueOf(java.lang.String type,
                                       java.lang.String value)
Convert String value to instance.


newInteger

public static java.lang.Integer newInteger(int i)
Convert int to Integer using cache.


toString

public static java.lang.String toString(int i)
Convert int to String using cache.


parseInt

public static int parseInt(java.lang.String s,
                           int offset,
                           int length,
                           int base)
                    throws java.lang.NumberFormatException
Parse an int from a substring. Negative numbers are not handled.


parseBytes

public static byte[] parseBytes(java.lang.String s,
                                int base)

toString

public static java.lang.String toString(byte[] bytes,
                                        int base)

convertHexDigit

public static byte convertHexDigit(byte b)

toHexString

public static java.lang.String toHexString(byte[] b)

toHexString

public static java.lang.String toHexString(byte[] b,
                                           int offset,
                                           int length)

fromHexString

public static byte[] fromHexString(java.lang.String s)