Package com.igormaznitsa.jbbp.compiler
Class JBBPCompilerUtils
java.lang.Object
com.igormaznitsa.jbbp.compiler.JBBPCompilerUtils
Class contains specific common auxiliary methods for parser and compiler classes.
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertFieldIsNotArrayOrInArray(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.static JBBPNamedFieldInfofindForFieldPath(String fieldPath, List<JBBPNamedFieldInfo> namedFields) Find a named field info for its path inside a named field list.static intfindIndexForFieldPath(String fieldPath, List<JBBPNamedFieldInfo> namedFields) Find a named field info index in a list for its path.
-
Method Details
-
findIndexForFieldPath
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 nullnamedFieldList- a named field info list, must not be null.compiledScript- a compiled script body
-