@Override /* ParserListener */ public <T> void onUnknownBeanProperty(ParserSession session, String propertyName, Class<T> beanClass, T bean) { events.add(propertyName + ", " + session.getPosition()); } }
@Override /* ParserListener */ public <T> void onUnknownBeanProperty(ParserSession session, String propertyName, Class<T> beanClass, T bean) { events.add(propertyName + ", " + session.getPosition()); } }
@Override /* ParserListener */ public <T> void onUnknownBeanProperty(ParserSession session, String propertyName, Class<T> beanClass, T bean) { events.add(propertyName + ", " + session.getPosition()); } }
@Override /* ParserListener */ public <T> void onUnknownBeanProperty(ParserSession session, String propertyName, Class<T> beanClass, T bean) { events.add(propertyName + ", " + session.getPosition()); } }
@Override /* ParserListener */ public <T> void onUnknownBeanProperty(ParserSession session, String propertyName, Class<T> beanClass, T bean) { events.add(propertyName + ", " + session.getPosition()); } }
@Override /* ParserListener */ public <T> void onUnknownBeanProperty(ParserSession session, String propertyName, Class<T> beanClass, T bean) { events.add(propertyName + ", " + session.getPosition()); } }
/** * Gets called when an unknown bean property is detected in a document. * * <p> * This method only gets called if {@link BeanContext#BEAN_ignoreUnknownBeanProperties} setting is <jk>true</jk>. * Otherwise, the parser will throw a {@link ParseException}. * * @param <T> The class type of the bean. * @param session The parser session. * @param propertyName The property name encountered in the document. * @param beanClass The bean class. * @param bean The bean. */ public <T> void onUnknownBeanProperty(ParserSession session, String propertyName, Class<T> beanClass, T bean) { onError(session, null, format("Unknown property ''{0}'' encountered while trying to parse into class ''{1}'' at location {2}", propertyName, beanClass, session.getPosition()) ); }
/** * Gets called when an unknown bean property is detected in a document. * * <p> * This method only gets called if {@link BeanContext#BEAN_ignoreUnknownBeanProperties} setting is <jk>true</jk>. * Otherwise, the parser will throw a {@link ParseException}. * * @param <T> The class type of the bean. * @param session The parser session. * @param propertyName The property name encountered in the document. * @param beanClass The bean class. * @param bean The bean. */ public <T> void onUnknownBeanProperty(ParserSession session, String propertyName, Class<T> beanClass, T bean) { onError(session, null, format("Unknown property ''{0}'' encountered while trying to parse into class ''{1}'' at location {2}", propertyName, beanClass, session.getPosition()) ); }
/** * Gets called when an unknown bean property is detected in a document. * * <p> * This method only gets called if {@link BeanContext#BEAN_ignoreUnknownBeanProperties} setting is <jk>true</jk>. * Otherwise, the parser will throw a {@link ParseException}. * * @param <T> The class type of the bean. * @param session The parser session. * @param propertyName The property name encountered in the document. * @param beanClass The bean class. * @param bean The bean. */ public <T> void onUnknownBeanProperty(ParserSession session, String propertyName, Class<T> beanClass, T bean) { onError(session, null, format("Unknown property ''{0}'' encountered while trying to parse into class ''{1}'' at location {2}", propertyName, beanClass, session.getPosition()) ); }
private static String getMessage(ParserSession session, String msg, Object... args) { if (args.length != 0) msg = format(msg, args); if (session != null) { Position p = session.getPosition(); msg += "\n\tAt: " + p; ObjectMap lastLocation = session.getLastLocation(); if (lastLocation != null) { msg += "\n\tWhile parsing into: "; for (Map.Entry<String,Object> e : lastLocation.entrySet()) msg += "\n\t\t" + e.getKey() + ": " + e.getValue(); } String lines = session.getInputAsString(); if (lines == null) msg += "\n\tUse BEAN_debug setting to display content."; else { int numLines = session.getDebugOutputLines(); int start = p.line - numLines, end = p.line + numLines; msg += "\n---start--\n" + StringUtils.getNumberedLines(lines, start, end) + "---end---"; } } return msg; }
private static String getMessage(ParserSession session, String msg, Object... args) { if (args.length != 0) msg = format(msg, args); if (session != null) { Position p = session.getPosition(); msg += "\n\tAt: " + p; ObjectMap lastLocation = session.getLastLocation(); if (lastLocation != null) { msg += "\n\tWhile parsing into: "; for (Map.Entry<String,Object> e : lastLocation.entrySet()) msg += "\n\t\t" + e.getKey() + ": " + e.getValue(); } String lines = session.getInputAsString(); if (lines == null) msg += "\n\tUse BEAN_debug setting to display content."; else { int numLines = session.getDebugOutputLines(); int start = p.line - numLines, end = p.line + numLines; msg += "\n---start--\n" + StringUtils.getNumberedLines(lines, start, end) + "---end---"; } } return msg; }
private static String getMessage(ParserSession session, String msg, Object... args) { if (args.length != 0) msg = format(msg, args); if (session != null) { Position p = session.getPosition(); msg += "\n\tAt: " + p; ObjectMap lastLocation = session.getLastLocation(); if (lastLocation != null) { msg += "\n\tWhile parsing into: "; for (Map.Entry<String,Object> e : lastLocation.entrySet()) msg += "\n\t\t" + e.getKey() + ": " + e.getValue(); } String lines = session.getInputAsString(); if (lines == null) msg += "\n\tUse BEAN_debug setting to display content."; else { int numLines = session.getDebugOutputLines(); int start = p.line - numLines, end = p.line + numLines; msg += "\n---start--\n" + StringUtils.getNumberedLines(lines, start, end) + "---end---"; } } return msg; }