public class ComponentFactory
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ClassNameProperty
A property to use for the class name of new objects - "class".
|
static java.lang.String |
DotClassNameProperty
The property to use for the class name of new objects - ".class".
|
static java.util.logging.Logger |
logger |
Modifier | Constructor and Description |
---|---|
protected |
ComponentFactory() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
_create(java.lang.String className,
java.lang.Object[] constructorArgs,
java.lang.Class<?>[] argClasses,
java.lang.String prefix,
java.util.Properties properties)
Create a single object.
|
protected java.util.Vector<?> |
_create(java.util.Vector<java.lang.String> markerNames,
java.lang.String prefix,
java.util.Properties properties,
ProgressSupport progressSupport,
boolean matchInOutVectorSize)
Given a Vector of marker name Strings, and a Properties object, look in
the Properties object for the markerName.class property to get a class
name to create each object.
|
static java.lang.Object |
create(java.lang.String className)
Create a single object.
|
static java.lang.Object |
create(java.lang.String className,
java.lang.Object[] constructorArgs)
Create a single object.
|
static java.lang.Object |
create(java.lang.String className,
java.lang.Object[] constructorArgs,
java.lang.Class<?>[] argClasses)
Create a single object.
|
static java.lang.Object |
create(java.lang.String className,
java.lang.Object[] constructorArgs,
java.lang.Class<?>[] argClasses,
java.lang.String prefix,
java.util.Properties properties)
Create a single object.
|
static java.lang.Object |
create(java.lang.String className,
java.lang.Object[] constructorArgs,
java.lang.String prefix,
java.util.Properties properties)
Create a single object.
|
static java.lang.Object |
create(java.lang.String className,
java.util.Properties properties)
Create a single object.
|
static java.lang.Object |
create(java.lang.String className,
java.lang.String prefix,
java.util.Properties properties)
Create a single object.
|
static java.util.Vector<?> |
create(java.util.Vector<java.lang.String> markerNames,
java.util.Properties properties)
Given a Vector of marker name Strings, and a Properties object, look in
the Properties object for the markerName.class property to get a class
name to create each object.
|
static java.util.Vector<?> |
create(java.util.Vector<java.lang.String> markerNames,
java.util.Properties properties,
ProgressSupport progressSupport)
Given a Vector of marker name Strings, and a Properties object, look in
the Properties object for the markerName.class property to get a class
name to create each object.
|
static java.util.Vector<?> |
create(java.util.Vector<java.lang.String> markerNames,
java.util.Properties properties,
ProgressSupport progressSupport,
boolean matchInOutVectorSize)
Given a Vector of marker name Strings, and a Properties object, look in
the Properties object for the markerName.class property to get a class
name to create each object.
|
static java.util.Vector<?> |
create(java.util.Vector<java.lang.String> markerNames,
java.lang.String prefix,
java.util.Properties properties)
Given a Vector of marker name Strings, and a Properties object, look in
the Properties object for the markerName.class property to get a class
name to create each object.
|
static java.util.Vector<?> |
create(java.util.Vector<java.lang.String> markerNames,
java.lang.String prefix,
java.util.Properties properties,
ProgressSupport progressSupport)
Given a Vector of marker name Strings, and a Properties object, look in
the Properties object for the markerName.class property to get a class
name to create each object.
|
static java.util.Vector<?> |
create(java.util.Vector<java.lang.String> markerNames,
java.lang.String prefix,
java.util.Properties properties,
ProgressSupport progressSupport,
boolean matchInOutVectorSize)
Given a Vector of marker name Strings, and a Properties object, look in
the Properties object for the markerName.class property to get a class
name to create each object.
|
protected java.lang.Object |
createWithSubclassConstructorArgs(java.lang.Class<?> newObjClass,
java.lang.Class<?>[] argClasses,
java.lang.Object[] constructorArgs)
Method to create Object with arguments.
|
protected static ComponentFactory |
getInstance()
Method call to retrieve the singleton instance of the ComponentFactory.
|
protected static void |
setInstance(ComponentFactory cf)
Set the singleton instance of the ComponentFactory.
|
public static java.util.logging.Logger logger
public static final java.lang.String DotClassNameProperty
public static final java.lang.String ClassNameProperty
protected static ComponentFactory getInstance()
protected static void setInstance(ComponentFactory cf)
cf
- public static java.util.Vector<?> create(java.util.Vector<java.lang.String> markerNames, java.util.Properties properties)
markerNames
- String of space separated marker names.properties
- Properties object containing the details.public static java.util.Vector<?> create(java.util.Vector<java.lang.String> markerNames, java.lang.String prefix, java.util.Properties properties)
markerNames
- String of space separated marker names.prefix
- The prefix that should be prepended to the marker names.properties
- Properties object containing the details.public static java.util.Vector<?> create(java.util.Vector<java.lang.String> markerNames, java.lang.String prefix, java.util.Properties properties, ProgressSupport progressSupport)
markerNames
- String of space separated marker names.prefix
- The prefix that should be prepended to the marker names.properties
- Properties object containing the details.progressSupport
- ProgressSupport object to provide progress updates
to. It's OK if this is null to not have progress events sent.public static java.util.Vector<?> create(java.util.Vector<java.lang.String> markerNames, java.util.Properties properties, ProgressSupport progressSupport)
markerNames
- String of space separated marker names.properties
- Properties object containing the details.progressSupport
- ProgressSupport object to provide progress updates
to. It's OK if this is null to not have progress events sent.public static java.util.Vector<?> create(java.util.Vector<java.lang.String> markerNames, java.util.Properties properties, ProgressSupport progressSupport, boolean matchInOutVectorSize)
markerNames
- String of space separated marker names.properties
- Properties object containing the details.progressSupport
- ProgressSupport object to provide progress updates
to. It's OK if this is null to not have progress events sent.matchInOutVectorSize
- if true, then if there is any trouble
creating an object, it's marker name will be placed in the
returned vector instead of a component. If false, only valid
objects will be returned in the vector.public static java.util.Vector<?> create(java.util.Vector<java.lang.String> markerNames, java.lang.String prefix, java.util.Properties properties, ProgressSupport progressSupport, boolean matchInOutVectorSize)
markerNames
- String of space separated marker names.prefix
- The prefix that should be prepended to the marker names.properties
- Properties object containing the details.progressSupport
- ProgressSupport object to provide progress updates
to. It's OK if this is null to not have progress events sent.matchInOutVectorSize
- if true, then if there is any trouble
creating an object, it's marker name will be placed in the
returned vector instead of a component. If false, only valid
objects will be returned in the vector.protected java.util.Vector<?> _create(java.util.Vector<java.lang.String> markerNames, java.lang.String prefix, java.util.Properties properties, ProgressSupport progressSupport, boolean matchInOutVectorSize)
markerNames
- String of space separated marker names.prefix
- The prefix that should be prepended to the marker names.properties
- Properties object containing the details.progressSupport
- ProgressSupport object to provide progress updates
to. It's OK if this is null to not have progress events sent.matchInOutVectorSize
- if true, then if there is any trouble
creating an object, it's marker name will be placed in the
returned vector instead of a component. If false, only valid
objects will be returned in the vector.public static java.lang.Object create(java.lang.String className)
className
- Class name to instantiate, empty constructor.public static java.lang.Object create(java.lang.String className, java.util.Properties properties)
className
- Class name to instantiate.properties
- Properties to use to initialize the object, if the
object is a PropertyConsumer.public static java.lang.Object create(java.lang.String className, java.lang.String prefix, java.util.Properties properties)
className
- Class name to instantiate.prefix
- Properties prefix to use by the object to scope its
properties.properties
- Properties to use to initialize the object, if the
object is a PropertyConsumer.public static java.lang.Object create(java.lang.String className, java.lang.Object[] constructorArgs)
className
- Class name to instantiate.constructorArgs
- an Object array of arguments to use in the
constructor of the component.public static java.lang.Object create(java.lang.String className, java.lang.Object[] constructorArgs, java.lang.Class<?>[] argClasses)
className
- Class name to instantiate.constructorArgs
- an Object array of arguments to use in the
constructor of the component.argClasses
- an array of classes to use to scope which constructor
to use. If null, then an array will be built from the
constructorArgs.public static java.lang.Object create(java.lang.String className, java.lang.Object[] constructorArgs, java.lang.String prefix, java.util.Properties properties)
className
- Class name to instantiate.constructorArgs
- an Object array of arguments to use in the
constructor of the component.prefix
- Properties prefix to use by the object to scope its
properties.properties
- Properties to use to initialize the object, if the
object is a PropertyConsumer.public static java.lang.Object create(java.lang.String className, java.lang.Object[] constructorArgs, java.lang.Class<?>[] argClasses, java.lang.String prefix, java.util.Properties properties)
className
- Class name to instantiate.constructorArgs
- an Object array of arguments to use in the
constructor of the component.argClasses
- an array of classes to use to scope which constructor
to use. If null, then an array will be built from the
constructorArgs.prefix
- Properties prefix to use by the object to scope its
properties.properties
- Properties to use to initialize the object, if the
object is a PropertyConsumer.protected java.lang.Object _create(java.lang.String className, java.lang.Object[] constructorArgs, java.lang.Class<?>[] argClasses, java.lang.String prefix, java.util.Properties properties)
className
- Class name to instantiate.constructorArgs
- an Object array of arguments to use in the
constructor of the component.argClasses
- an array of classes to use to scope which constructor
to use. If null, then an array will be built from the
constructorArgs.prefix
- Properties prefix to use by the object to scope its
properties.properties
- Properties to use to initialize the object, if the
object is a PropertyConsumer.protected java.lang.Object createWithSubclassConstructorArgs(java.lang.Class<?> newObjClass, java.lang.Class<?>[] argClasses, java.lang.Object[] constructorArgs) throws java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.IllegalArgumentException, java.lang.reflect.InvocationTargetException
newObjClass
- the Class to be created.argClasses
- an array of Classes describing the arguments.constructorArgs
- an array of Objects for arguments.java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
java.lang.reflect.InvocationTargetException
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details