/** * Same as {@link #parse(Object, Type, Type...)} except the type has already been converted into a {@link ClassMeta} * object. * * <p> * This is mostly an internal method used by the framework. * * @param <T> The class type of the object being created. * @param input * The input. * See {@link #parse(Object, Type, Type...)} for details. * @param type The object type to create. * @return The parsed object. * @throws ParseException * If the input contains a syntax error or is malformed, or is not valid for the specified type. */ public final <T> T parse(Object input, ClassMeta<T> type) throws ParseException { return createSession().parse(input, type); }
/** * Same as {@link #parse(Object, Type, Type...)} except the type has already been converted into a {@link ClassMeta} * object. * * <p> * This is mostly an internal method used by the framework. * * @param <T> The class type of the object being created. * @param input * The input. * See {@link #parse(Object, Type, Type...)} for details. * @param type The object type to create. * @return The parsed object. * @throws ParseException * If the input contains a syntax error or is malformed, or is not valid for the specified type. */ public final <T> T parse(Object input, ClassMeta<T> type) throws ParseException { return createSession().parse(input, type); }
/** * Same as {@link #parse(Object, Type, Type...)} except the type has already been converted into a {@link ClassMeta} * object. * * <p> * This is mostly an internal method used by the framework. * * @param <T> The class type of the object being created. * @param input * The input. * See {@link #parse(Object, Type, Type...)} for details. * @param type The object type to create. * @return The parsed object. * @throws ParseException * If the input contains a syntax error or is malformed, or is not valid for the specified type. */ public final <T> T parse(Object input, ClassMeta<T> type) throws ParseException { return createSession().parse(input, type); }
return p.createSession().parse(input, type);
return createSession().parse(input, type);
return p.createSession().parse(input, type);
return p.createSession().parse(input, type);
return createSession().parse(input, type);
return createSession().parse(input, type);
return p.createSession().parse(input, type, args);
return createSession().parse(input, type, args);
return p.createSession().parse(input, type, args);
@Override /* MessageBodyReader */ public Object readFrom(Class<Object> type, Type gType, Annotation[] a, MediaType mediaType, MultivaluedMap<String,String> headers, InputStream in) throws IOException, WebApplicationException { try { ParserMatch pm = parsers.getParserMatch(mediaType.toString()); if (pm == null) throw new WebApplicationException(SC_UNSUPPORTED_MEDIA_TYPE); Parser p = pm.getParser(); ObjectMap mp = getMethodProperties(a); mp.put("mediaType", mediaType.toString()); Locale locale = getLocale(headers); TimeZone timeZone = getTimeZone(headers); ParserSession session = p.createSession(new ParserSessionArgs(mp, null, locale, timeZone, pm.getMediaType(), null, null, null)); Object in2 = session.isReaderParser() ? new InputStreamReader(in, UTF8) : in; return session.parse(in2, p.getClassMeta(gType)); } catch (ParseException e) { throw new IOException(e); } }
@Override /* MessageBodyReader */ public Object readFrom(Class<Object> type, Type gType, Annotation[] a, MediaType mediaType, MultivaluedMap<String,String> headers, InputStream in) throws IOException, WebApplicationException { try { ParserMatch pm = parsers.getParserMatch(mediaType.toString()); if (pm == null) throw new WebApplicationException(SC_UNSUPPORTED_MEDIA_TYPE); Parser p = pm.getParser(); ObjectMap mp = getMethodProperties(a); mp.put("mediaType", mediaType.toString()); Locale locale = getLocale(headers); TimeZone timeZone = getTimeZone(headers); ParserSession session = p.createSession(new ParserSessionArgs(mp, null, locale, timeZone, pm.getMediaType(), null, null, null)); Object in2 = session.isReaderParser() ? new InputStreamReader(in, UTF8) : in; return session.parse(in2, p.getClassMeta(gType)); } catch (ParseException e) { throw new IOException(e); } }
return parser.createSession(pArgs).parse(in, type);
return parser.createSession(pArgs).parse(in, type);
return parser.createSession(pArgs).parse(in, type);
ParserSession session = p.createSession(pArgs); try (Closeable in = session.isReaderParser() ? getUnbufferedReader() : getInputStream()) { T o = session.parse(in, cm); if (schema != null) schema.validateOutput(o, cm.getBeanContext());
ParserSession session = p.createSession(pArgs); try (Closeable in = session.isReaderParser() ? getUnbufferedReader() : getInputStream()) { T o = session.parse(in, cm); if (schema != null) schema.validateOutput(o, cm.getBeanContext());
ParserSession session = p.createSession(pArgs); try (Closeable in = session.isReaderParser() ? getUnbufferedReader() : getInputStream()) { T o = session.parse(in, cm); if (schema != null) schema.validateOutput(o, cm.getBeanContext());