org.eclipse.actf.util.command
Class DefaultArgumentResolver

java.lang.Object
  extended by org.eclipse.actf.util.command.DefaultArgumentResolver
All Implemented Interfaces:
IArgumentResolver

public class DefaultArgumentResolver
extends Object
implements IArgumentResolver

This default implementation resolves arguments to primitive values, instances of wrappers of primitive types, String instances, and Class instances. It will also resolve single-dimensional arrays of primitives, strings, and Class objects.

Author:
Mike Squillace

Constructor Summary
DefaultArgumentResolver()
          create a default implementation for resolving arguments to switches on the command line.
 
Method Summary
 Object resolve(String arg, Class type)
          resolve the given argument or value to the given type
protected  Object resolveArray(String arg, Class compType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultArgumentResolver

public DefaultArgumentResolver()
create a default implementation for resolving arguments to switches on the command line.

Method Detail

resolve

public Object resolve(String arg,
                      Class type)
               throws Exception
resolve the given argument or value to the given type

Specified by:
resolve in interface IArgumentResolver
Parameters:
arg - - argument or value from command line switch
type - - type to which argument is to be resolved
Returns:
result of resolving argument to class
Throws:
Exception - if argument cannot be resolved to the specified type

resolveArray

protected Object resolveArray(String arg,
                              Class compType)
                       throws Exception
Throws:
Exception