Class CircularClassReferenceConverterFactory

  • All Implemented Interfaces:
    Factory<Converter<?>>

    public class CircularClassReferenceConverterFactory
    extends ChainedFactory
    ChainedFactory that handles circular class references.
    Author:
    Eugen Cepoi
    • Constructor Detail

      • CircularClassReferenceConverterFactory

        public CircularClassReferenceConverterFactory()
    • Method Detail

      • create

        public Converter<?> create​(Type type,
                                   Genson genson)
        Description copied from interface: Factory
        Implementations of this method must try to create an instance of type T based on the parameter "type". If this factory can not create an object of type T for parameter type then it must return null.
        Specified by:
        create in interface Factory<Converter<?>>
        Overrides:
        create in class ChainedFactory
        Parameters:
        type - used to build an instance of T.
        Returns:
        null if it doesn't support this type or an instance of T (or a subclass).
      • create

        protected Converter<?> create​(Type type,
                                      Genson genson,
                                      Converter<?> nextConverter)
        Description copied from class: ChainedFactory
        This method will be called by ChainedFactory.create(Type, Genson) with nextConverter being the converter created for current type by the next factory. This means that ChainedFactory will first create a converter with the next factory and then use it's own create method.
        Specified by:
        create in class ChainedFactory
        Parameters:
        type - for which this factory must provide a converter
        genson - instance that you can use when you need a converter for some other type (for example a converter of List<Integer> will need a converter for Integer type).
        nextConverter - created by the next factory, may be null.
        Returns:
        null or a converter for this type