Package org.msgpack.template.builder

Examples of org.msgpack.template.builder.TemplateBuildException


  return new OrdinalEnumTemplate<T>(targetClass);
    }

    protected void checkOrdinalEnumValidation(Class<?> targetClass) {
  if(! targetClass.isEnum()) {
      throw new TemplateBuildException("tried to build ordinal enum template of non-enum class: " + targetClass.getName());
  }
    }
View Full Code Here


    protected abstract <T> Template<T> buildTemplate(Class<T> targetClass, FieldEntry[] entries);

    protected void checkClassValidation(final Class<?> targetClass) {
  if (targetClass.isInterface()) {
      throw new TemplateBuildException("Cannot build template for interface: " + targetClass.getName());
  }
  if (targetClass.isArray()) {
      throw new TemplateBuildException("Cannot build template for array class: " + targetClass.getName());
  }
  if (targetClass.isPrimitive()) {
      throw new TemplateBuildException("Cannot build template of primitive type: " + targetClass.getName());
  }
    }
View Full Code Here

      FieldList.Entry s = src.get(i);
      if (s.isAvailable()) {
    try {
        entries[i] = new DefaultFieldEntry(targetClass.getDeclaredField(s.getName()), s.getOption());
    } catch (SecurityException e) {
        throw new TemplateBuildException(e);
    } catch (NoSuchFieldException e) {
        throw new TemplateBuildException(e);
    }
      } else {
    entries[i] = new DefaultFieldEntry();
      }
  }
View Full Code Here

    continue;
      }

      int index = getFieldIndex(f, maxIndex);
      if (indexed.size() > index && indexed.get(index) != null) {
    throw new TemplateBuildException("duplicated index: "+index);
      }
      if (index < 0) {
    throw new TemplateBuildException("invalid index: "+index);
      }

      while (indexed.size() <= index) {
    indexed.add(null);
      }
View Full Code Here

TOP

Related Classes of org.msgpack.template.builder.TemplateBuildException

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.