Class Scope


  • public class Scope
    extends java.lang.Object
    • Constructor Detail

      • Scope

        public Scope​(java.net.URI documentUri,
                     SchemaVersion version)
      • Scope

        public Scope​(java.net.URI documentUri,
                     @Nullable java.net.URI id,
                     SchemaVersion version)
    • Method Detail

      • empty

        public static Scope empty()
      • createScope

        public static Scope createScope​(java.net.URI documentUri,
                                        java.lang.Object document,
                                        SchemaVersion fallback)
        create the scope for the document. If document contains an id, it is the base uri, otherwise the scope is the documentUri. If the documentUri matches a know json schema the result scope will use its version, otherwise it will use the fallback version.
        Parameters:
        documentUri - uri of the document
        document - source document
        fallback - fallback json schema version
        Returns:
        the scope of the document
      • createScope

        public static Scope createScope​(java.net.URI documentUri,
                                        java.lang.Object document,
                                        Scope currentScope)
        create the scope for the document. If document contains an id, it is the base uri, otherwise the scope is the documentUri. If the documentUri matches a know json schema the result scope will use its version, otherwise it will use the fallback version.
        Parameters:
        documentUri - uri of the document
        document - source document
        currentScope - the current scope
        Returns:
        the scope of the document
      • createScope

        public static Scope createScope​(java.net.URI documentUri)
      • getDocumentUri

        public java.net.URI getDocumentUri()
      • getBaseUri

        public java.net.URI getBaseUri()
      • resolve

        public Scope resolve​(java.lang.String id)
      • resolve

        public Scope resolve​(java.net.URI id)
      • resolveAnchor

        public java.net.URI resolveAnchor​(java.lang.String anchor)
      • move

        public Scope move​(java.net.URI documentUri,
                          java.lang.Object document)
      • move

        public Scope move​(java.lang.Object document)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object