/QingTingFanBianYi/src/com/alibaba/fastjson/serializer/FilterUtils.java

https://gitlab.com/qt-prometheus/qt-prometheus · Java · 428 lines · 399 code · 25 blank · 4 comment · 92 complexity · 0b04bf07bc650601b9baf35c6c5318e3 MD5 · raw file

  1. package com.alibaba.fastjson.serializer;
  2. import com.alibaba.fastjson.parser.DefaultJSONParser;
  3. import com.alibaba.fastjson.parser.deserializer.ExtraProcessor;
  4. import com.alibaba.fastjson.parser.deserializer.ExtraTypeProvider;
  5. import java.lang.reflect.Type;
  6. import java.util.Iterator;
  7. import java.util.List;
  8. public class FilterUtils
  9. {
  10. public static boolean apply(JSONSerializer paramJSONSerializer, Object paramObject, String paramString, byte paramByte)
  11. {
  12. paramJSONSerializer = paramJSONSerializer.getPropertyFiltersDirect();
  13. if (paramJSONSerializer != null)
  14. {
  15. boolean bool2 = true;
  16. paramJSONSerializer = paramJSONSerializer.iterator();
  17. do
  18. {
  19. bool1 = bool2;
  20. if (!paramJSONSerializer.hasNext())
  21. break;
  22. }
  23. while (((PropertyFilter)paramJSONSerializer.next()).apply(paramObject, paramString, Byte.valueOf(paramByte)));
  24. boolean bool1 = false;
  25. return bool1;
  26. }
  27. return true;
  28. }
  29. public static boolean apply(JSONSerializer paramJSONSerializer, Object paramObject, String paramString, char paramChar)
  30. {
  31. paramJSONSerializer = paramJSONSerializer.getPropertyFiltersDirect();
  32. if (paramJSONSerializer != null)
  33. {
  34. boolean bool2 = true;
  35. paramJSONSerializer = paramJSONSerializer.iterator();
  36. do
  37. {
  38. bool1 = bool2;
  39. if (!paramJSONSerializer.hasNext())
  40. break;
  41. }
  42. while (((PropertyFilter)paramJSONSerializer.next()).apply(paramObject, paramString, Character.valueOf(paramChar)));
  43. boolean bool1 = false;
  44. return bool1;
  45. }
  46. return true;
  47. }
  48. public static boolean apply(JSONSerializer paramJSONSerializer, Object paramObject, String paramString, double paramDouble)
  49. {
  50. paramJSONSerializer = paramJSONSerializer.getPropertyFiltersDirect();
  51. if (paramJSONSerializer != null)
  52. {
  53. boolean bool2 = true;
  54. paramJSONSerializer = paramJSONSerializer.iterator();
  55. do
  56. {
  57. bool1 = bool2;
  58. if (!paramJSONSerializer.hasNext())
  59. break;
  60. }
  61. while (((PropertyFilter)paramJSONSerializer.next()).apply(paramObject, paramString, Double.valueOf(paramDouble)));
  62. boolean bool1 = false;
  63. return bool1;
  64. }
  65. return true;
  66. }
  67. public static boolean apply(JSONSerializer paramJSONSerializer, Object paramObject, String paramString, float paramFloat)
  68. {
  69. paramJSONSerializer = paramJSONSerializer.getPropertyFiltersDirect();
  70. if (paramJSONSerializer != null)
  71. {
  72. boolean bool2 = true;
  73. paramJSONSerializer = paramJSONSerializer.iterator();
  74. do
  75. {
  76. bool1 = bool2;
  77. if (!paramJSONSerializer.hasNext())
  78. break;
  79. }
  80. while (((PropertyFilter)paramJSONSerializer.next()).apply(paramObject, paramString, Float.valueOf(paramFloat)));
  81. boolean bool1 = false;
  82. return bool1;
  83. }
  84. return true;
  85. }
  86. public static boolean apply(JSONSerializer paramJSONSerializer, Object paramObject, String paramString, int paramInt)
  87. {
  88. paramJSONSerializer = paramJSONSerializer.getPropertyFiltersDirect();
  89. if (paramJSONSerializer != null)
  90. {
  91. boolean bool2 = true;
  92. paramJSONSerializer = paramJSONSerializer.iterator();
  93. do
  94. {
  95. bool1 = bool2;
  96. if (!paramJSONSerializer.hasNext())
  97. break;
  98. }
  99. while (((PropertyFilter)paramJSONSerializer.next()).apply(paramObject, paramString, Integer.valueOf(paramInt)));
  100. boolean bool1 = false;
  101. return bool1;
  102. }
  103. return true;
  104. }
  105. public static boolean apply(JSONSerializer paramJSONSerializer, Object paramObject, String paramString, long paramLong)
  106. {
  107. paramJSONSerializer = paramJSONSerializer.getPropertyFiltersDirect();
  108. if (paramJSONSerializer != null)
  109. {
  110. boolean bool2 = true;
  111. paramJSONSerializer = paramJSONSerializer.iterator();
  112. do
  113. {
  114. bool1 = bool2;
  115. if (!paramJSONSerializer.hasNext())
  116. break;
  117. }
  118. while (((PropertyFilter)paramJSONSerializer.next()).apply(paramObject, paramString, Long.valueOf(paramLong)));
  119. boolean bool1 = false;
  120. return bool1;
  121. }
  122. return true;
  123. }
  124. public static boolean apply(JSONSerializer paramJSONSerializer, Object paramObject1, String paramString, Object paramObject2)
  125. {
  126. paramJSONSerializer = paramJSONSerializer.getPropertyFiltersDirect();
  127. if (paramJSONSerializer == null);
  128. do
  129. while (!paramJSONSerializer.hasNext())
  130. {
  131. return true;
  132. paramJSONSerializer = paramJSONSerializer.iterator();
  133. }
  134. while (((PropertyFilter)paramJSONSerializer.next()).apply(paramObject1, paramString, paramObject2));
  135. return false;
  136. }
  137. public static boolean apply(JSONSerializer paramJSONSerializer, Object paramObject, String paramString, short paramShort)
  138. {
  139. paramJSONSerializer = paramJSONSerializer.getPropertyFiltersDirect();
  140. if (paramJSONSerializer != null)
  141. {
  142. boolean bool2 = true;
  143. paramJSONSerializer = paramJSONSerializer.iterator();
  144. do
  145. {
  146. bool1 = bool2;
  147. if (!paramJSONSerializer.hasNext())
  148. break;
  149. }
  150. while (((PropertyFilter)paramJSONSerializer.next()).apply(paramObject, paramString, Short.valueOf(paramShort)));
  151. boolean bool1 = false;
  152. return bool1;
  153. }
  154. return true;
  155. }
  156. public static boolean applyName(JSONSerializer paramJSONSerializer, Object paramObject, String paramString)
  157. {
  158. Object localObject = paramJSONSerializer.getPropertyPreFiltersDirect();
  159. if (localObject == null);
  160. do
  161. while (!((Iterator)localObject).hasNext())
  162. {
  163. return true;
  164. localObject = ((List)localObject).iterator();
  165. }
  166. while (((PropertyPreFilter)((Iterator)localObject).next()).apply(paramJSONSerializer, paramObject, paramString));
  167. return false;
  168. }
  169. public static Type getExtratype(DefaultJSONParser paramDefaultJSONParser, Object paramObject, String paramString)
  170. {
  171. Object localObject = paramDefaultJSONParser.getExtraTypeProvidersDirect();
  172. if (localObject == null)
  173. paramDefaultJSONParser = null;
  174. while (true)
  175. {
  176. return paramDefaultJSONParser;
  177. paramDefaultJSONParser = null;
  178. localObject = ((List)localObject).iterator();
  179. while (((Iterator)localObject).hasNext())
  180. paramDefaultJSONParser = ((ExtraTypeProvider)((Iterator)localObject).next()).getExtraType(paramObject, paramString);
  181. }
  182. }
  183. public static void processExtra(DefaultJSONParser paramDefaultJSONParser, Object paramObject1, String paramString, Object paramObject2)
  184. {
  185. paramDefaultJSONParser = paramDefaultJSONParser.getExtraProcessorsDirect();
  186. if (paramDefaultJSONParser == null);
  187. while (true)
  188. {
  189. return;
  190. paramDefaultJSONParser = paramDefaultJSONParser.iterator();
  191. while (paramDefaultJSONParser.hasNext())
  192. ((ExtraProcessor)paramDefaultJSONParser.next()).processExtra(paramObject1, paramString, paramObject2);
  193. }
  194. }
  195. public static String processKey(JSONSerializer paramJSONSerializer, Object paramObject, String paramString, byte paramByte)
  196. {
  197. Object localObject = paramJSONSerializer.getNameFiltersDirect();
  198. paramJSONSerializer = paramString;
  199. if (localObject != null)
  200. {
  201. localObject = ((List)localObject).iterator();
  202. while (true)
  203. {
  204. paramJSONSerializer = paramString;
  205. if (!((Iterator)localObject).hasNext())
  206. break;
  207. paramString = ((NameFilter)((Iterator)localObject).next()).process(paramObject, paramString, Byte.valueOf(paramByte));
  208. }
  209. }
  210. return paramJSONSerializer;
  211. }
  212. public static String processKey(JSONSerializer paramJSONSerializer, Object paramObject, String paramString, char paramChar)
  213. {
  214. Object localObject = paramJSONSerializer.getNameFiltersDirect();
  215. paramJSONSerializer = paramString;
  216. if (localObject != null)
  217. {
  218. localObject = ((List)localObject).iterator();
  219. while (true)
  220. {
  221. paramJSONSerializer = paramString;
  222. if (!((Iterator)localObject).hasNext())
  223. break;
  224. paramString = ((NameFilter)((Iterator)localObject).next()).process(paramObject, paramString, Character.valueOf(paramChar));
  225. }
  226. }
  227. return paramJSONSerializer;
  228. }
  229. public static String processKey(JSONSerializer paramJSONSerializer, Object paramObject, String paramString, double paramDouble)
  230. {
  231. Object localObject = paramJSONSerializer.getNameFiltersDirect();
  232. paramJSONSerializer = paramString;
  233. if (localObject != null)
  234. {
  235. localObject = ((List)localObject).iterator();
  236. while (true)
  237. {
  238. paramJSONSerializer = paramString;
  239. if (!((Iterator)localObject).hasNext())
  240. break;
  241. paramString = ((NameFilter)((Iterator)localObject).next()).process(paramObject, paramString, Double.valueOf(paramDouble));
  242. }
  243. }
  244. return paramJSONSerializer;
  245. }
  246. public static String processKey(JSONSerializer paramJSONSerializer, Object paramObject, String paramString, float paramFloat)
  247. {
  248. Object localObject = paramJSONSerializer.getNameFiltersDirect();
  249. paramJSONSerializer = paramString;
  250. if (localObject != null)
  251. {
  252. localObject = ((List)localObject).iterator();
  253. while (true)
  254. {
  255. paramJSONSerializer = paramString;
  256. if (!((Iterator)localObject).hasNext())
  257. break;
  258. paramString = ((NameFilter)((Iterator)localObject).next()).process(paramObject, paramString, Float.valueOf(paramFloat));
  259. }
  260. }
  261. return paramJSONSerializer;
  262. }
  263. public static String processKey(JSONSerializer paramJSONSerializer, Object paramObject, String paramString, int paramInt)
  264. {
  265. Object localObject = paramJSONSerializer.getNameFiltersDirect();
  266. paramJSONSerializer = paramString;
  267. if (localObject != null)
  268. {
  269. localObject = ((List)localObject).iterator();
  270. while (true)
  271. {
  272. paramJSONSerializer = paramString;
  273. if (!((Iterator)localObject).hasNext())
  274. break;
  275. paramString = ((NameFilter)((Iterator)localObject).next()).process(paramObject, paramString, Integer.valueOf(paramInt));
  276. }
  277. }
  278. return paramJSONSerializer;
  279. }
  280. public static String processKey(JSONSerializer paramJSONSerializer, Object paramObject, String paramString, long paramLong)
  281. {
  282. Object localObject = paramJSONSerializer.getNameFiltersDirect();
  283. paramJSONSerializer = paramString;
  284. if (localObject != null)
  285. {
  286. localObject = ((List)localObject).iterator();
  287. while (true)
  288. {
  289. paramJSONSerializer = paramString;
  290. if (!((Iterator)localObject).hasNext())
  291. break;
  292. paramString = ((NameFilter)((Iterator)localObject).next()).process(paramObject, paramString, Long.valueOf(paramLong));
  293. }
  294. }
  295. return paramJSONSerializer;
  296. }
  297. public static String processKey(JSONSerializer paramJSONSerializer, Object paramObject1, String paramString, Object paramObject2)
  298. {
  299. Object localObject = paramJSONSerializer.getNameFiltersDirect();
  300. paramJSONSerializer = paramString;
  301. if (localObject != null)
  302. {
  303. localObject = ((List)localObject).iterator();
  304. while (true)
  305. {
  306. paramJSONSerializer = paramString;
  307. if (!((Iterator)localObject).hasNext())
  308. break;
  309. paramString = ((NameFilter)((Iterator)localObject).next()).process(paramObject1, paramString, paramObject2);
  310. }
  311. }
  312. return paramJSONSerializer;
  313. }
  314. public static String processKey(JSONSerializer paramJSONSerializer, Object paramObject, String paramString, short paramShort)
  315. {
  316. Object localObject = paramJSONSerializer.getNameFiltersDirect();
  317. paramJSONSerializer = paramString;
  318. if (localObject != null)
  319. {
  320. localObject = ((List)localObject).iterator();
  321. while (true)
  322. {
  323. paramJSONSerializer = paramString;
  324. if (!((Iterator)localObject).hasNext())
  325. break;
  326. paramString = ((NameFilter)((Iterator)localObject).next()).process(paramObject, paramString, Short.valueOf(paramShort));
  327. }
  328. }
  329. return paramJSONSerializer;
  330. }
  331. public static String processKey(JSONSerializer paramJSONSerializer, Object paramObject, String paramString, boolean paramBoolean)
  332. {
  333. Object localObject = paramJSONSerializer.getNameFiltersDirect();
  334. paramJSONSerializer = paramString;
  335. if (localObject != null)
  336. {
  337. localObject = ((List)localObject).iterator();
  338. while (true)
  339. {
  340. paramJSONSerializer = paramString;
  341. if (!((Iterator)localObject).hasNext())
  342. break;
  343. paramString = ((NameFilter)((Iterator)localObject).next()).process(paramObject, paramString, Boolean.valueOf(paramBoolean));
  344. }
  345. }
  346. return paramJSONSerializer;
  347. }
  348. public static Object processValue(JSONSerializer paramJSONSerializer, Object paramObject1, String paramString, Object paramObject2)
  349. {
  350. Object localObject = paramJSONSerializer.getValueFiltersDirect();
  351. paramJSONSerializer = paramObject2;
  352. if (localObject != null)
  353. {
  354. localObject = ((List)localObject).iterator();
  355. while (true)
  356. {
  357. paramJSONSerializer = paramObject2;
  358. if (!((Iterator)localObject).hasNext())
  359. break;
  360. paramObject2 = ((ValueFilter)((Iterator)localObject).next()).process(paramObject1, paramString, paramObject2);
  361. }
  362. }
  363. return paramJSONSerializer;
  364. }
  365. public static char writeAfter(JSONSerializer paramJSONSerializer, Object paramObject, char paramChar)
  366. {
  367. Object localObject = paramJSONSerializer.getAfterFiltersDirect();
  368. char c = paramChar;
  369. if (localObject != null)
  370. {
  371. localObject = ((List)localObject).iterator();
  372. while (true)
  373. {
  374. c = paramChar;
  375. if (!((Iterator)localObject).hasNext())
  376. break;
  377. paramChar = ((AfterFilter)((Iterator)localObject).next()).writeAfter(paramJSONSerializer, paramObject, paramChar);
  378. }
  379. }
  380. return c;
  381. }
  382. public static char writeBefore(JSONSerializer paramJSONSerializer, Object paramObject, char paramChar)
  383. {
  384. Object localObject = paramJSONSerializer.getBeforeFiltersDirect();
  385. char c = paramChar;
  386. if (localObject != null)
  387. {
  388. localObject = ((List)localObject).iterator();
  389. while (true)
  390. {
  391. c = paramChar;
  392. if (!((Iterator)localObject).hasNext())
  393. break;
  394. paramChar = ((BeforeFilter)((Iterator)localObject).next()).writeBefore(paramJSONSerializer, paramObject, paramChar);
  395. }
  396. }
  397. return c;
  398. }
  399. }
  400. /* Location: C:\Users\User\dex2jar-2.0\dex\qting\classes-dex2jar.jar
  401. * Qualified Name: com.alibaba.fastjson.serializer.FilterUtils
  402. * JD-Core Version: 0.6.2
  403. */