jklustor-all-api-0.0.7-20140619012755 (ChemAxon)

Class CreatorWrapper<T>

  extended by com.chemaxon.apidiscovery.CreatorWrapper<T>
Type Parameters:
T - Type of the created instance

public class CreatorWrapper<T>
extends Object

CreatorWrapper acts as a type- and instance -dependent service loader.

A creator method simply creates an instance of a type from an instance of a parameter type. (Consider here the Descriptors API createXXXComparator methods.) When the parameter type has free parameters it should be implemented as an immutable parameter object - builder class pair. This wrapper usually wraps a default instance of such immutable parameter objects; however it returns an associated builder to change.

Please note that this class is marked with Beta annotation, so it can be subject of incompatible changes or removal in later releases.

Gabor Imre

Constructor Summary
CreatorWrapper(Object creatorHost, Method creatorMethod, Object initialParameter)
          Construct a wrapper.
Method Summary
 T create()
          Invoke creator method.
 Object getBuilderOrParameterObject()
          Get the parameter object or its mutable builder if exists.
 String getDescription()
 String getName()
(package private)  int getOrder()
          Order stored in creator annotation.
 String getShortName()
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


CreatorWrapper(Object creatorHost,
               Method creatorMethod,
               Object initialParameter)
Construct a wrapper.

creatorHost - Object on which a represented creator method will be called
creatorMethod - The creator method which should be called
initialParameter - The parameter reference which can be passed to the creator method
IllegalArgumentException - when a builder or parametrized object is passed as initialParameter
Method Detail


int getOrder()
Order stored in creator annotation.

order from creator annotation


public Object getBuilderOrParameterObject()
Get the parameter object or its mutable builder if exists.

If the returned object is mutable then its state will be considered upon creation

The wrapped parameter object or its builder when exists.


public String getShortName()


public String getName()


public String getDescription()


public T create()
Invoke creator method.

Use builder if exists, otherwise initial

The created instance

jklustor-all-api-0.0.7-20140619012755 (ChemAxon)