classafPlastic::PlasticClassModel
sys::Obj afPlastic::PlasticClassModel
Models a Fantom class.
All types are generated with a standard serialisation ctor:
new make(|This|? f := null) { f?.call(this) }All added fields and methods will be public. As you will never compile against the generated code, this should not be problematic.
- addCtor
- PlasticCtorModel addCtor(Str ctorName, Str signature, Str body)- Add a ctor. - signaturedoes not include (brackets).- bodydoes not include {braces}
- addField
- PlasticFieldModel addField(Type fieldType, Str fieldName, Str? getBody := null, Str? setBody := null)- Add a field. - getBodyand- setBodyare code blocks to be used in the- getand- setaccessors.
- addMethod
- PlasticMethodModel addMethod(Type returnType, Str methodName, Str signature, Str body)- Add a method. - signaturedoes not include (brackets).- bodydoes not include {braces}
- className
- const Str className- The name of the class. 
- extendClass
- This extendClass(Type classType)- Sets the given type as the superclass. If this model is const, then the given type must be const also. This method may only be called once. The superclass must be an acutal - class(not a mixin) and be public.
- extendMixin
- This extendMixin(Type mixinType)- Extend the given mixin. The mixin must be public. 
- facets
- PlasticFacetModel[] facets := PlasticFacetModel[,]
- hasField
- Returns - trueif this model has a field with the given name.
- isConst
- const Bool isConst- Set to - trueif this class is- const
- make
- new make(Str className, Bool isConst)- Creates a class model with the given name. 
- mixins
- Type[] mixins := Type[,] { private set }- A list of mixin types the model extends. 
- overrideField
- PlasticFieldModel overrideField(Field field, Str? getBody := null, Str? setBody := null)- Override a field. The given field must exist in a super class / mixin. - getBodyand- setBodyare code blocks to be used in the- getand- setaccessors.
- overrideMethod
- PlasticMethodModel overrideMethod(Method method, Str body)- Add a method. The given method must exist in a super class / mixin. - bodydoes not include {braces}
- superClass
- Type superClass := sys::Obj# { private set }- The superclass type. 
- toFantomCode
- Str toFantomCode()- Converts the model into Fantom source code. - All types are generated with a standard serialisation ctor: - new make(|This|? f := null) { f?.call(this) }
- usingPod
- usethe given pod.
- usingType
- usethe given type.