Class MappingValueExtractor

java.lang.Object
org.incenp.obofoundry.sssom.extract.MappingValueExtractor
All Implemented Interfaces:
IValueExtractor
Direct Known Subclasses:
HashExtractor, MappingExtensionExtractor, MappingSlotExtractor, SExpressionExtractor

public abstract class MappingValueExtractor extends Object implements IValueExtractor
Base class for extractors that extract a value from a specific mapping record.

This is used by all expressions of the form mapping. or mapping(N)..

  • Field Details

    • mappingNo

      protected int mappingNo
  • Constructor Details

    • MappingValueExtractor

      protected MappingValueExtractor(int mappingNo)
      Creates a new instance.
      Parameters:
      mappingNo - If non-negative, the 0-based index of the mapping from which to extract a value. If negative, the 1-based index starting from the last mapping of the set.
  • Method Details

    • extract

      public Object extract(MappingSet ms)
      Description copied from interface: IValueExtractor
      Extracts the desired value from the given mapping set.
      Specified by:
      extract in interface IValueExtractor
      Parameters:
      ms - The mapping set from which to extract the value.
      Returns:
      The desired value, or null if the set does not contain a value at the specified location.
    • extract

      protected abstract Object extract(Mapping mapping)
      Extracts the desired value from the given mapping.
      Parameters:
      mapping - The mapping from which to extract the value.
      Returns:
      The desired value, or null if the mapping does not have a value at the specified location.