Class IRIProviderJDK

  • All Implemented Interfaces:
    IRIProvider

    public class IRIProviderJDK
    extends java.lang.Object
    implements IRIProvider
    IRIProvider implemented using java.net.URI.

    For information : do not use in production.

    Issues with java.net.URI:

    • It does not resolve correctly e.g. "http://host" and "path" => "http://hostpath" not "http://host/path"
    • Does not resolve with "" correctly.
    • Generates file:/path URIs
    • Constructor Summary

      Constructors 
      Constructor Description
      IRIProviderJDK()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void check​(java.lang.String iriStr)
      Create an IRI, throw IRIException if the string does not conform to the grammar or violates additional rules of the provider.
      IRIx create​(java.lang.String iri)
      Create an IRI, throw IRIException if the string does not conform to the grammar.
      boolean isStrictMode​(java.lang.String scheme)  
      void strictMode​(java.lang.String scheme, boolean runStrict)
      Run in strict mode - the exact definition of "strict" depends on the provider.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • IRIProviderJDK

        public IRIProviderJDK()
    • Method Detail

      • check

        public void check​(java.lang.String iriStr)
                   throws IRIException
        Description copied from interface: IRIProvider
        Create an IRI, throw IRIException if the string does not conform to the grammar or violates additional rules of the provider.
        Specified by:
        check in interface IRIProvider
        Throws:
        IRIException
      • toString

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

        public void strictMode​(java.lang.String scheme,
                               boolean runStrict)
        Description copied from interface: IRIProvider
        Run in strict mode - the exact definition of "strict" depends on the provider. When strict a provider should implement to the letter of the specifications, including URI-scheme rules. This strictness should be documented.
        Specified by:
        strictMode in interface IRIProvider
      • isStrictMode

        public boolean isStrictMode​(java.lang.String scheme)
        Specified by:
        isStrictMode in interface IRIProvider