The ClassInstantiator is used for instantiating
objects using either the default no argument constructor or one
that takes deserialized values as parameters. This also exposes
the parameters and constructors used to instantiate the object.
Constructor for the ClassCreator object. This is
used to create an object that contains all information that
relates to the construction of an instance.
Parameters:
creators - contains the list of all constructors available
primary - this is the default no argument constructor
registry - contains all parameters for the constructors
detail - contains the details for the instantiated class
Method Details
isDefault
publicbooleanisDefault()
This is used to determine if this Creator has a
default constructor. If the class does contain a no argument
constructor then this will return true.
This is used to instantiate the object using the default no
argument constructor. If for some reason the object can not be
instantiated then this will throw an exception with the reason.
This is used to instantiate the object using a constructor that
takes deserialized objects as arguments. The object that have
been deserialized can be taken from the Criteria
object which contains the deserialized values.
This is used to acquire an Instantiator which is used
to instantiate the object. If there is no match for the instantiator
then the default constructor is provided.
Parameters:
criteria - this contains the criteria to be used for this
Returns:
this returns the instantiator that has been matched
This is used to acquire the named Parameter from
the creator. A parameter is taken from the constructor which
contains annotations for each object that is required. These
parameters must have a matching field or method.
This is used to acquire all parameters annotated for the class
schema. Providing all parameters ensures that they can be
validated against the annotated methods and fields to ensure
that each parameter is valid and has a corresponding match.
This is used to acquire all of the Instantiator
objects used to create an instance of the object. Each represents
a constructor and contains the parameters to the constructor.
This is primarily used to validate each constructor against the
fields and methods annotated to ensure they are compatible.
This is used to acquire a description of the creator. This is
useful when debugging an issue as it allows a representation
of the instance to be viewed with the class it represents.