Class JBBPCompiledBlock

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

public final class JBBPCompiledBlock extends Object
The Class describes a data block contains compiled information for a bin parser script.
Since:
1.0
  • Method Details

    • prepare

      public static JBBPCompiledBlock.Builder prepare()
      The Method allows to create the new builder.
      Returns:
      the new builder
    • getSource

      public String getSource()
      Get the source which was used for compilation
      Returns:
      the source as string
    • hasVarFields

      public boolean hasVarFields()
      Check that the compiled block has var fields or arrays.
      Returns:
      true if the compiled block contains any VAR field or VAR array, false otherwise
    • hasEvaluatedSizeArrays

      public boolean hasEvaluatedSizeArrays()
      Check that the compiled block contains array fields with calculated size.
      Returns:
      true if calculated size arrays are presented, false otherwise
    • getCompiledData

      public byte[] getCompiledData()
      Get the compiled data block
      Returns:
      the compiled data block contains the byte code of the script
    • getNamedFields

      public JBBPNamedFieldInfo[] getNamedFields()
      Get array contains the named field array
      Returns:
      the named field item array
    • getCustomTypeFields

      public JBBPFieldTypeParameterContainer[] getCustomTypeFields()
      Get array contains parameter info of detected custom type fields.
      Returns:
      the array contains the info for every registered custom type field.
    • getArraySizeEvaluators

      public JBBPIntegerValueEvaluator[] getArraySizeEvaluators()
      Get the array size evaluators
      Returns:
      the array size evaluators, it can be null if there is not any variable size array
    • findFieldForPath

      public JBBPNamedFieldInfo findFieldForPath(String fieldPath)
      Find a field for its path.
      Parameters:
      fieldPath - a field path
      Returns:
      a field to be found for the path, null otherwise
    • findFieldOffsetForPath

      public int findFieldOffsetForPath(String fieldPath)
      Find offset of a field in the compiled block for its field path.
      Parameters:
      fieldPath - a field path, it must not be null
      Returns:
      the offset as integer for the field path
      Throws:
      JBBPException - if the field is not found