Interface ExtractorBuilder

All Known Implementing Classes:
ChainedExtractorBuilder, ReflectionExtractorBuilder, UniversalExtractorBuilder

public interface ExtractorBuilder
ExtractorBuilders provide a mechanism to construct a ValueExtractor for a provided cache name, target and property chain (realize(String, int, String)).

To determine the appropriate ValueExtractor implementations may need to decipher cache type information, which should be discernible from the provided cache name and nTarget (KEY or VALUE). The property chain (sProperties) represents a chain of calls from the root type (key or value) down the type hierarchy.

Implementations may be able to optimize the ValueExtractors used by CohQL by providing a mapping of a logical property name to a ValueExtractor that can optimally (without deserializing the entire key or value) extract the relevant property. For example, an implementation able to map properties to POF indices could convert a property chain to a POF path. Assuming a Person object is the value stored in a cache the table below illustrates possible implementations:

Implementation Examples
Property Chain Unoptimized Optimized
value().address.homeTel.areaCode ChainedExtractor(ReflectionExtractor(getAddress), ReflectionExtractor(getHomeTel), ReflectionExtractor(getAreaCode)) PofExtractor(PofNavigator(2, 5, 7))
Since:
Coherence 12.2.1
Author:
jk 2014.07.10
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    realize(String sCacheName, int nTarget, String sProperties)
    Create a ValueExtractor for the given cache name, target and property chain.
  • Method Details

    • realize

      ValueExtractor realize(String sCacheName, int nTarget, String sProperties)
      Create a ValueExtractor for the given cache name, target and property chain.
      Parameters:
      sCacheName - the name of the cache the ValueExtractor will be invoked against
      nTarget - the target for the ValueExtractor
      sProperties - the path to the property value to extract
      Returns:
      a ValueExtractor for the given cache name, target and properties