Class AbstractDefaultDefinitionFunction<T extends SchemaElement>

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.String readOID​(java.nio.CharBuffer cb)
      Reads the buffer until a space is encountered.
      protected java.lang.String[] readOIDs​(java.nio.CharBuffer cb)
      Reads the supplied buffer for $ delimited data between an open and closed parenthesis.
      protected java.lang.String readQDString​(java.nio.CharBuffer cb)
      Reads the supplied buffer for content between two single quotes.
      protected java.lang.String[] readQDStrings​(java.nio.CharBuffer cb)
      Reads the supplied buffer for single quoted data between an open and closed parenthesis.
      protected int readRuleID​(java.nio.CharBuffer cb)
      Reads the buffer until a space is encountered.
      protected int[] readRuleIDs​(java.nio.CharBuffer cb)
      Reads the supplied buffer for space delimited data between an open and closed parenthesis.
      protected java.lang.String readUntilSpace​(java.nio.CharBuffer cb)
      Reads the supplied buffer until a space is found.
      protected void skipSpaces​(java.nio.CharBuffer cb)
      Advances the buffer position to the first character that is not a space or the end of the buffer is reached.
      protected java.nio.CharBuffer validate​(java.lang.String definition)
      Validates that the supplied definition is generally of the correct form.
      • Methods inherited from class java.lang.Object

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

      • AbstractDefaultDefinitionFunction

        public AbstractDefaultDefinitionFunction()
    • Method Detail

      • validate

        protected java.nio.CharBuffer validate​(java.lang.String definition)
                                        throws SchemaParseException
        Validates that the supplied definition is generally of the correct form. Must start with an open parenthesis and end with a close parenthesis.
        Parameters:
        definition - to validate
        Returns:
        buffer without opening and closing parenthesis
        Throws:
        SchemaParseException - if the buffer is invalid
      • readOID

        protected java.lang.String readOID​(java.nio.CharBuffer cb)
        Reads the buffer until a space is encountered.
        Parameters:
        cb - to read from
        Returns:
        oid
      • readOIDs

        protected java.lang.String[] readOIDs​(java.nio.CharBuffer cb)
        Reads the supplied buffer for $ delimited data between an open and closed parenthesis. Returns an array of integers containing each rule ID that was read. If the buffer doesn't start with an open parenthesis, an array of a single oid is returned. Advances the buffer to the position after the string.
        Parameters:
        cb - to read from
        Returns:
        oids
      • readRuleID

        protected int readRuleID​(java.nio.CharBuffer cb)
        Reads the buffer until a space is encountered. Converts the read string into an integer.
        Parameters:
        cb - to read from
        Returns:
        rule id
      • readRuleIDs

        protected int[] readRuleIDs​(java.nio.CharBuffer cb)
        Reads the supplied buffer for space delimited data between an open and closed parenthesis. Returns an array of integers containing each rule ID that was read. Advances the buffer to the position after the string.
        Parameters:
        cb - to read from
        Returns:
        rule ids
      • readQDString

        protected java.lang.String readQDString​(java.nio.CharBuffer cb)
        Reads the supplied buffer for content between two single quotes. Returns a string for the portion of the buffer that was read. Advances the buffer to the position after the string.
        Parameters:
        cb - to read from
        Returns:
        string read from the buffer
      • readQDStrings

        protected java.lang.String[] readQDStrings​(java.nio.CharBuffer cb)
        Reads the supplied buffer for single quoted data between an open and closed parenthesis. Returns an array of strings containing each qdstring that was read. If the buffer contains only data between single quotes, an array of a single qdstring is returned. Advances the buffer to the position after the string.
        Parameters:
        cb - to read from
        Returns:
        string read from the buffer
      • readUntilSpace

        protected java.lang.String readUntilSpace​(java.nio.CharBuffer cb)
        Reads the supplied buffer until a space is found. Returns a string for the portion of the buffer that was read. Advances the buffer to the position after the string.
        Parameters:
        cb - to read from
        Returns:
        string read from the buffer or empty string if the buffer has no remaining characters
      • skipSpaces

        protected void skipSpaces​(java.nio.CharBuffer cb)
        Advances the buffer position to the first character that is not a space or the end of the buffer is reached. No-op if the buffer has no remaining characters.
        Parameters:
        cb - to read from