Interface JBBPTextWriter.Extra

All Known Implementing Classes:
JBBPTextWriterExtraAdapter
Enclosing class:
JBBPTextWriter

public static interface JBBPTextWriter.Extra
The Interface describes some extras for the writer which can make extra-work.
  • Method Details

    • onNewLine

      void onNewLine(JBBPTextWriter context, int lineNumber) throws IOException
      Notification about the start new line.
      Parameters:
      context - the context, must not be null
      lineNumber - the current line number (0 is the first one)
      Throws:
      IOException - it can be thrown for transport error
    • onBeforeFirstValue

      void onBeforeFirstValue(JBBPTextWriter context) throws IOException
      Notification about print of the first value on the line.
      Parameters:
      context - the context, must not be null
      Throws:
      IOException - it can be thrown for transport error
    • onReachedMaxValueNumberForLine

      void onReachedMaxValueNumberForLine(JBBPTextWriter context) throws IOException
      Notification that reached defined maximal number of values per string line.
      Parameters:
      context - the context, must not be null
      Throws:
      IOException - it can be thrown for transport error
    • onClose

      void onClose(JBBPTextWriter context) throws IOException
      Notification about close
      Parameters:
      context - the context, must not be null
      Throws:
      IOException - it can be thrown for transport error
    • doConvertByteToStr

      String doConvertByteToStr(JBBPTextWriter context, int value) throws IOException
      Convert byte to string representation.
      Parameters:
      context - the context, must not be null
      value - the unsigned byte value to be converted
      Returns:
      string representation of the byte value, must not return null
      Throws:
      IOException - it can be thrown for transport error
    • doConvertShortToStr

      String doConvertShortToStr(JBBPTextWriter context, int value) throws IOException
      Convert short to string representation.
      Parameters:
      context - the context, must not be null
      value - the unsigned short value to be converted
      Returns:
      string representation of the short value, must not return null
      Throws:
      IOException - it can be thrown for transport error
    • doConvertIntToStr

      String doConvertIntToStr(JBBPTextWriter context, int value) throws IOException
      Convert integer value to string representation.
      Parameters:
      context - the context, must not be null
      value - the integer value to be converted
      Returns:
      string representation of the integer value, must not return null
      Throws:
      IOException - it can be thrown for transport error
    • doConvertUIntToStr

      String doConvertUIntToStr(JBBPTextWriter context, int value) throws IOException
      Convert unsigned integer value to string representation.
      Parameters:
      context - the context, must not be null
      value - the unsigned integer value to be converted
      Returns:
      string representation of the integer value, must not return null
      Throws:
      IOException - it can be thrown for transport error
      Since:
      2.0.4
    • doConvertFloatToStr

      String doConvertFloatToStr(JBBPTextWriter context, float value) throws IOException
      Convert float value to string representation.
      Parameters:
      context - the context, must not be null
      value - the float value to be converted
      Returns:
      string representation of the float value, must not return null
      Throws:
      IOException - it can be thrown for transport error
      Since:
      1.4.0
    • doConvertDoubleToStr

      String doConvertDoubleToStr(JBBPTextWriter context, double value) throws IOException
      Convert double value to string representation.
      Parameters:
      context - the context, must not be null
      value - the double value to be converted
      Returns:
      string representation of the double value, must not return null
      Throws:
      IOException - it can be thrown for transport error
      Since:
      1.4.0
    • doConvertLongToStr

      String doConvertLongToStr(JBBPTextWriter context, long value) throws IOException
      Convert long value to string representation.
      Parameters:
      context - the context, must not be null
      value - the long value to be converted
      Returns:
      string representation of the long value, must not return null
      Throws:
      IOException - it can be thrown for transport error
    • doConvertObjToStr

      String doConvertObjToStr(JBBPTextWriter context, int id, Object obj) throws IOException
      Convert an object to its string representation.
      Parameters:
      context - the context, must not be null
      id - an optional object id
      obj - an object to be converted into string, must not be null
      Returns:
      string representation of the object
      Throws:
      IOException - it can be thrown for transport error
    • doConvertCustomField

      String doConvertCustomField(JBBPTextWriter context, Object obj, Field field, Bin annotation) throws IOException
      Convert a custom field into string.
      Parameters:
      context - the context, must not be null
      obj - an object instance which field must be converted into string, must not be null
      field - the field of the object which must be converted, must not be null
      annotation - the bin annotation for the field, must not be null
      Returns:
      the text representation of the field or null if to not print anything
      Throws:
      IOException - it will be thrown for transport error