Class MappingSlotExtractor
java.lang.Object
org.incenp.obofoundry.sssom.extract.MappingValueExtractor
org.incenp.obofoundry.sssom.extract.MappingSlotExtractor
- All Implemented Interfaces:
IValueExtractor
Extracts the value of a slot from a mapping object.
This is the extractor used by an expression of the form
mapping(N).slot.SLOTNAME
.
-
Field Summary
FieldsFields inherited from class org.incenp.obofoundry.sssom.extract.MappingValueExtractor
mappingNo
-
Constructor Summary
ConstructorsConstructorDescriptionMappingSlotExtractor
(int mappingNo, Slot<Mapping> slot, int itemNo) Creates a new instance. -
Method Summary
Methods inherited from class org.incenp.obofoundry.sssom.extract.MappingValueExtractor
extract
-
Field Details
-
slotExtractor
-
-
Constructor Details
-
MappingSlotExtractor
Creates a new instance.- Parameters:
mappingNo
- The 0-based index of the mapping from which to extract a value, or (if negative) the 1-based index starting from the last mapping.slot
- The mapping slot to extract.itemNo
- The 0-based index of the value to extract, or (if negative) the 1-based index starting from the last item. This is only meaningful for a multi-valued slot.
-
-
Method Details
-
extract
Description copied from class:MappingValueExtractor
Extracts the desired value from the given mapping.- Specified by:
extract
in classMappingValueExtractor
- 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.
-
getType
Description copied from interface:IValueExtractor
Gets the type of the value that would be returned byIValueExtractor.extract(MappingSet)
.- Returns:
- The actual Java class of the object representing the extracted value.
-