java.lang.Object
dev.metaschema.core.metapath.format.JsonPointerFormatter
- All Implemented Interfaces:
IPathFormatter
An
IPathFormatter that produces RFC 6901 compliant JSON Pointer
paths.
This formatter produces paths suitable for use with JSON tooling and JSON-based error reporting. The format follows the JSON Pointer specification (RFC 6901).
Example output: /catalog/controls/0/id
Key characteristics:
- Uses JSON property names (not XML element names)
- Uses 0-based array indices for LIST grouping
- Uses key values for KEYED grouping
- Handles SINGLETON_OR_LIST by checking sibling count
- Escapes special characters per RFC 6901 (~ as ~0, / as ~1)
- No @ prefix for flags (unlike XPath)
- See Also:
-
Field Summary
Fields inherited from interface dev.metaschema.core.metapath.format.IPathFormatter
JSON_POINTER_PATH_FORMATTER, METAPATH_PATH_FORMATER, XPATH_PATH_FORMATTER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis visitor callback is used to format an individual grouped assembly path segment.formatAssembly(IAssemblyNodeItem assembly) This visitor callback is used to format an individual assembly path segment.formatDocument(IDocumentNodeItem document) This visitor callback is used to format an individual document path segment.formatField(IFieldNodeItem field) This visitor callback is used to format an individual field path segment.formatFlag(IFlagNodeItem flag) This visitor callback is used to format an individual flag path segment.formatMetaschema(IModuleNodeItem metaschema) This visitor callback is used to format an individual metaschema path segment.This visitor callback is used to format a root assembly path segment.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.metaschema.core.metapath.format.IPathFormatter
format
-
Constructor Details
-
JsonPointerFormatter
public JsonPointerFormatter()
-
-
Method Details
-
formatMetaschema
Description copied from interface:IPathFormatterThis visitor callback is used to format an individual metaschema path segment.- Specified by:
formatMetaschemain interfaceIPathFormatter- Parameters:
metaschema- the node to format- Returns:
- the formatted text for the segment
-
formatDocument
Description copied from interface:IPathFormatterThis visitor callback is used to format an individual document path segment.- Specified by:
formatDocumentin interfaceIPathFormatter- Parameters:
document- the node to format- Returns:
- the formatted text for the segment
-
formatRootAssembly
Description copied from interface:IPathFormatterThis visitor callback is used to format a root assembly path segment.- Specified by:
formatRootAssemblyin interfaceIPathFormatter- Parameters:
root- the node to format- Returns:
- the formatted text for the segment
-
formatAssembly
Description copied from interface:IPathFormatterThis visitor callback is used to format an individual assembly path segment.- Specified by:
formatAssemblyin interfaceIPathFormatter- Parameters:
assembly- the node to format- Returns:
- the formatted text for the segment
-
formatAssembly
Description copied from interface:IPathFormatterThis visitor callback is used to format an individual grouped assembly path segment.- Specified by:
formatAssemblyin interfaceIPathFormatter- Parameters:
assembly- the node to format- Returns:
- the formatted text for the segment
-
formatField
Description copied from interface:IPathFormatterThis visitor callback is used to format an individual field path segment.- Specified by:
formatFieldin interfaceIPathFormatter- Parameters:
field- the node to format- Returns:
- the formatted text for the segment
-
formatFlag
Description copied from interface:IPathFormatterThis visitor callback is used to format an individual flag path segment.- Specified by:
formatFlagin interfaceIPathFormatter- Parameters:
flag- the node to format- Returns:
- the formatted text for the segment
-