Module dev.metaschema.core
Package dev.metaschema.core.metapath
package dev.metaschema.core.metapath
Provides the core Metapath expression language implementation.
Metapath is an XPath 3.1-based expression language for querying and navigating Metaschema-based data models. This package provides the primary API for compiling and evaluating Metapath expressions against Metaschema content.
Key interfaces and classes:
IMetapathExpression- Main interface for compiled Metapath expressions with methods for compilation and evaluationStaticContext- XPath 3.1 static context containing namespace bindings, function resolver, and other compile-time informationDynamicContext- XPath 3.1 dynamic context containing runtime state such as focus items, variables, and current date/timeMetapathException- Base exception type for all Metapath evaluation errors
Typical usage pattern:
// Compile a Metapath expression
IMetapathExpression expr = IMetapathExpression.compile("//assembly[@name='foo']");
// Evaluate against a document node
ISequence<?> results = expr.evaluate(documentNode);
// Or evaluate with type conversion
Boolean result = expr.evaluateAs(documentNode, ResultType.BOOLEAN);
This package also contains subpackages for:
antlr- ANTLR4-based parser infrastructurecst- Concrete syntax tree expression implementationsformat- Path formatting utilitiesfunction- Metapath function libraryitem- Metapath item types (atomic values, nodes, sequences)type- Metapath type system
- See Also:
-
ClassDescriptionerr:MPDY0002: It is a dynamic error if evaluation of an expression relies on some part of the dynamic context that is absent.The implementation of a Metapath dynamic context.MPDY: Exceptions related to the Metapath dynamic context and dynamic evaluation.Represents the focus context for Metapath evaluation, containing the context item, position, and size as defined in the XPath 3.1 evaluation context.Supports loading documents referenced in Metapath expressions.Provides an error code that identifies the type of message.The common interface of all Metapath expression nodes.Supports compiling and executing Metapath expressions.Identifies the expected type for a Metapath evaluation result.An exception to be raised when a Metapath is not a valid instance of the Metapath grammar.Raised when a Metapath treat expression fails because the sequence does not match the required type.Provides constant values for use in Metapath.Provides a mechanism to configure Metapath evaluation settings.
MetapathExceptionis the superclass of all exceptions that can be thrown during the compilation and evaluation of a Metapath.An implementation of the Metapath static context.A builder used to generate the static context.MPST: Exceptions related to the Metapath static context and static evaluation.