diff --git a/src/gen_java_Message.ysl2 b/src/gen_java_Message.ysl2 index 3d0d76e..beb5f71 100644 --- a/src/gen_java_Message.ysl2 +++ b/src/gen_java_Message.ysl2 @@ -1,9 +1,11 @@ include yslt.yml2 tstylesheet { + include ./types_java.ysl2 + template "/namespace[@name='pEp']" apply "struct", 0; - template "struct" + template "struct[@name='message']" || package org.pEp.jniadapter; diff --git a/src/pEp.yml2 b/src/pEp.yml2 index cd0cb5d..9c2966d 100644 --- a/src/pEp.yml2 +++ b/src/pEp.yml2 @@ -2,6 +2,8 @@ decl namespace @name; decl enum @name; decl interface @name; decl method @name; +decl struct @name; +decl entry @type @name; namespace pEp { exception pEp_status { @@ -70,26 +72,26 @@ namespace pEp { }; struct message { - direction dir; - string id; - string shortmsg; - string longmsg; - string longmsg_formatted; - bloblist attachments; - timestamp sent; - timestamp recv; - identity from; - identitylist to; - identity recv_by; - identitylist cc; - identitylist bcc; - identitylist reply_to; - stringlist in_reply_to; - stringlist references; - stringlist keywords; - string comments; - stringpairlist opt_fields; - encformat enc_format; + entry direction dir; + entry string id; + entry string shortmsg; + entry string longmsg; + entry string longmsg_formatted; + entry bloblist attachments; + entry timestamp sent; + entry timestamp recv; + entry identity from; + entry identitylist to; + entry identity recv_by; + entry identitylist cc; + entry identitylist bcc; + entry identitylist reply_to; + entry stringlist in_reply_to; + entry stringlist references; + entry stringlist keywords; + entry string comments; + entry stringpairlist opt_fields; + entry encformat enc_format; }; }; diff --git a/src/types_java.ysl2 b/src/types_java.ysl2 index 31a4ac8..8d0b02f 100644 --- a/src/types_java.ysl2 +++ b/src/types_java.ysl2 @@ -8,10 +8,12 @@ function "toJava" { when "$type='string'" > String when "$type='message'" > MimeMessage when "$type='identity'" > Identity - when "$type='identity-list'" > Identity[] + when "$type='identitylist'" > Identity[] when "$type='timestamp'" > Date when "$type='encformat'" > MimeMessage.EncFormat when "$type='bloblist'" > Blob[] + when "$type='stringpairlist'" > Pair[] + otherwise call "CamelCase" with "text", "$type"; } }