org.objectledge.pico
Class StringParameter

java.lang.Object
  extended by org.objectledge.pico.StringParameter
All Implemented Interfaces:
org.picocontainer.Parameter

public class StringParameter
extends Object
implements org.picocontainer.Parameter

A parameter that is intialized with a string, and is converted to the desired type on demand.

Created on Jan 8, 2004

Version:
$Id: StringParameter.java,v 1.4 2005/02/04 02:28:13 rafal Exp $
Author:
rafal@caltha.pl

Field Summary
private  Class parameterType
          the parmeter class
private  String stringValue
          the string representation of the value
 
Constructor Summary
StringParameter(String stringValue)
          Creates a new StringParamter instance.
StringParameter(String stringValue, Class parameterType)
          Creates a new StringParamter instance.
 
Method Summary
 void accept(org.picocontainer.PicoVisitor visitor)
          
private  boolean checkPrimitive(Class expectedType)
           
 boolean isResolvable(org.picocontainer.PicoContainer container, org.picocontainer.ComponentAdapter adapter, Class expectedType)
          
 Object resolveInstance(org.picocontainer.PicoContainer container, org.picocontainer.ComponentAdapter adapter, Class expectedType)
          
 void verify(org.picocontainer.PicoContainer container, org.picocontainer.ComponentAdapter adapter, Class expectedType)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stringValue

private String stringValue
the string representation of the value


parameterType

private Class parameterType
the parmeter class

Constructor Detail

StringParameter

public StringParameter(String stringValue,
                       Class parameterType)
Creates a new StringParamter instance.

Parameters:
stringValue - the textual value of the component.
parameterType - the class of the parameter, or null to determine dynamically.

StringParameter

public StringParameter(String stringValue)
Creates a new StringParamter instance.

Parameters:
stringValue - the textual value of the component.
Method Detail

resolveInstance

public Object resolveInstance(org.picocontainer.PicoContainer container,
                              org.picocontainer.ComponentAdapter adapter,
                              Class expectedType)
                       throws org.picocontainer.PicoInitializationException

Specified by:
resolveInstance in interface org.picocontainer.Parameter
Throws:
org.picocontainer.PicoInitializationException

isResolvable

public boolean isResolvable(org.picocontainer.PicoContainer container,
                            org.picocontainer.ComponentAdapter adapter,
                            Class expectedType)

Specified by:
isResolvable in interface org.picocontainer.Parameter

verify

public void verify(org.picocontainer.PicoContainer container,
                   org.picocontainer.ComponentAdapter adapter,
                   Class expectedType)
            throws org.picocontainer.PicoIntrospectionException

Specified by:
verify in interface org.picocontainer.Parameter
Throws:
org.picocontainer.PicoIntrospectionException

checkPrimitive

private boolean checkPrimitive(Class expectedType)

accept

public void accept(org.picocontainer.PicoVisitor visitor)

Specified by:
accept in interface org.picocontainer.Parameter


Copyright © 2003-2006 objectledge.org. All Rights Reserved.