Example usage for com.vaadin.client.metadata Type getParameterTypes

List of usage examples for com.vaadin.client.metadata Type getParameterTypes

Introduction

In this page you can find the example usage for com.vaadin.client.metadata Type getParameterTypes.

Prototype

public Type[] getParameterTypes() 

Source Link

Usage

From source file:org.vaadin.alump.offlinebuilder.client.offline.JsonEncoder.java

License:Open Source License

private static JSONValue encodeChildValue(Object value, Type collectionType, int typeIndex,
        ApplicationConnection connection) {
    if (collectionType == null) {
        return encode(new UidlValue(value), null, connection);
    } else {/* w w  w . j  a va2 s. c o  m*/
        assert collectionType.getParameterTypes() != null
                && collectionType.getParameterTypes().length > typeIndex
                && collectionType
                        .getParameterTypes()[typeIndex] != null : "Proper generics required for encoding child value, assertion failed for "
                                + collectionType;
        Type childType = collectionType.getParameterTypes()[typeIndex];
        return encode(value, childType, connection);
    }
}