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); }
@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); }
@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); }
required = a.get("required") != null ? ad.required() : a.get("deflt") == null;
required = a.get("required") != null ? ad.required() : a.get("deflt") == null;
boolean required = ad == null || ad.required(); String deflt = null; String max = null;
boolean required = ad == null || ad.required(); String deflt = null; String max = null;
boolean required = ad == null || ad.required(); String deflt = null; String max = null;
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); }
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); }