org.devyant.decorutils
Class Utils

java.lang.Object
  extended by org.devyant.decorutils.Utils

public class Utils
extends java.lang.Object

Since:
2/Fev/2005 15:50:55
Version:
$Revision: 1.0$ ($Author: ftavares$)
Author:
Filipe Tavares

Constructor Summary
protected Utils()
          Not allowed.
 
Method Summary
static java.lang.String capitalize(java.lang.String string)
          Capitalize first word of String.
static java.lang.String[] commaSplitToArray(java.lang.String string)
          Split by delim character and ignore surrounding space.
static java.util.Collection commaSplitToCollection(java.lang.String string)
          Split by delim character and ignore surrounding space.
static java.lang.String decapitalize(java.lang.String string)
          Decapitalize first word of String.
static java.lang.Object getClassProperty(java.lang.Object object, java.lang.String prop)
          The value for a certain property from the object.
static java.lang.reflect.Method getGetterMethod(java.lang.Class theClass, java.lang.String property)
          The getter method for certain property from a certain class.
static java.lang.String[] splitToArrayIgnoreSpace(java.lang.String string, char delim)
          Split by delim character and ignore surrounding space.
static java.util.Collection splitToCollectionIgnoreSpace(java.lang.String string, char delim)
          Split by delim character and ignore surrounding space.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

protected Utils()
Not allowed.

Method Detail

commaSplitToArray

public static final java.lang.String[] commaSplitToArray(java.lang.String string)
Split by delim character and ignore surrounding space.

Parameters:
string - The string
Returns:
Array of splited atoms

commaSplitToCollection

public static final java.util.Collection commaSplitToCollection(java.lang.String string)
Split by delim character and ignore surrounding space.

Parameters:
string - The string
Returns:
Collection of splited atoms

splitToCollectionIgnoreSpace

public static final java.util.Collection splitToCollectionIgnoreSpace(java.lang.String string,
                                                                      char delim)
Split by delim character and ignore surrounding space.

Parameters:
string - The string
delim - The delimiter character
Returns:
Collection of splited atoms

splitToArrayIgnoreSpace

public static final java.lang.String[] splitToArrayIgnoreSpace(java.lang.String string,
                                                               char delim)
Split by delim character and ignore surrounding space.

Parameters:
string - The string
delim - The delimiter character
Returns:
Array of splited atoms

capitalize

public static final java.lang.String capitalize(java.lang.String string)
Capitalize first word of String.

Parameters:
string - The String
Returns:
Capitalized String

decapitalize

public static final java.lang.String decapitalize(java.lang.String string)
Decapitalize first word of String.

Parameters:
string - The String
Returns:
Decapitalized String

getGetterMethod

public static final java.lang.reflect.Method getGetterMethod(java.lang.Class theClass,
                                                             java.lang.String property)
                                                      throws java.lang.NoSuchMethodException
The getter method for certain property from a certain class. The method can be an is or get method.

Parameters:
theClass - The property's class
property - The property
Returns:
The getter method
Throws:
java.lang.NoSuchMethodException - Thrown if method does not exist

getClassProperty

public static final java.lang.Object getClassProperty(java.lang.Object object,
                                                      java.lang.String prop)
                                               throws java.lang.NoSuchMethodException,
                                                      java.lang.IllegalAccessException,
                                                      java.lang.reflect.InvocationTargetException
The value for a certain property from the object.

Parameters:
object - The object
prop - The property
Returns:
The property's value
Throws:
java.lang.NoSuchMethodException - Thrown if method does not exist
java.lang.IllegalAccessException - Thrown if is access protected
java.lang.reflect.InvocationTargetException - Thrown if target isn't valid


Copyright © 2005 devyant. All Rights Reserved.