Class WithCacheFactory

java.lang.Object
org.mozilla.javascript.lc.type.impl.factory.WithCacheFactory
All Implemented Interfaces:
Serializable, FactoryBase, TypeInfoFactory
Direct Known Subclasses:
ConcurrentFactory, WeakReferenceFactory

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

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

See Also:
  • Constructor Details

    • WithCacheFactory

      public WithCacheFactory()
  • Method Details

    • createTypeCache

      protected abstract <K, V> Map<K,V> createTypeCache()
    • createConsolidationMappingCache

      protected abstract <K, V> Map<K,V> createConsolidationMappingCache()
    • create

      public TypeInfo create(Class<?> clazz)
      Specified by:
      create in interface TypeInfoFactory
    • 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: