ZenAnnotation
Link to zenannotation
A ZenAnnotation can be given to a Class or its Methods to expose it to ZenScript
Class annotations
Link to class-annotations
These annotations can be given to ZenClasses
Annotation | Value | Target | Information |
---|---|---|---|
Annotation @ZenClass | Value ZenClass Name (e.g. crafttweaker.item.IItemStack ), can differ from class' formal name | Target Class | Information Name has to be unique |
Annotation @ZenExpansion | Value Expanded ZenType name (e.g. crafttweaker.item.IItemStack ) | Target Class | Information Name has to exist already (you cant extend something nonexistant) |
Annotation @ZenRegister | Value | Target Class | Information Used to Automatically register the class or expansion |
Annotation @IterableList | Value ZenClass name of the Iterable Type (e.g. crafttweaker.mods.IMod ) | Target Class | Information Class needs to be assignable to Iterable<Type> |
Annotation @IterableMap | Value ZenClass name of the Iterable key and value Type (e.g. string , crafttweaker.item.IItemStack ) | Target Class | Information Class needs to be assignable to List<Type> |
Annotation @IterableSimple | Value ZenClass name of the Iterable Type (e.g. crafttweaker.mods.IMod ) | Target Class | Information Class needs to be assignable to Map<KeyType, ValueType> |
Annotation @BracketHandler | Value Bracket Handler Priority (e.g. priority = 19 ) | Target Class | Information Class needs to be assignable to IBracketHandler |
Annotation @ModOnly | Value Required mod's name (isModLoaded(annotation.getValue()) needs to eval to true) | Target Class | Information Used in combination with @ZenRegister |
Parameter annotations
Link to parameter-annotations
These annotations can be given to Method Parameters
Annotation | Target | Information |
---|---|---|
Annotation @NotNull | Target Parameter | Information Does nothing (NYI) |
Annotation @Optional | Target Parameter | Information Denotes a Parameter as optional. Optional parameters can be omitted when calling the function |
Method annotations
Link to method-annotations
These annotations can be given to Methods (both static and nonstatic)
Annotation | Value | Target |
---|---|---|
Annotation @ZenCaster | Value | Target Method |
Annotation @ZenOperator | Value OperatorType | Target Method |
Annotation @ZenGetter | Value getter name (e.g. "name") if omited, method name without () will be used | Target Method |
Annotation @ZenSetter | Value setter name (e.g. "name") if omited, method name without () will be used | Target Method |
Annotation @ZenMemberGetter | Value | Target Method |
Annotation @ZenMemberSetter | Value | Target Method |
Annotation @ZenMethod | Value | Target Method |
Annotation @ZenMethodStatic | Value | Target Method |
Annotation @ZenDoc | Value The Additional Method info for dumpZS | Target Method |
Field annotations
Link to field-annotations
These annotations can be given to public fields (both static and nonstatic)
Annotation | Target | Information |
---|---|---|
Annotation @ZenProperty | Target Field | Information Combines @ZenSetter and @ZenGetter |