Interface StaticGenerator

All Known Implementing Classes:
PrimitiveTypeArray.PrimitiveArrayStaticGenerator, StructureArray.ArrayStaticGenerator

public interface StaticGenerator
  • Method Details

    • calculateInfo

      @NotNull default @NotNull StructureInfo calculateInfo(@NotNull @NotNull Class<?> selfClazz, @Nullable @Nullable FixedLength fixedLength)
      This method is required to be overwritten, if StructureSettings.requiresCalculateInfoMethod() is set to true. In that case the return value must not be null.
      Parameters:
      selfClazz - the class of the Structure itself
      fixedLength - the fixed length annotation if any is given
      See Also:
    • generateStructCode

      @Nullable default @Nullable String generateStructCode(@NotNull @NotNull Language language, @NotNull @NotNull Class<?> selfClazz, @NotNull @NotNull StructureInfo info)
      Can be overwritten is struct code can be generated.
      Parameters:
      language - Language
      selfClazz - the class of the Structure itself
      info - The StructureInfo of this structure
      Returns:
      generated struct code or null if it cannot be generated.
    • getStructTypeName

      @NotNull @NotNull String getStructTypeName(@NotNull @NotNull Language language, @NotNull @NotNull Class<?> selfClazz, @NotNull @NotNull StructureInfo info)
      Must be implemented.
      Parameters:
      language - Language
      selfClazz - the class of the Structure itself
      info - The StructureInfo of this structure
      Returns:
      struct type name
    • getStructVarDef

      @NotNull default @NotNull String getStructVarDef(@NotNull @NotNull Language language, @NotNull @NotNull Class<?> selfClazz, @NotNull @NotNull StructureInfo info, @NotNull @NotNull String varName)
      Can be overwritten if required. For example for arrays.
      Parameters:
      language - Language
      selfClazz - the class of the Structure itself
      info - The StructureInfo of this structure
      varName - the name of the variable
      Returns:
      struct variable definition