|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.webmacro.util.ComponentMap
A ComponentMap takes a list of component names and builds a Map of
instance objects. You can include a filename in a list of components
and the contents of that file will be inserted into the list. The
format of the component list is a series of name=class
entries separated by whitespace, commas, newlines, or semicolons.
If the "name=" portion is omitted then the base classname of the
component will be used as its name instead.
Here is an example:
Freddy=org.webmacro.examples.Freddy /examples/COMPONENTS Critter=com.semiotek.creature.Mongrel org.webmacro.servlet.FormToolThe above component list defines
Freddy
, implemented
by the class org.webmacro.examples.Freddy
. Also,
the contents of the file /examples/COMPONENTS
will
be read from the CLASSPTH and inserted into this component list.
The last entry in the example above is a component with no explicit
name: org.webmacro.servlet.FormTool
. The base class
name will be used as the name for this component: FormTool
.
A component must have one of the following three constructors. They will be searched for in this order:
Constructor Summary | |
ComponentMap()
Create a new ComponentMap for the supplied list of names separated on whitespace, commas, newlines, colons, and semicolons. |
|
ComponentMap(Settings initProps)
Create a new ComponentMap for the supplied list of names using the supplied Settings for initialization, if any initialization can be done. |
Method Summary | |
protected void |
add(java.lang.String component,
java.lang.String suffix)
|
java.lang.Object |
get(java.lang.Object name)
|
java.util.Iterator |
keys()
Get an iterator that walks throught he keys installed into this ComponentMap |
void |
load(java.lang.String namelist)
Load the component map from the supplied namelist. |
void |
load(java.lang.String[] namelist)
Load the component map from the supplied name list. |
void |
load(java.lang.String[] namelist,
java.lang.String suffix)
Load the component map from the supplied name list. |
void |
load(java.lang.String namelist,
java.lang.String suffix)
Load the component map from the supplied namelist. |
static void |
main(java.lang.String[] arg)
|
java.util.Iterator |
values()
Get an iterator that walkst hrough the values installed into this ComponentMap |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ComponentMap()
public ComponentMap(Settings initProps)
Method Detail |
public java.lang.Object get(java.lang.Object name)
public java.util.Iterator keys()
public java.util.Iterator values()
public void load(java.lang.String namelist)
public void load(java.lang.String namelist, java.lang.String suffix)
public void load(java.lang.String[] namelist)
public void load(java.lang.String[] namelist, java.lang.String suffix)
protected void add(java.lang.String component, java.lang.String suffix)
public static void main(java.lang.String[] arg)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |