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
tstylesheet {
include ./types_java.ysl2
template "/namespace[@name='pEp']" apply "struct", 0;
template "struct"
template "struct[@name='message']"
||
package org.pEp.jniadapter;

42
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;
};
};

4
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<String, String>[]
otherwise call "CamelCase" with "text", "$type";
}
}

Loading…
Cancel
Save