@Override public String bindName() { return beanSpec.name(); }
@Override public String bindName() { return spec.name(); }
@Override public String bindName() { return spec.name(); }
private String key(String name, BeanSpec spec) { if (S.notBlank(name)) { return name; } return spec.name(); } }
private String singleJsonFieldName(ActionContext context) { if (null != singleJsonFieldName) { return singleJsonFieldName; } for (BeanSpec spec : paramSpecs) { String name = spec.name(); if (context.isPathVar(name)) { continue; } return name; } return null; }
private String singleJsonFieldName(WebSocketContext context) { if (null != singleJsonFieldName) { return singleJsonFieldName; } Set<String> set = context.paramKeys(); for (BeanSpec spec: paramSpecs) { String name = spec.name(); if (!set.contains(name)) { return name; } } return null; }
private String key(String name, BeanSpec spec) { if (S.notBlank(name)) { return name; } return spec.name(); } }
private String singleJsonFieldName(ActionContext context) { if (null != singleJsonFieldName) { return singleJsonFieldName; } for (BeanSpec spec : paramSpecs) { String name = spec.name(); if (context.isPathVar(name)) { continue; } return name; } return null; }
private static String dbBindName(BeanSpec spec) { for (Annotation annotation : spec.allAnnotations()) { if (annotation.annotationType().getName().equals(DbBind.class.getName())) { String value = $.invokeVirtual(annotation, "value"); return (S.blank(value)) ? spec.name() : value; } } return null; }
private static String dbBindName(BeanSpec spec) { for (Annotation annotation : spec.allAnnotations()) { if (annotation.annotationType().getName().equals(DbBind.class.getName())) { String value = $.invokeVirtual(annotation, "value"); return (S.blank(value)) ? spec.name() : value; } } return null; }
public static JsonDtoPatch of(BeanSpec spec) { JsonDtoPatch patch = new JsonDtoPatch(spec.name(), spec); return patch.isEmpty() ? null : patch; } }
public static JsonDtoPatch of(BeanSpec spec) { JsonDtoPatch patch = new JsonDtoPatch(spec.name(), spec); return patch.isEmpty() ? null : patch; } }
private static String setterName(BeanSpec beanSpec) { return S.concat("set", S.capFirst(beanSpec.name())); } }
private String key(String name, BeanSpec spec) { if (S.notBlank(name)) { return name; } name = spec.name(); return Keyword.of(name).httpHeader(); } }
private static boolean isEmail(BeanSpec spec) { SampleData.Category anno = spec.getAnnotation(SampleData.Category.class); SampleDataCategory category = null != anno ? anno.value() : null; if (null != category && category != EMAIL) { return false; } category = SampleDataCategory.of(spec.name()); return category == EMAIL; }
@Override public Object load(Object bean, ActContext<?> context, boolean noDefaultValue) { if (isPathVariable) { return fallBack.load(bean, context, noDefaultValue); } JsonDto dto = context.attribute(JsonDto.CTX_ATTR_KEY); if (null == dto) { return this.fallBack.load(bean, context, noDefaultValue); } else { Object o = dto.get(spec.name()); return null != o ? o : defValProvider.get(); } }
@Override public Object load(Object bean, ActContext<?> context, boolean noDefaultValue) { if (isPathVariable) { return fallBack.load(bean, context, noDefaultValue); } JsonDto dto = context.attribute(JsonDto.CTX_ATTR_KEY); if (null == dto) { return this.fallBack.load(bean, context, noDefaultValue); } else { Object o = dto.get(spec.name()); return null != o ? o : defValProvider.get(); } }
private String key(String name, BeanSpec spec) { if (S.notBlank(name)) { return name; } name = spec.name(); return Keyword.of(name).httpHeader(); } }
private static String key(List<BeanSpec> beanSpecs) { S.Buffer sb = S.buffer(); for (BeanSpec beanSpec : beanSpecs) { sb.append(beanSpec.name()).append(beanSpec.type().hashCode()); } return sb.toString(); }
JsonParamValueLoader(ParamValueLoader fallBack, BeanSpec spec, DependencyInjector<?> injector) { this.fallBack = $.requireNotNull(fallBack); this.spec = $.requireNotNull(spec); this.defValProvider = findDefValProvider(spec, injector); ActionContext ctx = ActionContext.current(); if (null != ctx) { isPathVariable = ctx.isPathVar(spec.name()); } }