public class GenericObjectFactory<T> extends Object implements ObjectFactory<T>
An ObjectFactory
implementation that simply uses a specific Class
to
fabricate instances. If the Class
has a constructor taking a single argument
of type HGHandle[]
than this constructor is used in a call to the
make(HGHandle [] targetSet)
method. Otherwise, if that latter version of make
is called, an exception will be thrown. Note that the implementation doesn't check whether the
Class
that it handles actually implements the HGLink
interface.
Constructor and Description |
---|
GenericObjectFactory(Class<T> type) |
Modifier and Type | Method and Description |
---|---|
Class<T> |
getType()
Return the
Class of the objects being constructed by this factory. |
T |
make()
Create a new run-time instance of the type this factory
is responsible for.
|
T |
make(HGHandle[] targetSet)
Create a new run-time
HGLink instance of the type this factory is
responsible for. |
public Class<T> getType()
ObjectFactory
Return the Class
of the objects being constructed by this factory.
getType
in interface ObjectFactory<T>
public T make()
ObjectFactory
Create a new run-time instance of the type this factory is responsible for.
make
in interface ObjectFactory<T>
public T make(HGHandle[] targetSet)
ObjectFactory
Create a new run-time HGLink
instance of the type this factory is
responsible for.
make
in interface ObjectFactory<T>
Copyright © 2015. All rights reserved.