Interface StaticGenerator
- All Known Implementing Classes:
PrimitiveTypeArray.PrimitiveArrayStaticGenerator,StructureArray.ArrayStaticGenerator
public interface StaticGenerator
-
Method Summary
Modifier and TypeMethodDescriptiondefault @NotNull StructureInfocalculateInfo(@NotNull Class<?> selfClazz, @Nullable FixedLength fixedLength) This method is required to be overwritten, ifStructureSettings.requiresCalculateInfoMethod()is set totrue.default @Nullable StringgenerateStructCode(@NotNull Language language, @NotNull Class<?> selfClazz, @NotNull StructureInfo info) Can be overwritten is struct code can be generated.@NotNull StringgetStructTypeName(@NotNull Language language, @NotNull Class<?> selfClazz, @NotNull StructureInfo info) Must be implemented.default @NotNull StringgetStructVarDef(@NotNull Language language, @NotNull Class<?> selfClazz, @NotNull StructureInfo info, @NotNull String varName) Can be overwritten if required.
-
Method Details
-
calculateInfo
@NotNull default @NotNull StructureInfo calculateInfo(@NotNull @NotNull Class<?> selfClazz, @Nullable @Nullable FixedLength fixedLength) This method is required to be overwritten, ifStructureSettings.requiresCalculateInfoMethod()is set totrue. In that case the return value must not benull.- Parameters:
selfClazz- the class of theStructureitselffixedLength- 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-LanguageselfClazz- the class of theStructureitselfinfo- TheStructureInfoof this structure- Returns:
- generated struct code or
nullif 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-LanguageselfClazz- the class of theStructureitselfinfo- TheStructureInfoof 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-LanguageselfClazz- the class of theStructureitselfinfo- TheStructureInfoof this structurevarName- the name of the variable- Returns:
- struct variable definition
-