Home Help Center

A question on java metadata directive

OrNotOrNot Member Bin.LiOrganization: GE HealthcareProject: Enterprise solution
Hi, There,
I have a simple slice definition:

["java:type:java.util.LinkedList"]
sequence<int> IntArray;


But I get mapping like this : java.util.List<java.lang.Integer>.


I missed something?


Thanks in advance.
OrNot

Comments

  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    As described in 10.16.2, the metadata syntax allows you to specify both the instance type and the formal type. The instance type is what Ice will instantiate when it receives a value of the given type; the formal type is what appears in all generated APIs.

    If you want the generated code to require a LinkedList<Integer>, you will need to specify metadata like this:
    ["java:type:java.util.LinkedList<Integer>:java.util.LinkedList<Integer>"]
    sequence<int> IntArray;
    
    Regards,
    Mark
  • OrNotOrNot Member Bin.LiOrganization: GE HealthcareProject: Enterprise solution
    Thanks,Mes, that's what I want.

    I will read the doc carefully again.


    BTW: It'd better to provide a GUI option to enable the underscore in Visual studio plugin to keep consistence with eclipse plugin.
Sign In or Register to comment.