Class Ref


  • public class Ref
    extends java.lang.Object
    $ref support.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String START_OF_POINTER  
    • Constructor Summary

      Constructors 
      Constructor Description
      Ref​(Scope scope)
      create empty ref with scope.
      Ref​(Scope scope, java.lang.String ref)
      create ref with scope.
      Ref​(Scope scope, java.net.URI ref)
      create ref with scope.
    • Field Detail

      • START_OF_POINTER

        public static final java.lang.String START_OF_POINTER
        See Also:
        Constant Field Values
    • Constructor Detail

      • Ref

        public Ref​(Scope scope,
                   java.lang.String ref)
        create ref with scope.
        Parameters:
        scope - scope
        ref - the ref
      • Ref

        public Ref​(Scope scope,
                   java.net.URI ref)
        create ref with scope.
        Parameters:
        scope - scope
        ref - the ref uri
      • Ref

        public Ref​(Scope scope)
        create empty ref with scope.
        Parameters:
        scope - scope
    • Method Detail

      • hasPointer

        public boolean hasPointer()
        checks if the ref has a json pointer.
        Returns:
        true if ref has a json pointer
      • getPointer

        public java.lang.String getPointer()
        get the json pointer.
        Returns:
        json pointer
      • hasDocument

        public boolean hasDocument()
        checks if the ref has a document.
        Returns:
        true if ref has a document, else false
      • getDocumentUri

        public java.net.URI getDocumentUri()
        get the document uri of this ref. It resolves the ref on the scope and strips the fragment.
        Returns:
        the document uri of this ref
      • getScope

        public Scope getScope()
        get the scope of the ref.
        Returns:
        scope
      • getBaseUri

        public java.net.URI getBaseUri()
        get the base uri of the ref.
        Returns:
        base uri
      • getRef

        public java.lang.String getRef()
        get the original ref value.
        Returns:
        the ref
      • getRefUri

        public java.net.URI getRefUri()
      • getAbsoluteRef

        public java.lang.String getAbsoluteRef()
      • getAbsoluteUri

        public java.net.URI getAbsoluteUri()
      • toString

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