Hi Federico,
It should be possible to directly extend the class with a new enum. E.g.:
public enum CodeLanguage {
Javascript(“..."),
TypeScript(“…");
Is this what you are looking for?
In the declareModel it is also possible to provide a custom code skeleton:
.requiredCodeblock(Labels.withId(JSON_CONFIGURATION), CodeLanguage.Javascript,
defaultSkeleton)
I used this in the BooleanToStatController [1], where I wanted that the user
provides a json object instead of a javascript function.
Philipp
[1]
https://github.com/apache/incubator-streampipes-extensions/blob/dev/streampipes-processors-transformation-jvm/src/main/java/org/apache/streampipes/processors/transformation/jvm/processor/booloperator/state/BooleanToStateController.java
> On 31. Aug 2021, at 10:41, Rullo, Federico <[email protected]> wrote:
>
> Hello,
>
> I am currently developing a processor and I wanted to extend the CodeLanguage
> class to add a new language to it, do you have any advice on how to do it,
> since I know that extending enums is not possible or really hard in Java.
>
> Thank you in advance,
>
> Federico.
> Federico Rullo
> _________________________________________________________________
>
> GFT Italia S.r.l.
> Via A. Rimassa, 51/2
> 16129 Genova, Italy
>
> T +39 010 583158
> F +39 010 8680479
> [email protected] <mailto:[email protected]>
> www.gft.com/it <http://www.gft.com/it>
> https://blog.gft.com <https://blog.gft.com/>
> https://www.linkedin.com/company/gft-group/
> <https://www.linkedin.com/company/gft-group/>
> www.twitter.com/gft_it <http://www.twitter.com/gft_it>
> <ActoForTheFuture_GFT@1,2x_68f73108-d76e-4497-aa5c-ff8a5693ce57.png>
> <https://www.gft.com/it/it/index/societa/stampa/press-releases/2021/sostenibilita-e-innovazione-sociale--gft-lancia-il-greencoding-e-in-italia-act-for-the-future/>
>
> Registered office: GFT Italia S.r.l., Via Sile 18, 20139 Milan (Italy)
> VAT Code and number of registration with the Companies' Register of Milan:
> 00819200478
> Corporate capital: Euro 1,000,000 fully paid-in
>
> Company subject to the direction and coordination activity of GFT
> Technologies SE
>
> Ai sensi del Regolamento UE 2016/679 (GDPR) e delle Linee Guida per posta
> elettronica ed Internet del Garante Privacy si rende noto che le informazioni
> contenute nella presente comunicazione e i relativi allegati possono essere
> riservate e sono, comunque, destinate esclusivamente alle persone o alla
> Società sopraindicati. Le stesse non sono da considerarsi comunicazioni
> personali, quindi eventuali risposte potranno essere conosciute da persone
> appartenenti all’azienda.
>
> In accordance with Regulation EU 2016/679 (General Data Protection
> Regulation) and Guidelines Applying to the Use of E-Mails and the Internet in
> the Employment Context of Italian Data Protection Authority it is announced
> that the information in this communication (which includes any documents with
> it) is confidential and meant only for above-mentioned persons and/or
> Companies; the information is not personal therefore, It is intended for the
> addressee only and any replies will be known by people belonging to the
> company.
> _________________________________________________________________
>