Browse Source

more types

JNI-44
Volker Birk 10 years ago
parent
commit
4a22c93d0b
  1. 4
      src/gen_java_Message.ysl2
  2. 42
      src/pEp.yml2
  3. 4
      src/types_java.ysl2

4
src/gen_java_Message.ysl2

@ -1,9 +1,11 @@
include yslt.yml2 include yslt.yml2
tstylesheet { tstylesheet {
include ./types_java.ysl2
template "/namespace[@name='pEp']" apply "struct", 0; template "/namespace[@name='pEp']" apply "struct", 0;
template "struct" template "struct[@name='message']"
|| ||
package org.pEp.jniadapter; package org.pEp.jniadapter;

42
src/pEp.yml2

@ -2,6 +2,8 @@ decl namespace @name;
decl enum @name; decl enum @name;
decl interface @name; decl interface @name;
decl method @name; decl method @name;
decl struct @name;
decl entry @type @name;
namespace pEp { namespace pEp {
exception pEp_status { exception pEp_status {
@ -70,26 +72,26 @@ namespace pEp {
}; };
struct message { struct message {
direction dir; entry direction dir;
string id; entry string id;
string shortmsg; entry string shortmsg;
string longmsg; entry string longmsg;
string longmsg_formatted; entry string longmsg_formatted;
bloblist attachments; entry bloblist attachments;
timestamp sent; entry timestamp sent;
timestamp recv; entry timestamp recv;
identity from; entry identity from;
identitylist to; entry identitylist to;
identity recv_by; entry identity recv_by;
identitylist cc; entry identitylist cc;
identitylist bcc; entry identitylist bcc;
identitylist reply_to; entry identitylist reply_to;
stringlist in_reply_to; entry stringlist in_reply_to;
stringlist references; entry stringlist references;
stringlist keywords; entry stringlist keywords;
string comments; entry string comments;
stringpairlist opt_fields; entry stringpairlist opt_fields;
encformat enc_format; entry encformat enc_format;
}; };
}; };

4
src/types_java.ysl2

@ -8,10 +8,12 @@ function "toJava" {
when "$type='string'" > String when "$type='string'" > String
when "$type='message'" > MimeMessage when "$type='message'" > MimeMessage
when "$type='identity'" > Identity when "$type='identity'" > Identity
when "$type='identity-list'" > Identity[] when "$type='identitylist'" > Identity[]
when "$type='timestamp'" > Date when "$type='timestamp'" > Date
when "$type='encformat'" > MimeMessage.EncFormat when "$type='encformat'" > MimeMessage.EncFormat
when "$type='bloblist'" > Blob[] when "$type='bloblist'" > Blob[]
when "$type='stringpairlist'" > Pair<String, String>[]
otherwise call "CamelCase" with "text", "$type"; otherwise call "CamelCase" with "text", "$type";
} }
} }

Loading…
Cancel
Save