Package org.msgpack.template

Examples of org.msgpack.template.ObjectArrayTemplate


    return FloatArrayTemplate.getInstance();
      } else if (baseClass == double.class) {
    return DoubleArrayTemplate.getInstance();
      } else {
    Template baseTemplate = registry.lookup(genericBaseType);
    return new ObjectArrayTemplate(baseClass, baseTemplate);
      }
  } else if (dim == 2) {
      Class componentClass = Array.newInstance(baseClass, 0).getClass();
      Template componentTemplate = toTemplate(arrayType, genericBaseType, baseClass, dim - 1);
      return new ReflectionMultidimentionalArrayTemplate(componentClass, componentTemplate);
View Full Code Here


    private final Map<Class, Template> templates = new HashMap<Class, Template>();

    public MsgpackSerializer() {
        messagePack = new MessagePack();

        messagePack.register(Gps[].class, new ObjectArrayTemplate(Gps.class, messagePack.lookup(Gps.class)));
    }
View Full Code Here

    private Template getTemplate(Class clazz) {
        Template template = templates.get(clazz);
        if (template == null) {
            if (clazz.isArray()) {
                template = new ObjectArrayTemplate(clazz.getComponentType(), messagePack.lookup(clazz.getComponentType()));
            } else {
                template = messagePack.lookup(clazz);
            }

            templates.put(clazz, template);
View Full Code Here

TOP

Related Classes of org.msgpack.template.ObjectArrayTemplate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.