Module dev.metaschema.core
Package dev.metaschema.core.metapath.function.library
package dev.metaschema.core.metapath.function.library
Built-in Metapath function implementations based on the XPath 3.1
specification.
This package provides concrete implementations of standard XPath 3.1 functions adapted to work with the Metaschema document model. Functions that operate on an XML document model (XDM) in XPath have been adapted to work with the Metaschema module-based model instead.
Function Categories
- String Functions:
fn:string,fn:concat,fn:contains,fn:starts-with,fn:ends-with,fn:substring,fn:normalize-space,fn:upper-case,fn:lower-case,fn:tokenize - Numeric Functions:
fn:abs,fn:ceiling,fn:floor,fn:round - Sequence Functions:
fn:count,fn:empty,fn:exists,fn:head,fn:tail,fn:reverse,fn:distinct-values,fn:index-of,fn:insert-before,fn:remove - Date/Time Functions:
fn:current-date,fn:current-time,fn:current-dateTime,fn:year-from-date,fn:month-from-date,fn:day-from-date, and related component extraction functions - Boolean Functions:
fn:boolean,fn:true,fn:false,fn:not - Array Functions:
array:size,array:get,array:head,array:tail,array:reverse,array:flatten,array:join - Map Functions:
map:contains,map:get,map:keys,map:put,map:remove,map:merge - Document Functions:
fn:doc,fn:doc-available,fn:base-uri,fn:document-uri
Metaschema-Specific Extensions
This package also includes Metapath-specific functions not present in XPath 3.1:
MpRecurseDepth- Recursively evaluates a Metapath expression to a specified depthMpBase64Encode- Encodes strings to Base64MpBase64Decode- Decodes Base64 strings
Function Registration
All built-in functions are registered in
DefaultFunctionLibrary,
which is loaded via the Java ServiceLoader mechanism.
-
ClassDescriptionImplements the XPath 3.1 array:append function.Implements the XPath 3.1 array:flatten function.Implements the XPath 3.1 array:get function.Implements the XPath 3.1 array:head function.Implements the XPath 3.1 array:insert-before function.Implements the XPath 3.1 array:join function.Implements the XPath 3.1 array:put function.Implements the XPath 3.1 array:remove function.Implements the XPath 3.1 array:reverse function.Implements the XPath 3.1 array:size function.Implements the XPath 3.1 array:subarray function.Implements the XPath 3.1 array:tail function.CastFunction<ITEM extends IAnyAtomicItem>Implements the XPath 3.1 casting functions.Provides built-in Metapath functions based on the XPath 3.1 function specification.Implements the XPath 3.1 fn:abs function.Implements the XPath 3.1 fn:adjust-dateTime-to-timezone function.Implements the XPath 3.1 fn:adjust-date-to-timezone function.Implements the XPath 3.1 fn:adjust-time-to-timezone function.Implements the XPath 3.1 fn:avg function.Implements the XPath 3.1 fn:base-uri functions.Implements the XPath 3.1 fn:boolean function.Implements the XPath 3.1 fn:ceiling function.Implements the XPath 3.1 fn:compare function.Implements the XPath 3.1 fn:concat function.Implements the XPath 3.1 fn:contains function.Implements the XPath 3.1 fn:count function.Implements the XPath 3.1 fn:current-date function.Implements the XPath 3.1 fn:current-dateTime function.Implements the XPath 3.1 fn:current-time function.Implements the XPath 3.1 fn:data functions.Implements the XPath 3.1 fn:dateTime function.Implements the XPath 3.1 fn:day-from-date.Implements the XPath 3.1 fn:day-from-dateTime.Implements the XPath 3.1 fn:days-from-duration./** Implements fn:deep-equal functions.Implements the XPath 3.1 fn:default-language function.Implements fn:distinct-values functions.Implements the XPath 3.1 fn:doc function.Implements the XPath 3.1 fn:doc-available function.Implements the XPath 3.1 fn:document-uri functions.Implements the XPath 3.1 fn:empty function.Implements the XPath 3.1 fn:ends-with function.Implements the XPath 3.1 fn:exactly-one function.Implements the XPath 3.1 fn:exists function.Implements the XPath 3.1 fn:false function./** Implements fn:function-arity functions./** Implements fn:function-lookup functions./** Implements fn:function-name functions./** Implements fn:has-children functions.Implements the XPath 3.1 fn:head function.Implements the XPath 3.1 fn:hours-from-dateTime.Implements the XPath 3.1 fn:hours-from-duration.Implements the XPath 3.1 fn:hours-from-time.Implements fn:implicit-timezone./** Implements fn:index-of functions.Implements fn:innermost functions.Implements the XPath 3.1 fn:insert-before function.Implements fn:last./** Implements fn:local-name functions.Based on the XPath 3.1 fn:lower-case functions.Implements the XPath 3.1 fn:matches functions.Implements the XPath 3.1 fn:minutes-from-dateTime.Implements the XPath 3.1 fn:minutes-from-duration.Implements the XPath 3.1 fn:minutes-from-time.Implements the XPath 3.1 fn:month-from-date.Implements the XPath 3.1 fn:month-from-dateTime.Implements the XPath 3.1 fn:months-from-duration./** Implements fn:name functions./** Implements fn:namespace-uri functions.Implements the XPath 3.1 fn:normalize-space functions.Implements the XPath 3.1 fn:not function.Implements the XPath 3.1 fn:one-or-more function./** Implements fn:outermost functions.Implements the XPath 3.1 fn:path functions.Implements fn:position./** Implements fn:QName functions.Implements the XPath 3.1 fn:remove function.Implements the XPath 3.1 resolve-ur functions.Implements the XPath 3.1 fn:reverse function./** Implements fn:root functions.Implements the XPath 3.1 fn:round functions.Implements the XPath 3.1 fn:seconds-from-dateTime.Implements the XPath 3.1 fn:seconds-from-duration.Implements the XPath 3.1 fn:seconds-from-time.Implements the XPath 3.1 fn:starts-with function.Implements the XPath 3.1 fn:static-base-uri function.Implements the XPath 3.1 fn:string function.Implements the XPath 3.1 fn:string-join function.Implements the XPath 3.1 fn:string-length functions.Implements the XPath 3.1 fn:substring functions.Implements the XPath 3.1 fn:substring-after function.Implements the XPath 3.1 fn:substring-before function.Implements the XPath 3.1 fn:sum functions.Implements the XPath 3.1 fn:tail function.Implements the XPath 3.1 fn:timezone-from-date function.Implements the XPath 3.1 fn:timezone-from-dateTime function.Implements the XPath 3.1 fn:timezone-from-time function.Implements the XPath 3.1 fn:tokenize function.Implements the XPath 3.1 fn:true function.Based on the XPath 3.1 fn:upper-case functions.Implements the XPath 3.1 fn:year-from-date.Implements the XPath 3.1 fn:year-from-dateTime.Implements the XPath 3.1 fn:years-from-duration.Implements the XPath 3.1 fn:zero-or-one function.Implements the XPath 3.1 map:contains function.Implements the XPath 3.1 map:entry function.Implements the XPath 3.1 map:find function.Implements the XPath 3.1 map:for-each function.Implements the XPath 3.1 map:get function.Implements the XPath 3.1 map:keys function.Implements the XPath 3.1 map:merge functions.Implements the XPath 3.1 map:put function.Implements the XPath 3.1 map:remove function.Implements the XPath 3.1 map:size function.Provides a new Metapath function that decodes provided encoded text using base64.Provides a new Metapath function that encodes provided text using base64.Provides new Metapath functions that evaluate a Metapath recursively over sequences generated by evaluating that expression.Provides a generic implementation of methods defined by XPath 3.1 Functions on numeric values.Implementations of this interface are used to execute a numeric opertaion on the provided item.