Class LangParserLib


  • public class LangParserLib
    extends java.lang.Object
    Support function for language parsing.
    • Constructor Summary

      Constructors 
      Constructor Description
      LangParserLib()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String stripChars​(java.lang.String s, int n)
      Remove the first n characters from the string
      static java.lang.String stripQuotes​(java.lang.String s)
      Remove first and last characters (e.g.
      static java.lang.String stripQuotes3​(java.lang.String s)
      Remove first 3 and last 3 characters (e.g.
      static void throwParseException​(java.lang.String msg)  
      static void throwParseException​(java.lang.String msg, int line, int column)  
      static java.lang.String unescapePName​(java.lang.String s, int line, int column)
      Unescape a prefix name (or part of).
      static java.lang.String unescapeStr​(java.lang.String s, int line, int column)
      Unescape \t, \n etc.
      static java.lang.String unescapeUnicode​(java.lang.String s, int line, int column)
      Unescape \t, \n etc.
      • Methods inherited from class java.lang.Object

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

      • LangParserLib

        public LangParserLib()
    • Method Detail

      • stripChars

        public static java.lang.String stripChars​(java.lang.String s,
                                                  int n)
        Remove the first n characters from the string
      • stripQuotes

        public static java.lang.String stripQuotes​(java.lang.String s)
        Remove first and last characters (e.g. ' or "") from a string
      • stripQuotes3

        public static java.lang.String stripQuotes3​(java.lang.String s)
        Remove first 3 and last 3 characters (e.g. ''' or """) from a string
      • unescapeStr

        public static java.lang.String unescapeStr​(java.lang.String s,
                                                   int line,
                                                   int column)
        Unescape \t, \n etc.
      • unescapeUnicode

        public static java.lang.String unescapeUnicode​(java.lang.String s,
                                                       int line,
                                                       int column)
        Unescape \t, \n etc. and also unicode \ u and \U
      • unescapePName

        public static java.lang.String unescapePName​(java.lang.String s,
                                                     int line,
                                                     int column)
        Unescape a prefix name (or part of). This applies the Turtle/SPARQL PLX rule
      • throwParseException

        public static void throwParseException​(java.lang.String msg,
                                               int line,
                                               int column)
      • throwParseException

        public static void throwParseException​(java.lang.String msg)