Class MappingSetSlotExtractor

  • All Implemented Interfaces:
    IValueExtractor

    public class MappingSetSlotExtractor
    extends Object
    implements IValueExtractor
    Extracts the value of a slot from a mapping set object.

    This is the extractor used by an expression of the form set.slot.SLOTNAME.

    • Constructor Detail

      • MappingSetSlotExtractor

        public MappingSetSlotExtractor​(Slot<MappingSet> slot,
                                       int itemNo)
        Creates a new instance.
        Parameters:
        slot - The mapping set slot to extract.
        itemNo - The 0-based index of the value to extract. This is only meaningful if slot represents a multi-valued slot. A negative value is interpreted as an 1-based index starting from the last item.
    • Method Detail

      • 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.