# Ref_impl_Java mailing list archives **Category:** [Reference Implementation: Java (archive)](https://discourse.openehr.org/c/reference-implementation-java-archive/154) **Created:** 2010-05-07 10:14 UTC **Views:** 1 **Replies:** 3 **URL:** https://discourse.openehr.org/t/ref-impl-java-mailing-list-archives/16246 --- ## Post #1 by @Saso_Rutar Hi Sebastian, You've probably been playing around with the adl\.jj file\. Technically, the solution could look something like this: ArchetypeTerm archetype\_term\(\) : \{ Token t; String code; String key; String value = null; ArchetypeTerm term; \} \{ "\[" code = local\_code\_value\(\) \{ term = new ArchetypeTerm\(code\); \} "\]" <SYM\_EQ> "<" \( <SYM\_TEXT> <SYM\_EQ> "<" value = string\_value\(\) \{ term\.addItem\("text", value\); \} ">" \[ ";" \] > <SYM\_DESCRIPTION\_WORD> <SYM\_EQ> "<" value = string\_value\(\) \{ term\.addItem\("description", value\); \} ">" \[ ";" \] > <SYM\_COMMENT> <SYM\_EQ> "<" value = string\_value\(\) \{ term\.addItem\("comment", value\); \} ">" \[ ";" \] > t = <V\_IDENTIFIER> <SYM\_EQ> "<" value = string\_value\(\) \{ key = t\.image; term\.addItem\(key, value\); \} ">" \[ ";" \] \)\* ">" \{ return term; \} \} If you just replace the archetype\-term definition code with the upper snippet, it should work\. As for the update of the central svn repository, you should probably contact Rong Chen\.\.\. Saso --- ## Post #2 by @system Hi Saso, good one! Thanks I have checked it in together with a test case. Cheers Sebastian Saso Rutar wrote: --- ## Post #3 by @system Hi Sebastian, Saso\! The underlying object model, ArchetypeTerm has a Map\-based implementation so it would be nice to allow any kind of key,value pairs in ADL\. Right now it's not very convenient modify the parser in order to add new keys\. Later on, when we move on to d\-ADL for this part of the archetypes, it will be much easier\. I am interested to know the usecase of extra keys here\. Sebastian, can you please elaborate on it? Cheers, Rong --- ## Post #4 by @system Hi Rong, Well, my reason is that the specs explicitly state that it is possible. Apart from text, description and comment, the specs also mention provenance as another example for a key. At least the Ocean Archetype Editor supports the input of any key here as well. Unfortunately, the specs don't restrict the exact nature of the key other than stating that is a string. So, as far as I understand, it might even be a key with spaces or other undesired characters in it, which I don't think should be allowed. V_IDENTIFIER as Saso chose seems to be the best choice here, even if it would not work with spaces or other non V_IDENTIFIER characters. Cheers, Sebastian Rong Chen wrote: [details="(attachments)"] ![oceanlogo.png|84x82](upload://2EtFgZ1bS4JNl1d51FusTB7hg8M.png) [/details] --- **Canonical:** https://discourse.openehr.org/t/ref-impl-java-mailing-list-archives/16246 **Original content:** https://discourse.openehr.org/t/ref-impl-java-mailing-list-archives/16246