Package dev.metaschema.core.metapath.item.function
This package implements the XPath 3.1 function item types, including arrays and maps. These are first-class values in Metapath that can be passed as arguments, returned from functions, and stored in sequences.
Array Items
Arrays are ordered collections of values, where each value is a sequence.
IArrayItem- The main interface for array items, implementingList
Arrays are immutable once created and support operations like getting members by position (1-indexed), determining size, and conversion to sequences. Factory methods are provided for creating arrays with various numbers of members.
Map Items
Maps are unordered collections of key-value pairs, where keys must be atomic items and values are sequences.
IMapItem- The main interface for map items, implementingMapIMapKey- The key type used in maps, wrapping atomic items with proper equality semanticsIKeySpecifier- Interface for computing map keys from items
Maps are immutable once created and support operations like getting values by key, determining size, and merging maps. Factory methods are provided for creating maps with various numbers of entries.
Map Key Types
Different atomic types use different equality semantics for map keys:
IStringMapKey- Keys for string-based types (string, anyURI)IDecimalMapKey- Keys for numeric types (decimal, integer, float, double)ITemporalMapKey- Keys for date/time types (date, dateTime, time)ICalendarMapKey- Keys for calendar-based typesIOpaqueMapKey- Keys for types with identity-based equality (boolean, QName, etc.)
Exceptions
IndexOutOfBoundsArrayMetapathException- Thrown when accessing an array with an out-of-bounds indexNegativeLengthArrayMetapathException- Thrown when attempting to create an array with a negative length
- See Also:
-
ClassDescriptionIArrayItem<ITEM extends ICollectionValue>A representation of a Metapath array item type.An
IMapItemkey based on anICalendarTemporalItem.AnIMapItemkey based on anIDecimalItem.A common interface for all key specifier implementations.IMapItem<VALUE extends ICollectionValue>Represents a mapping ofIMapKeykeys to values.The key value used in anIMapItem.err:FOAY0001: This error is raised when an integer used to select a member of an array is outside the range of values for that array.Represents a map key with no special handling based on the key value's data type.AnIMapItemkey based on a text value.AnIMapItemkey based on anITemporalItemvalue.err:FOAY0001: This error is raised when an integer used to select a member of an array is outside the range of values for that array.