/** * 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()) ); }
/** * Method that gets called when an unknown bean property name is encountered. * * @param propertyName The unknown bean property name. * @param beanMap The bean that doesn't have the expected property. * @throws ParseException * Automatically thrown if {@link BeanContext#BEAN_ignoreUnknownBeanProperties} setting on this parser is * <jk>false</jk> * @param <T> The class type of the bean map that doesn't have the expected property. */ protected final <T> void onUnknownProperty(String propertyName, BeanMap<T> beanMap) throws ParseException { if (propertyName.equals(getBeanTypePropertyName(beanMap.getClassMeta()))) return; if (! isIgnoreUnknownBeanProperties()) throw new ParseException(this, "Unknown property ''{0}'' encountered while trying to parse into class ''{1}''", propertyName, beanMap.getClassMeta()); if (listener != null) listener.onUnknownBeanProperty(this, propertyName, beanMap.getClassMeta().getInnerClass(), beanMap.getBean()); }
/** * Method that gets called when an unknown bean property name is encountered. * * @param propertyName The unknown bean property name. * @param beanMap The bean that doesn't have the expected property. * @throws ParseException * Automatically thrown if {@link BeanContext#BEAN_ignoreUnknownBeanProperties} setting on this parser is * <jk>false</jk> * @param <T> The class type of the bean map that doesn't have the expected property. */ protected final <T> void onUnknownProperty(String propertyName, BeanMap<T> beanMap) throws ParseException { if (propertyName.equals(getBeanTypePropertyName(beanMap.getClassMeta()))) return; if (! isIgnoreUnknownBeanProperties()) throw new ParseException(this, "Unknown property ''{0}'' encountered while trying to parse into class ''{1}''", propertyName, beanMap.getClassMeta()); if (listener != null) listener.onUnknownBeanProperty(this, propertyName, beanMap.getClassMeta().getInnerClass(), beanMap.getBean()); }
/** * Method that gets called when an unknown bean property name is encountered. * * @param propertyName The unknown bean property name. * @param beanMap The bean that doesn't have the expected property. * @throws ParseException * Automatically thrown if {@link BeanContext#BEAN_ignoreUnknownBeanProperties} setting on this parser is * <jk>false</jk> * @param <T> The class type of the bean map that doesn't have the expected property. */ protected final <T> void onUnknownProperty(String propertyName, BeanMap<T> beanMap) throws ParseException { if (propertyName.equals(getBeanTypePropertyName(beanMap.getClassMeta()))) return; if (! isIgnoreUnknownBeanProperties()) throw new ParseException(this, "Unknown property ''{0}'' encountered while trying to parse into class ''{1}''", propertyName, beanMap.getClassMeta()); if (listener != null) listener.onUnknownBeanProperty(this, propertyName, beanMap.getClassMeta().getInnerClass(), beanMap.getBean()); }
/** * 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()) ); }