Package org.picocontainer.containers
Class CommandLinePicoContainer
- java.lang.Object
-
- org.picocontainer.containers.AbstractDelegatingPicoContainer
-
- org.picocontainer.containers.CommandLinePicoContainer
-
- All Implemented Interfaces:
java.io.Serializable
,Converting
,PicoContainer
- Direct Known Subclasses:
CommandLineArgumentsPicoContainer
public class CommandLinePicoContainer extends AbstractDelegatingPicoContainer
CommandLineArgumentsPicoContainer configured itself from array of strings which are most likely coming in as command line arguments- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CommandLinePicoContainer(java.lang.String[] arguments)
CommandLinePicoContainer(java.lang.String[] arguments, PicoContainer parent)
CommandLinePicoContainer(java.lang.String separator, java.io.StringReader argumentsProps)
CommandLinePicoContainer(java.lang.String separator, java.io.StringReader argumentProperties, java.lang.String[] arguments)
CommandLinePicoContainer(java.lang.String separator, java.io.StringReader argumentProperties, java.lang.String[] arguments, PicoContainer parent)
CommandLinePicoContainer(java.lang.String separator, java.lang.String[] arguments)
CommandLinePicoContainer(java.lang.String separator, java.lang.String[] arguments, PicoContainer parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
getComponent(java.lang.Class<T> componentType)
Retrieve a component keyed by the component type.<T> java.util.List<ComponentAdapter<T>>
getComponentAdapters(java.lang.Class<T> componentType)
Retrieve all component adapters inside this container that are associated with the specified type.MutablePicoContainer
getDelegate()
PicoContainer
getParent()
Retrieve the parent container of this container.void
setName(java.lang.String s)
java.lang.String
toString()
-
Methods inherited from class org.picocontainer.containers.AbstractDelegatingPicoContainer
accept, equals, getComponent, getComponent, getComponent, getComponentAdapter, getComponentAdapter, getComponentAdapter, getComponentAdapters, getComponentAdapters, getComponents, getComponents, getConverters
-
-
-
-
Constructor Detail
-
CommandLinePicoContainer
public CommandLinePicoContainer(java.lang.String separator, java.lang.String[] arguments)
-
CommandLinePicoContainer
public CommandLinePicoContainer(java.lang.String separator, java.lang.String[] arguments, PicoContainer parent)
-
CommandLinePicoContainer
public CommandLinePicoContainer(java.lang.String separator, java.io.StringReader argumentsProps) throws java.io.IOException
- Throws:
java.io.IOException
-
CommandLinePicoContainer
public CommandLinePicoContainer(java.lang.String separator, java.io.StringReader argumentProperties, java.lang.String[] arguments) throws java.io.IOException
- Throws:
java.io.IOException
-
CommandLinePicoContainer
public CommandLinePicoContainer(java.lang.String separator, java.io.StringReader argumentProperties, java.lang.String[] arguments, PicoContainer parent) throws java.io.IOException
- Throws:
java.io.IOException
-
CommandLinePicoContainer
public CommandLinePicoContainer(java.lang.String[] arguments)
-
CommandLinePicoContainer
public CommandLinePicoContainer(java.lang.String[] arguments, PicoContainer parent)
-
-
Method Detail
-
getComponent
public <T> T getComponent(java.lang.Class<T> componentType)
Description copied from interface:PicoContainer
Retrieve a component keyed by the component type.- Specified by:
getComponent
in interfacePicoContainer
- Overrides:
getComponent
in classAbstractDelegatingPicoContainer
- Parameters:
componentType
- the type of the component- Returns:
- the typed resulting object instance or null if the object does not exist.
-
getComponentAdapters
public <T> java.util.List<ComponentAdapter<T>> getComponentAdapters(java.lang.Class<T> componentType)
Description copied from interface:PicoContainer
Retrieve all component adapters inside this container that are associated with the specified type. The addComponent adapters from the parent container are not returned.- Specified by:
getComponentAdapters
in interfacePicoContainer
- Overrides:
getComponentAdapters
in classAbstractDelegatingPicoContainer
- Parameters:
componentType
- the type of the components.- Returns:
- a collection containing all the
ComponentAdapter
s inside this container that are associated with the specified type. Changes to this collection will not be reflected in the container itself.
-
getParent
public PicoContainer getParent()
Description copied from interface:PicoContainer
Retrieve the parent container of this container.- Specified by:
getParent
in interfacePicoContainer
- Overrides:
getParent
in classAbstractDelegatingPicoContainer
- Returns:
- a
PicoContainer
instance, ornull
if this container does not have a parent.
-
getDelegate
public MutablePicoContainer getDelegate()
- Overrides:
getDelegate
in classAbstractDelegatingPicoContainer
-
setName
public void setName(java.lang.String s)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classAbstractDelegatingPicoContainer
-
-