fieldAnnotation = (JSONField) paramAnnotation;
break;
}
}
if (fieldAnnotation == null) {
throw new JSONException("illegal json creator");
}
Class<?> fieldClass = creatorConstructor.getParameterTypes()[i];
Type fieldType = creatorConstructor.getGenericParameterTypes()[i];
Field field = getField(clazz, fieldAnnotation.name());
FieldInfo fieldInfo = new FieldInfo(fieldAnnotation.name(), clazz, fieldClass, fieldType, field);
beanInfo.add(fieldInfo);
}
return beanInfo;
}
Method factoryMethod = getFactoryMethod(clazz);
if (factoryMethod != null) {
factoryMethod.setAccessible(true);
beanInfo.setFactoryMethod(factoryMethod);
for (int i = 0; i < factoryMethod.getParameterTypes().length; ++i) {
Annotation[] paramAnnotations = factoryMethod.getParameterAnnotations()[i];
JSONField fieldAnnotation = null;
for (Annotation paramAnnotation : paramAnnotations) {
if (paramAnnotation instanceof JSONField) {
fieldAnnotation = (JSONField) paramAnnotation;
break;
}
}
if (fieldAnnotation == null) {
throw new JSONException("illegal json creator");
}
Class<?> fieldClass = factoryMethod.getParameterTypes()[i];
Type fieldType = factoryMethod.getGenericParameterTypes()[i];
Field field = getField(clazz, fieldAnnotation.name());
FieldInfo fieldInfo = new FieldInfo(fieldAnnotation.name(), clazz, fieldClass, fieldType, field);
beanInfo.add(fieldInfo);
}
return beanInfo;
}
throw new JSONException("default constructor not found. " + clazz);
}
for (Method method : clazz.getMethods()) {
String methodName = method.getName();
if (methodName.length() < 4) {