com.alibaba.fastjson.parser.deserializer.ParseProcess Java Examples
The following examples show how to use
com.alibaba.fastjson.parser.deserializer.ParseProcess.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ReflectUtil.java From game-server with MIT License | 6 votes |
/** * wzy扩展 * * @param input * @param value * @param config * @param processor * @param featureValues * @param features */ private static void reflectObject(String input, Object value, ParserConfig config, ParseProcess processor, int featureValues, Feature... features) { if (input == null) { return; } for (Feature featrue : features) { featureValues = Feature.config(featureValues, featrue, true); } DefaultJSONParser parser = new DefaultJSONParser(input, config, featureValues); if (processor instanceof ExtraTypeProvider) { parser.getExtraTypeProviders().add((ExtraTypeProvider) processor); } if (processor instanceof ExtraProcessor) { parser.getExtraProcessors().add((ExtraProcessor) processor); } parser.parseObject(value); parser.handleResovleTask(value); parser.close(); }
Example #2
Source File: JSON.java From uavstack with Apache License 2.0 | 5 votes |
@SuppressWarnings("unchecked") public static <T> T parseObject(String input, Type clazz, ParserConfig config, ParseProcess processor, int featureValues, Feature... features) { if (input == null) { return null; } if (features != null) { for (Feature feature : features) { featureValues |= feature.mask; } } DefaultJSONParser parser = new DefaultJSONParser(input, config, featureValues); if (processor != null) { if (processor instanceof ExtraTypeProvider) { parser.getExtraTypeProviders().add((ExtraTypeProvider) processor); } if (processor instanceof ExtraProcessor) { parser.getExtraProcessors().add((ExtraProcessor) processor); } if (processor instanceof FieldTypeResolver) { parser.setFieldTypeResolver((FieldTypeResolver) processor); } } T value = (T) parser.parseObject(clazz, null); parser.handleResovleTask(value); parser.close(); return (T) value; }
Example #3
Source File: Jsoner.java From ICERest with Apache License 2.0 | 5 votes |
public static <T> T toObject(String json, Class<T> clazz, ParseProcess processor) { try { if (deserializerFeatures != null) { return JSON.parseObject(json, clazz, processor, deserializerFeatures); } else { return JSON.parseObject(json, clazz, processor); } } catch (JSONException e) { throw new JsonException("Could not cast \"" + json + "\" to " + clazz.getName(), e); } }
Example #4
Source File: Jsoner.java From ICERest with Apache License 2.0 | 5 votes |
public static <T> T toObject(String json, Class<T> clazz, ParseProcess processor, Feature... features) { try { return JSON.parseObject(json, clazz, processor, features); } catch (JSONException e) { throw new JsonException("Could not cast \"" + json + "\" to " + clazz.getName(), e); } }
Example #5
Source File: Jsoner.java From ICERest with Apache License 2.0 | 5 votes |
public static <T> T toObject(String json, Type type, ParseProcess processor) { try { if (deserializerFeatures != null) { return JSON.parseObject(json, type, processor, deserializerFeatures); } else { return JSON.parseObject(json, type, processor); } } catch (JSONException e) { throw new JsonException("Could not cast \"" + json + "\" to " + type.getClass().getName(), e); } }
Example #6
Source File: Jsoner.java From ICERest with Apache License 2.0 | 5 votes |
public static <T> T toObject(String json, Type type, ParseProcess processor, Feature... features) { try { return JSON.parseObject(json, type, processor, features); } catch (JSONException e) { throw new JsonException("Could not cast \"" + json + "\" to " + type.getClass().getName(), e); } }
Example #7
Source File: JSON.java From uavstack with Apache License 2.0 | 4 votes |
@SuppressWarnings("unchecked") public static <T> T parseObject(String text, Class<T> clazz, ParseProcess processor, Feature... features) { return (T) parseObject(text, (Type) clazz, ParserConfig.global, processor, DEFAULT_PARSER_FEATURE, features); }
Example #8
Source File: JSON.java From uavstack with Apache License 2.0 | 4 votes |
@SuppressWarnings("unchecked") public static <T> T parseObject(String input, Type clazz, ParseProcess processor, Feature... features) { return (T) parseObject(input, clazz, ParserConfig.global, processor, DEFAULT_PARSER_FEATURE, features); }