Class Generators

java.lang.Object
uk.co.real_logic.sbe.generation.Generators

public class Generators extends Object
Common operations available to all CodeGenerators.
  • Constructor Details

    • Generators

      public Generators()
  • Method Details

    • forEachField

      public static void forEachField(List<Token> tokens, BiConsumer<Token,Token> consumer)
      For each field found in a list of field Tokens take the field token and following type token to a BiConsumer.
      Parameters:
      tokens - to be iterated over.
      consumer - to for the field and encoding token pair.
    • toUpperFirstChar

      public static String toUpperFirstChar(String s)
      Uppercase the first character of a given String.
      Parameters:
      s - to have the first character upper-cased.
      Returns:
      a new String with the first character in uppercase.
    • toLowerFirstChar

      public static String toLowerFirstChar(String s)
      Lowercase the first character of a given String.
      Parameters:
      s - to have the first character upper-cased.
      Returns:
      a new String with the first character in uppercase.
    • findFirst

      public static Token findFirst(String name, List<Token> tokens, int index)
      Find the first token with a given name from an index inclusive.
      Parameters:
      name - to search for.
      tokens - to search.
      index - from which to search.
      Returns:
      first found Token or throw a IllegalStateException if not found.