Class ParseURN

java.lang.Object
org.apache.jena.rfc3986.ParseURN

public class ParseURN extends Object
Validate and parse URNs.
Implementation Note:
Validation is a single pass over the string. Parsing is a single pass over the string, followed by extracting slices of the string.
  • Constructor Details

    • ParseURN

      public ParseURN()
  • Method Details

    • parseURN

      public static URN parseURN(String string)
      Parse a string a a URN, Return null for invalid.
    • parseURN

      public static URN parseURN(String string, BiConsumer<Issue,String> handler)
      Parse a URN, including URN components. Return a URN. Call handler to pass back scheme-specific violations. This is allowed to raise an exception. Return null on error if the handler returned.
    • parseURNComponents

      public static URNComponents parseURNComponents(IRI iri)
      Parse the URN components of an IRI (query string and fragment)
    • validateURN

      public static void validateURN(String string, BiConsumer<Issue,String> handler)
      Validate a URN, NID and NSS, excluding URN components. Return the index (exclusive) of the end of NSS. Call handler to pass back scheme-specific violations. This is allowed to raise an exception.
    • validateAssignedName

      public static int validateAssignedName(String string, BiConsumer<Issue,String> handler)
      Validate a URN, NID and NSS, excluding URN components. Return the index (exclusive) of the end of NSS. Call handler to pass back scheme-specific violations. This is allowed to raise an exception.