Class JsonbCreator


  • public class JsonbCreator
    extends Object
    Object holding reference to Constructor / Method for custom object creation.
    Author:
    Roman Grigoriadi
    • Constructor Detail

      • JsonbCreator

        public JsonbCreator​(Executable executable,
                            CreatorModel[] creatorModels)
        Creates a new instance.
        Parameters:
        executable - Executable.
        creatorModels - Parameters.
    • Method Detail

      • call

        public <T> T call​(Object[] params,
                          Class<T> on)
        Create instance by either constructor or factory method, with provided parameter values and a Class to call on.
        Type Parameters:
        T - Type of class / instance
        Parameters:
        params - parameters to be passed into constructor / factory method
        on - class to call onto
        Returns:
        instance
      • contains

        public boolean contains​(String paramName)
        True if param name is one of creator params.
        Parameters:
        paramName - Param name to check.
        Returns:
        True if found.
      • findByName

        public CreatorModel findByName​(String paramName)
        Find creator parameter by name.
        Parameters:
        paramName - parameter name as it appear in json document.
        Returns:
        Creator parameter.
      • getParams

        public CreatorModel[] getParams()
        Parameters of this creator.
        Returns:
        Parameters.