Package de.linusdev.lutils.struct.array
Class PrimitiveTypeArray.PrimitiveArrayStaticGenerator
java.lang.Object
de.linusdev.lutils.struct.array.PrimitiveTypeArray.PrimitiveArrayStaticGenerator
- All Implemented Interfaces:
StaticGenerator
- Enclosing class:
PrimitiveTypeArray<T>
public static class PrimitiveTypeArray.PrimitiveArrayStaticGenerator
extends Object
implements StaticGenerator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull ArrayStructureInfocalculateInfo(int elementSize, @NotNull Class<?> elementClass, int length) @NotNull ArrayStructureInfocalculateInfo(@NotNull Class<?> selfClazz, @Nullable FixedLength fixedLength) This method is required to be overwritten, ifStructureSettings.requiresCalculateInfoMethod()is set totrue.@NotNull StringgetStructTypeName(@NotNull Language language, @NotNull Class<?> selfClazz, @NotNull StructureInfo info) Must be implemented.@NotNull StringgetStructVarDef(@NotNull Language language, @NotNull Class<?> selfClazz, @NotNull StructureInfo info, @NotNull String varName) Can be overwritten if required.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.linusdev.lutils.struct.generator.StaticGenerator
generateStructCode
-
Constructor Details
-
PrimitiveArrayStaticGenerator
public PrimitiveArrayStaticGenerator()
-
-
Method Details
-
calculateInfo
@NotNull public @NotNull ArrayStructureInfo calculateInfo(@NotNull @NotNull Class<?> selfClazz, @Nullable @Nullable FixedLength fixedLength) Description copied from interface:StaticGeneratorThis method is required to be overwritten, ifStructureSettings.requiresCalculateInfoMethod()is set totrue. In that case the return value must not benull.- Specified by:
calculateInfoin interfaceStaticGenerator- Parameters:
selfClazz- the class of theStructureitselffixedLength- the fixed length annotation if any is given- See Also:
-
calculateInfo
@NotNull public @NotNull ArrayStructureInfo calculateInfo(int elementSize, @NotNull @NotNull Class<?> elementClass, int length) -
getStructTypeName
@NotNull public @NotNull String getStructTypeName(@NotNull @NotNull Language language, @NotNull @NotNull Class<?> selfClazz, @NotNull @NotNull StructureInfo info) Description copied from interface:StaticGeneratorMust be implemented.- Specified by:
getStructTypeNamein interfaceStaticGenerator- Parameters:
language-LanguageselfClazz- the class of theStructureitselfinfo- TheStructureInfoof this structure- Returns:
- struct type name
-
getStructVarDef
@NotNull public @NotNull String getStructVarDef(@NotNull @NotNull Language language, @NotNull @NotNull Class<?> selfClazz, @NotNull @NotNull StructureInfo info, @NotNull @NotNull String varName) Description copied from interface:StaticGeneratorCan be overwritten if required. For example for arrays.- Specified by:
getStructVarDefin interfaceStaticGenerator- Parameters:
language-LanguageselfClazz- the class of theStructureitselfinfo- TheStructureInfoof this structurevarName- the name of the variable- Returns:
- struct variable definition
-