@Override @Deprecated // since 2.9 public boolean hasCreatorAnnotation(Annotated a) { // 02-Mar-2017, tatu: Copied from base AnnotationIntrospector JsonCreator ann = _findAnnotation(a, JsonCreator.class); if (ann != null) { return (ann.mode() != JsonCreator.Mode.DISABLED); } return false; } }
@Override public String findImplicitPropertyName(AnnotatedMember m) { if (m instanceof AnnotatedParameter) { return findParameterName((AnnotatedParameter) m); } return null; }
private String findParameterName(AnnotatedParameter annotatedParameter) { Parameter[] params; try { params = getParameters(annotatedParameter.getOwner()); } catch (MalformedParametersException e) { return null; } Parameter p = params[annotatedParameter.getIndex()]; return p.isNamePresent() ? p.getName() : null; }
@Override public void setupModule(SetupContext context) { super.setupModule(context); context.insertAnnotationIntrospector(new ParameterNamesAnnotationIntrospector(creatorBinding, new ParameterExtractor())); }
@Override public JsonCreator.Mode findCreatorAnnotation(MapperConfig<?> config, Annotated a) { JsonCreator ann = _findAnnotation(a, JsonCreator.class); if (ann != null) { JsonCreator.Mode mode = ann.mode(); // but keep in mind that there may be explicit default for this module if ((creatorBinding != null) && (mode == JsonCreator.Mode.DEFAULT)) { mode = creatorBinding; } return mode; } return null; }
@Override @Deprecated // remove AFTER 2.9 public JsonCreator.Mode findCreatorBinding(Annotated a) { JsonCreator ann = _findAnnotation(a, JsonCreator.class); if (ann != null) { JsonCreator.Mode mode = ann.mode(); if ((creatorBinding != null) && (mode == JsonCreator.Mode.DEFAULT)) { mode = creatorBinding; } return mode; } return creatorBinding; }