result.add(convert(componentType, i));
Object convertArray(Type componentType, Object o) throws Exception { if (o instanceof String) { String s = (String) o; if (componentType == Byte.class || componentType == byte.class) return s.getBytes(UTF_8); if (componentType == Character.class || componentType == char.class) return s.toCharArray(); } Collection<?> input = toCollection(o); Class<?> componentClass = getRawClass(componentType); Object array = Array.newInstance(componentClass, input.size()); int i = 0; for (Object next : input) { Array.set(array, i++, convert(componentType, next)); } return array; }
Object convertArray(Type componentType, Object o) throws Exception { if (o instanceof String) { String s = (String) o; if (componentType == Byte.class || componentType == byte.class) return s.getBytes(UTF_8); if (componentType == Character.class || componentType == char.class) return s.toCharArray(); } Collection<?> input = toCollection(o); Class<?> componentClass = getRawClass(componentType); Object array = Array.newInstance(componentClass, input.size()); int i = 0; for (Object next : input) { Array.set(array, i++, convert(componentType, next)); } return array; }
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { Meta.AD ad = method.getAnnotation(Meta.AD.class); String id = Configurable.mangleMethodName(method.getName()); if (ad != null && !ad.id().equals(Meta.NULL)) id = ad.id(); Object o = properties.get(id); if (o == null) { if (ad != null) { if (ad.required()) throw new IllegalStateException("Attribute is required but not set " + method.getName()); o = ad.deflt(); if (o.equals(Meta.NULL)) o = null; } } if (o == null) { Class< ? > rt = method.getReturnType(); if (rt == boolean.class ) return false; if (method.getReturnType().isPrimitive()) { o = "0"; } else return null; } return convert(method.getGenericReturnType(), o); }
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { Meta.AD ad = method.getAnnotation(Meta.AD.class); String id = Configurable.mangleMethodName(method.getName()); if (ad != null && !ad.id().equals(Meta.NULL)) id = ad.id(); Object o = properties.get(id); if (o == null) { if (ad != null) { if (ad.required()) throw new IllegalStateException("Attribute is required but not set " + method.getName()); o = ad.deflt(); if (o.equals(Meta.NULL)) o = null; } } if (o == null) { Class< ? > rt = method.getReturnType(); if (rt == boolean.class ) return false; if (method.getReturnType().isPrimitive()) { o = "0"; } else return null; } return convert(method.getGenericReturnType(), o); }
@Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { Meta.AD ad = method.getAnnotation(Meta.AD.class); String id = Configurable.mangleMethodName(method.getName()); if (ad != null && !ad.id() .equals(Meta.NULL)) id = ad.id(); Object o = properties.get(id); if (o == null) { if (ad != null) { if (ad.required()) throw new IllegalStateException("Attribute is required but not set " + method.getName()); o = ad.deflt(); if (o.equals(Meta.NULL)) o = null; } } if (o == null) { Class<?> rt = method.getReturnType(); if (rt == boolean.class) return false; if (method.getReturnType() .isPrimitive()) { o = "0"; } else return null; } return convert(method.getGenericReturnType(), o); }
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { Meta.AD ad = method.getAnnotation(Meta.AD.class); String id = Configurable.mangleMethodName(method.getName()); if (ad != null && !ad.id().equals(Meta.NULL)) id = ad.id(); Object o = properties.get(id); if (o == null) { if (ad != null) { if (ad.required()) throw new IllegalStateException("Attribute is required but not set " + method.getName()); o = ad.deflt(); if (o.equals(Meta.NULL)) o = null; } } if (o == null) { if (method.getReturnType().isPrimitive() || Number.class.isAssignableFrom(method.getReturnType())) { o = "0"; } else return null; } return convert(method.getGenericReturnType(), o); }
@Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { Meta.AD ad = method.getAnnotation(Meta.AD.class); String id = Configurable.mangleMethodName(method.getName()); if (ad != null && !ad.id() .equals(Meta.NULL)) id = ad.id(); Object o = properties.get(id); if (o == null) { if (ad != null) { if (ad.required()) throw new IllegalStateException("Attribute is required but not set " + method.getName()); o = ad.deflt(); if (o.equals(Meta.NULL)) o = null; } } if (o == null) { Class<?> rt = method.getReturnType(); if (rt == boolean.class) return false; if (method.getReturnType() .isPrimitive()) { o = "0"; } else return null; } return convert(method.getGenericReturnType(), o); }
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { Meta.AD ad = method.getAnnotation(Meta.AD.class); String id = Configurable.mangleMethodName(method.getName()); if (ad != null && !ad.id().equals(Meta.NULL)) id = ad.id(); Object o = properties.get(id); if (o == null) { if (ad != null) { if (ad.required()) throw new IllegalStateException("Attribute is required but not set " + method.getName()); o = ad.deflt(); if (o.equals(Meta.NULL)) o = null; } } if (o == null) { Class< ? > rt = method.getReturnType(); if (rt == boolean.class ) return false; if (method.getReturnType().isPrimitive()) { o = "0"; } else return null; } return convert(method.getGenericReturnType(), o); }
@Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { Meta.AD ad = method.getAnnotation(Meta.AD.class); String id = Configurable.mangleMethodName(method.getName()); if (ad != null && !ad.id() .equals(Meta.NULL)) id = ad.id(); Object o = properties.get(id); if (o == null) { if (ad != null) { if (ad.required()) throw new IllegalStateException("Attribute is required but not set " + method.getName()); o = ad.deflt(); if (o.equals(Meta.NULL)) o = null; } } if (o == null) { Class<?> rt = method.getReturnType(); if (rt == boolean.class) return false; if (method.getReturnType() .isPrimitive()) { o = "0"; } else return null; } return convert(method.getGenericReturnType(), o); }
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { Meta.AD ad = method.getAnnotation(Meta.AD.class); String id = Configurable.mangleMethodName(method.getName()); if (ad != null && !ad.id().equals(Meta.NULL)) id = ad.id(); Object o = properties.get(id); if (o == null) { if (ad != null) { if (ad.required()) throw new IllegalStateException("Attribute is required but not set " + method.getName()); o = ad.deflt(); if (o.equals(Meta.NULL)) o = null; } } if (o == null) { Class< ? > rt = method.getReturnType(); if (rt == boolean.class || rt == Boolean.class) return false; if (method.getReturnType().isPrimitive()) { o = "0"; } else return null; } return convert(method.getGenericReturnType(), o); }
Object convertArray(Type componentType, Object o) throws Exception { if (o instanceof String) { String s = (String) o; if (componentType == Byte.class || componentType == byte.class) return s.getBytes(UTF_8); if (componentType == Character.class || componentType == char.class) return s.toCharArray(); } Collection<?> input = toCollection(o); Class<?> componentClass = getRawClass(componentType); Object array = Array.newInstance(componentClass, input.size()); int i = 0; for (Object next : input) { Array.set(array, i++, convert(componentType, next)); } return array; }
Object convertArray(Type componentType, Object o) throws Exception { if ( o instanceof String) { String s = (String) o; if ( componentType == Byte.class || componentType == byte.class) return s.getBytes("UTF-8"); if ( componentType == Character.class || componentType ==char.class) return s.toCharArray(); } Collection< ? > input = toCollection(o); Class< ? > componentClass = getRawClass(componentType); Object array = Array.newInstance(componentClass, input.size()); int i = 0; for (Object next : input) { Array.set(array, i++, convert(componentType, next)); } return array; }
Object convertArray(Type componentType, Object o) throws Exception { if ( o instanceof String) { String s = (String) o; if ( componentType == Byte.class || componentType == byte.class) return s.getBytes("UTF-8"); if ( componentType == Character.class || componentType ==char.class) return s.toCharArray(); } Collection< ? > input = toCollection(o); Class< ? > componentClass = getRawClass(componentType); Object array = Array.newInstance(componentClass, input.size()); int i = 0; for (Object next : input) { Array.set(array, i++, convert(componentType, next)); } return array; }
Object convertArray(Type componentType, Object o) throws Exception { if ( o instanceof String) { String s = (String) o; if ( componentType == Byte.class || componentType == byte.class) return s.getBytes("UTF-8"); if ( componentType == Character.class || componentType ==char.class) return s.toCharArray(); } Collection< ? > input = toCollection(o); Class< ? > componentClass = getRawClass(componentType); Object array = Array.newInstance(componentClass, input.size()); int i = 0; for (Object next : input) { Array.set(array, i++, convert(componentType, next)); } return array; }
Object convertArray(Type componentType, Object o) throws Exception { Collection<?> input = toCollection(o); Class<?> componentClass = getRawClass(componentType); Object array = Array.newInstance(componentClass, input.size()); int i = 0; for (Object next : input) { Array.set(array, i++, convert(componentType, next)); } return array; }
Object convertArray(Type componentType, Object o) throws Exception { Collection< ? > input = toCollection(o); Class< ? > componentClass = getRawClass(componentType); Object array = Array.newInstance(componentClass, input.size()); int i = 0; for (Object next : input) { Array.set(array, i++, convert(componentType, next)); } return array; }