edu.uoc.pfc.j2ee.jalonsod.mtp
Class MTPUtils

java.lang.Object
  extended by edu.uoc.pfc.j2ee.jalonsod.mtp.MTPUtils

public class MTPUtils
extends java.lang.Object

File: MTPUtils.java Created: 2012-04-28 Auxiliary methods not attached to specific functionality for use INSIDE the framework.

Author:
José Alonso de Motta

Field Summary
private static java.util.logging.Logger logger
           
 
Constructor Summary
MTPUtils()
           
 
Method Summary
static java.lang.Object getBeanAttrib(java.lang.Object object, java.lang.String attributeName)
          Gets the attribute of a Java Bean object with reflection mechanisms.
static java.lang.String getClassName()
          Returns the class name of the caller method.
static java.lang.String getMethodName()
          Returns the method name of the caller method.
static java.lang.String getPackageName()
          Returns the package name of the caller method.
static java.util.Date parseDate(java.lang.String date, java.lang.String format)
          Parses a date stored in a string with a specific format mask.
static void setLoggerToLevel(java.lang.String l)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final java.util.logging.Logger logger
Constructor Detail

MTPUtils

public MTPUtils()
Method Detail

getPackageName

public static java.lang.String getPackageName()
Returns the package name of the caller method.

Returns:
the package name of the caller method.

getClassName

public static java.lang.String getClassName()
Returns the class name of the caller method.

Returns:
the class name of the caller method.

getMethodName

public static java.lang.String getMethodName()
Returns the method name of the caller method.

Returns:
the method name of the caller method.

setLoggerToLevel

public static void setLoggerToLevel(java.lang.String l)

getBeanAttrib

public static java.lang.Object getBeanAttrib(java.lang.Object object,
                                             java.lang.String attributeName)
Gets the attribute of a Java Bean object with reflection mechanisms. The object must conform with the Sun Java Beans components model. Will invoke the getter method of the supplied attribute.

Parameters:
object - the Java Bean object.
attributeName - name of the attribute to extract from the Java Bean object.
Returns:
the attribute extracted from the Java Bean object.

parseDate

public static java.util.Date parseDate(java.lang.String date,
                                       java.lang.String format)
Parses a date stored in a string with a specific format mask.

Parameters:
date - string with the date value.
format - format mask of the string date.
Returns:
the date value.