@Override public Constructor<?> findSingleArgConstructor(Class<?>... argTypes) { for (AnnotatedConstructor ac : _classInfo.getConstructors()) { // This list is already filtered to only include accessible /* (note: for now this is a redundant check; but in future * that may change; thus leaving here for now) */ if (ac.getParameterCount() == 1) { Class<?> actArg = ac.getRawParameterType(0); for (Class<?> expArg : argTypes) { if (expArg == actArg) { return ac.getAnnotated(); } } } } return null; }
/** * Method for collecting basic information on constructor(s) found */ protected void _addCreators(Map<String, POJOPropertyBuilder> props) { // can be null if annotation processing is disabled... if (!_useAnnotations) { return; } for (AnnotatedConstructor ctor : _classDef.getConstructors()) { if (_creatorProperties == null) { _creatorProperties = new LinkedList<POJOPropertyBuilder>(); } for (int i = 0, len = ctor.getParameterCount(); i < len; ++i) { _addCreatorParam(props, ctor.getParameter(i)); } } for (AnnotatedMethod factory : _classDef.getFactoryMethods()) { if (_creatorProperties == null) { _creatorProperties = new LinkedList<POJOPropertyBuilder>(); } for (int i = 0, len = factory.getParameterCount(); i < len; ++i) { _addCreatorParam(props, factory.getParameter(i)); } } }
@Override public JsonCreator.Mode findCreatorAnnotation(MapperConfig<?> config, Annotated a) { if (a instanceof AnnotatedConstructor) { AnnotatedConstructor constructor = (AnnotatedConstructor) a; // 09-Mar-2017, tatu: Ideally would allow mix-ins etc, but for now let's take // a short-cut here: Class<?> declClass = constructor.getDeclaringClass(); if (declClass.getAnnotation(Stringable.class) != null) { if (constructor.getParameterCount() == 1 && String.class.equals(constructor.getRawParameterType(0))) { return JsonCreator.Mode.DELEGATING; } } } return null; }
@Override public boolean hasCreatorAnnotation(final Annotated a) { if (!(a instanceof AnnotatedConstructor)) { return false; } final AnnotatedConstructor ctor = (AnnotatedConstructor) a; if (ctor.getParameterCount() == 0) { return true; } final AutoMatter.Field field = ctor.getParameter(0).getAnnotation(AutoMatter.Field.class); return field != null; } }
@Override public boolean hasCreatorAnnotation(final Annotated a) { if (!(a instanceof AnnotatedConstructor)) { return false; } final AnnotatedConstructor ctor = (AnnotatedConstructor) a; if (ctor.getParameterCount() == 0) { return true; } final AutoMatter.Field field = ctor.getParameter(0).getAnnotation(AutoMatter.Field.class); return field != null; } }
private void addJacksonAnnotationsToContructorParameters(AnnotatedConstructor annotatedConstructor) { ConstructorProperties properties = getConstructorPropertiesAnnotation(annotatedConstructor); for (int i = 0; i < annotatedConstructor.getParameterCount(); i++) { String name = properties.value()[i]; AnnotatedParameter parameter = annotatedConstructor.getParameter(i); Field field = null; try { field = annotatedConstructor.getDeclaringClass().getDeclaredField(name); } catch (NoSuchFieldException ignored) { } addJacksonAnnotationsToConstructorParameter(field, parameter, name); } }
@Override public Constructor<?> findSingleArgConstructor(Class<?>... argTypes) { for (AnnotatedConstructor ac : _classInfo.getConstructors()) { // This list is already filtered to only include accessible /* (note: for now this is a redundant check; but in future * that may change; thus leaving here for now) */ if (ac.getParameterCount() == 1) { Class<?> actArg = ac.getRawParameterType(0); for (Class<?> expArg : argTypes) { if (expArg == actArg) { return ac.getAnnotated(); } } } } return null; }
@Override public Constructor<?> findSingleArgConstructor(Class<?>... argTypes) { for (AnnotatedConstructor ac : _classInfo.getConstructors()) { // This list is already filtered to only include accessible /* (note: for now this is a redundant check; but in future * that may change; thus leaving here for now) */ if (ac.getParameterCount() == 1) { Class<?> actArg = ac.getRawParameterType(0); for (Class<?> expArg : argTypes) { if (expArg == actArg) { return ac.getAnnotated(); } } } } return null; }
@Override public Constructor<?> findSingleArgConstructor(Class<?>... argTypes) { for (AnnotatedConstructor ac : _classInfo.getConstructors()) { // This list is already filtered to only include accessible /* (note: for now this is a redundant check; but in future * that may change; thus leaving here for now) */ if (ac.getParameterCount() == 1) { Class<?> actArg = ac.getRawParameterType(0); for (Class<?> expArg : argTypes) { if (expArg == actArg) { return ac.getAnnotated(); } } } } return null; }
@Override public Constructor<?> findSingleArgConstructor(Class<?>... argTypes) { for (AnnotatedConstructor ac : _classInfo.getConstructors()) { // This list is already filtered to only include accessible /* (note: for now this is a redundant check; but in future * that may change; thus leaving here for now) */ if (ac.getParameterCount() == 1) { Class<?> actArg = ac.getRawParameterType(0); for (Class<?> expArg : argTypes) { if (expArg == actArg) { return ac.getAnnotated(); } } } } return null; }
@Override public Constructor<?> findSingleArgConstructor(Class<?>... argTypes) { for (AnnotatedConstructor ac : _classInfo.getConstructors()) { // This list is already filtered to only include accessible /* (note: for now this is a redundant check; but in future * that may change; thus leaving here for now) */ if (ac.getParameterCount() == 1) { Class<?> actArg = ac.getRawParameterType(0); for (Class<?> expArg : argTypes) { if (expArg == actArg) { return ac.getAnnotated(); } } } } return null; }
@Override public Constructor<?> findSingleArgConstructor(Class<?>... argTypes) { for (AnnotatedConstructor ac : _classInfo.getConstructors()) { // This list is already filtered to only include accessible /* (note: for now this is a redundant check; but in future * that may change; thus leaving here for now) */ if (ac.getParameterCount() == 1) { Class<?> actArg = ac.getRawParameterType(0); for (Class<?> expArg : argTypes) { if (expArg == actArg) { return ac.getAnnotated(); } } } } return null; }
private void addJacksonAnnotationsToContructorParameters(AnnotatedConstructor annotatedConstructor) { ConstructorProperties properties = getConstructorPropertiesAnnotation(annotatedConstructor); for (int i = 0; i < annotatedConstructor.getParameterCount(); i++) { String name = properties.value()[i]; AnnotatedParameter parameter = annotatedConstructor.getParameter(i); Field field = null; try { field = annotatedConstructor.getDeclaringClass().getDeclaredField(name); } catch (NoSuchFieldException ignored) { } addJacksonAnnotationsToConstructorParameter(field, parameter, name); } }
/** * Method for collecting basic information on constructor(s) found */ protected void _addCreators(Map<String, POJOPropertyBuilder> props) { // can be null if annotation processing is disabled... if (_annotationIntrospector == null) { return; } for (AnnotatedConstructor ctor : _classDef.getConstructors()) { if (_creatorProperties == null) { _creatorProperties = new LinkedList<POJOPropertyBuilder>(); } for (int i = 0, len = ctor.getParameterCount(); i < len; ++i) { _addCreatorParam(props, ctor.getParameter(i)); } } for (AnnotatedMethod factory : _classDef.getStaticMethods()) { if (_creatorProperties == null) { _creatorProperties = new LinkedList<POJOPropertyBuilder>(); } for (int i = 0, len = factory.getParameterCount(); i < len; ++i) { _addCreatorParam(props, factory.getParameter(i)); } } }
/** * Method for collecting basic information on constructor(s) found */ protected void _addCreators() { // can be null if annotation processing is disabled... if (_annotationIntrospector != null) { for (AnnotatedConstructor ctor : _classDef.getConstructors()) { if (_creatorProperties == null) { _creatorProperties = new LinkedList<POJOPropertyBuilder>(); } for (int i = 0, len = ctor.getParameterCount(); i < len; ++i) { _addCreatorParam(ctor.getParameter(i)); } } for (AnnotatedMethod factory : _classDef.getStaticMethods()) { if (_creatorProperties == null) { _creatorProperties = new LinkedList<POJOPropertyBuilder>(); } for (int i = 0, len = factory.getParameterCount(); i < len; ++i) { _addCreatorParam(factory.getParameter(i)); } } } }
/** * Method for collecting basic information on constructor(s) found */ protected void _addCreators() { // can be null if annotation processing is disabled... if (_annotationIntrospector != null) { for (AnnotatedConstructor ctor : _classDef.getConstructors()) { if (_creatorProperties == null) { _creatorProperties = new LinkedList<POJOPropertyBuilder>(); } for (int i = 0, len = ctor.getParameterCount(); i < len; ++i) { _addCreatorParam(ctor.getParameter(i)); } } for (AnnotatedMethod factory : _classDef.getStaticMethods()) { if (_creatorProperties == null) { _creatorProperties = new LinkedList<POJOPropertyBuilder>(); } for (int i = 0, len = factory.getParameterCount(); i < len; ++i) { _addCreatorParam(factory.getParameter(i)); } } } }
/** * Method for collecting basic information on constructor(s) found */ protected void _addCreators(Map<String, POJOPropertyBuilder> props) { // can be null if annotation processing is disabled... if (!_useAnnotations) { return; } for (AnnotatedConstructor ctor : _classDef.getConstructors()) { if (_creatorProperties == null) { _creatorProperties = new LinkedList<POJOPropertyBuilder>(); } for (int i = 0, len = ctor.getParameterCount(); i < len; ++i) { _addCreatorParam(props, ctor.getParameter(i)); } } for (AnnotatedMethod factory : _classDef.getFactoryMethods()) { if (_creatorProperties == null) { _creatorProperties = new LinkedList<POJOPropertyBuilder>(); } for (int i = 0, len = factory.getParameterCount(); i < len; ++i) { _addCreatorParam(props, factory.getParameter(i)); } } }
_creatorProperties = new LinkedList<POJOPropertyBuilder>(); for (int i = 0, len = ctor.getParameterCount(); i < len; ++i) { AnnotatedParameter param = ctor.getParameter(i); String name = ai.findDeserializationName(param);
_creatorProperties = new LinkedList<POJOPropertyBuilder>(); for (int i = 0, len = ctor.getParameterCount(); i < len; ++i) { AnnotatedParameter param = ctor.getParameter(i); PropertyName pn = ai.findNameForDeserialization(param);
final int argCount = ctor.getParameterCount(); SettableBeanProperty[] properties = new SettableBeanProperty[argCount]; for (int i = 0; i < argCount; ++i) {