Class JBBPCompilerUtils

java.lang.Object
com.igormaznitsa.jbbp.compiler.JBBPCompilerUtils

public final class JBBPCompilerUtils extends Object
Class contains specific common auxiliary methods for parser and compiler classes.
Since:
1.0
  • Method Details

    • findIndexForFieldPath

      public static int findIndexForFieldPath(String fieldPath, List<JBBPNamedFieldInfo> namedFields)
      Find a named field info index in a list for its path.
      Parameters:
      fieldPath - a field path, it must not be null.
      namedFields - a list contains named field info items.
      Returns:
      the index of a field for the path if found one, -1 otherwise
    • findForFieldPath

      public static JBBPNamedFieldInfo findForFieldPath(String fieldPath, List<JBBPNamedFieldInfo> namedFields)
      Find a named field info for its path inside a named field list.
      Parameters:
      fieldPath - a field path, must not be null.
      namedFields - a named field list.
      Returns:
      found item for the path, null otherwise
    • assertFieldIsNotArrayOrInArray

      public static void assertFieldIsNotArrayOrInArray(JBBPNamedFieldInfo fieldToCheck, List<JBBPNamedFieldInfo> namedFieldList, byte[] compiledScript)
      Check a field in a compiled list defined by it's named field info, that the field is not an array and it is not inside a structure array.
      Parameters:
      fieldToCheck - a named field info to be checked, must not be null
      namedFieldList - a named field info list, must not be null.
      compiledScript - a compiled script body