Archived

This forum has been archived. Please start a new discussion on GitHub.

Java 5.0 code generation for slice2java

Hi,

Is there a plan for enhancing slice2java to generate JAva 5.0 code? Especially using generics for Dictionary mapping.

Thanks,
--Venkat.

Comments

  • mes
    mes California
    Hi Venkat,

    We don't currently allow metadata on dictionaries, but you can already specify generic types for sequences. For example:
    ["java:type:java.util.ArrayList<int>"] sequence<int> IntSeq;
    
    The generated code compiles just fine with JDK 1.5.0.

    We'll look into adding metadata support for dictionaries.

    Take care,
    - Mark
  • mes
    mes California
    Hi,

    I'm resurrecting this old thread to announce that metadata is fully supported for dictionaries in Java as of Ice 3.0, and you can use it with generic types. For example:
    ["java:type:java.util.TreeMap<Integer, String>"]
    dictionary<int, string> IntStringMap;
    
    See the manual for more information on using metadata in Slice.

    Take care,
    - Mark