public class ParserListener extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ParserListener.Null
Represents no parser listener.
|
Constructor and Description |
---|
ParserListener() |
Modifier and Type | Method and Description |
---|---|
void |
onError(ParserSession session,
ParserPipe pipe,
Throwable t,
String msg)
Called when an error occurs during parsing but is ignored.
|
<T> void |
onUnknownBeanProperty(ParserSession session,
ParserPipe pipe,
String propertyName,
Class<T> beanClass,
T bean,
int line,
int col)
Gets called when an unknown bean property is detected in a document.
|
public ParserListener()
public <T> void onUnknownBeanProperty(ParserSession session, ParserPipe pipe, String propertyName, Class<T> beanClass, T bean, int line, int col)
This method only gets called if BeanContext.BEAN_ignoreUnknownBeanProperties
setting is ParseException
.
T
- The class type of the bean.session
- The parser session.pipe
- The parser input.
Note that if BeanContext.BEAN_debug
is enabled on the parser, you can get the input as a string through
ParserPipe.getInputAsString()
.propertyName
- The property name encountered in the document.beanClass
- The bean class.bean
- The bean.line
- The line number where the unknown property was found (-1 if parser doesn't support line/column indicators).col
- The column number where the unknown property was found (-1 if parser doesn't support line/column indicators).public void onError(ParserSession session, ParserPipe pipe, Throwable t, String msg)
session
- The parser session.pipe
- The parser input.
Note that if BeanContext.BEAN_debug
is enabled on the parser, you can get the input as a string through
ParserPipe.getInputAsString()
.t
- The throwable that was thrown by the getter method.msg
- The error message.Copyright © 2018 Apache. All rights reserved.