A common thing is to generate getters and setters (esp. in Java).
For convenience it would be nice to have support for this directly in the API e.g. in CodeType:
We should be aware that C# and TypeScript have a different concept for Properties and there I would suggest that CodeField implementation (e.g. CsField) would also implement CodeProperty and should therefore host a getter and setter (including the default one). These getters and setters have the according names get and set and are not listed as (declared) methods of the code type. Hence here getFields and getProperties would more or less return the same thing.
For C# (TypeScript is very similar):
public string MyProperty { get; set; }
or
string _myProperty;
public string MyProperty
{
get { return _myProperty; }
set { _myProperty = value; }
}
A common thing is to generate getters and setters (esp. in Java). For convenience it would be nice to have support for this directly in the API e.g. in CodeType:
We should be aware that C# and TypeScript have a different concept for Properties and there I would suggest that
CodeField
implementation (e.g.CsField
) would also implementCodeProperty
and should therefore host a getter and setter (including the default one). These getters and setters have the according namesget
andset
and are not listed as (declared) methods of the code type. Hence heregetFields
andgetProperties
would more or less return the same thing.For C# (TypeScript is very similar):
or