public FactoryBasedDeserializer(Class<?> cls, AnnotatedMethod f, Class<?> inputType) { super(Enum.class); _enumClass = cls; _factory = f.getAnnotated(); _inputType = inputType; }
public MethodProperty(String name, JavaType type, TypeDeserializer typeDeser, Annotations contextAnnotations, AnnotatedMethod method) { super(name, type, typeDeser, contextAnnotations); _annotated = method; _setter = method.getAnnotated(); }
public AnyGetterWriter(AnnotatedMethod anyGetter, MapSerializer serializer) { _anyGetter = anyGetter.getAnnotated(); _serializer = serializer; }
public SetterlessProperty(String name, JavaType type, TypeDeserializer typeDeser, Annotations contextAnnotations, AnnotatedMethod method) { super(name, type, typeDeser, contextAnnotations); _annotated = method; _getter = method.getAnnotated(); }
public SettableAnyProperty(BeanProperty property, AnnotatedMethod setter, JavaType type, JsonDeserializer<Object> valueDeser) { this(property, setter.getAnnotated(), type, valueDeser); }
/** * Method called to add specified annotated method in the Map. */ public void add(AnnotatedMethod am) { if (_methods == null) { _methods = new LinkedHashMap<MemberKey,AnnotatedMethod>(); } _methods.put(new MemberKey(am.getAnnotated()), am); }
@Override public boolean isSetterVisible(AnnotatedMethod m) { return isSetterVisible(m.getAnnotated()); }
/** * Method called to remove specified method, assuming * it exists in the Map */ public AnnotatedMethod remove(AnnotatedMethod am) { return remove(am.getAnnotated()); }
@Override public boolean isIsGetterVisible(AnnotatedMethod m) { return isIsGetterVisible(m.getAnnotated()); }
@Override public boolean isGetterVisible(AnnotatedMethod m) { return isGetterVisible(m.getAnnotated()); }
protected void _addFactoryMixIns(Class<?> mixin) { MemberKey[] methodKeys = null; int methodCount = _creatorMethods.size(); for (Method m : mixin.getDeclaredMethods()) { if (!Modifier.isStatic(m.getModifiers())) { continue; } if (m.getParameterTypes().length == 0) { continue; } if (methodKeys == null) { methodKeys = new MemberKey[methodCount]; for (int i = 0; i < methodCount; ++i) { methodKeys[i] = new MemberKey(_creatorMethods.get(i).getAnnotated()); } } MemberKey key = new MemberKey(m); for (int i = 0; i < methodCount; ++i) { if (!key.equals(methodKeys[i])) { continue; } _addMixOvers(m, _creatorMethods.get(i), true); break; } } }
/** * Method that can be called to find if introspected class declares * a static "valueOf" factory method that returns an instance of * introspected type, given one of acceptable types. * * @param expArgTypes Types that the matching single argument factory * method can take: will also accept super types of these types * (ie. arg just has to be assignable from expArgType) */ public Method findFactoryMethod(Class<?>... expArgTypes) { // So, of all single-arg static methods: for (AnnotatedMethod am : _classInfo.getStaticMethods()) { if (isFactoryMethod(am)) { // And must take one of expected arg types (or supertype) Class<?> actualArgType = am.getParameterClass(0); for (Class<?> expArgType : expArgTypes) { // And one that matches what we would pass in if (actualArgType.isAssignableFrom(expArgType)) { return am.getAnnotated(); } } } } return null; }
if (valueMethod != null) { Method m = valueMethod.getAnnotated(); if (config.isEnabled(SerializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS)) { ClassUtil.checkAndFixAccess(m);
_addMixOvers(old.getAnnotated(), newM, false);
public FactoryBasedDeserializer(Class<?> cls, AnnotatedMethod f, Class<?> inputType) { super(Enum.class); _enumClass = cls; _factory = f.getAnnotated(); _inputType = inputType; }
public AnyGetterWriter(AnnotatedMethod anyGetter, MapSerializer serializer) { _anyGetter = anyGetter.getAnnotated(); _serializer = serializer; }
if (m != null) { AnnotatedMethod am = _constructMethod(m); _addMixOvers(mixIn.getAnnotated(), am, false); _memberMethods.add(am);
f = ((AnnotatedField) am).getAnnotated(); } else { m = ((AnnotatedMethod) am).getAnnotated(); f = null;
/** * Method called to add specified annotated method in the Map. */ public void add(AnnotatedMethod am) { if (_methods == null) { _methods = new LinkedHashMap<MemberKey,AnnotatedMethod>(); } _methods.put(new MemberKey(am.getAnnotated()), am); }
@Override public boolean isSetterVisible(AnnotatedMethod m) { return isSetterVisible(m.getAnnotated()); }