Class AbstractCacheFactory

java.lang.Object
org.htmlunit.corejs.javascript.lc.type.impl.factory.AbstractCacheFactory
All Implemented Interfaces:
Serializable, FactoryBase, TypeInfoFactory
Direct Known Subclasses:
ClassValueCacheFactory, LegacyCacheFactory

public abstract class AbstractCacheFactory extends Object implements FactoryBase
TypeInfoFactory implementation with cache. The exact characteristic if the factory depends on the characteristic of map backend created via initCache()

This factory is serializable, but none of its cached objects will be serialized.

Author:
ZZZank
See Also:
  • Constructor Details

    • AbstractCacheFactory

      public AbstractCacheFactory()
  • Method Details

    • initCache

      protected void initCache()
    • create

      public TypeInfo create(TypeVariable<?> typeVariable)
      Specified by:
      create in interface TypeInfoFactory
    • getConsolidationMapping

      public Map<VariableTypeInfo,TypeInfo> getConsolidationMapping(Class<?> from)
      Description copied from interface: TypeInfoFactory
      Get consolidation mapping from the input class.

      Example (for factory implemented by Rhino):

       class A<Ta> {}
       class B<Tb> extends A<Tb> {}
      
       interface C<Tc> {}
       interface D<Td> extends C<Td> {}
      
       class E<Te> extends B<Te> implements D<String> {}
       
      and input class is E.class. The result mapping will then be: Ta -> Te, Tb -> Te, Tc -> String, Td -> String
      Specified by:
      getConsolidationMapping in interface TypeInfoFactory
      See Also:
    • createCache

      <K, V> Map<K,V> createCache()