Package org.apache.juneau.parser
Class ParserListener
java.lang.Object
org.apache.juneau.parser.ParserListener
- Direct Known Subclasses:
ParserListener.Void
Class for listening for certain parse events during a document parse.
See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classRepresents no parser listener. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonBeanSetterException(ParserSession session, Throwable t, BeanPropertyMeta p) Called when an exception is thrown when trying to call a bean setter method.voidonError(ParserSession session, Throwable t, String msg) Called when an error occurs during parsing but is ignored.<T> voidonUnknownBeanProperty(ParserSession session, String propertyName, Class<T> beanClass, T bean) Gets called when an unknown bean property is detected in a document.
-
Constructor Details
-
ParserListener
public ParserListener()
-
-
Method Details
-
onBeanSetterException
Called when an exception is thrown when trying to call a bean setter method.- Parameters:
session- The serializer session.t- The throwable that was thrown by the setter method.p- The bean property we had an issue on.
-
onError
Called when an error occurs during parsing but is ignored.- Parameters:
session- The parser session.t- The throwable that was thrown by the getter method.msg- The error message.
-
onUnknownBeanProperty
public <T> void onUnknownBeanProperty(ParserSession session, String propertyName, Class<T> beanClass, T bean) Gets called when an unknown bean property is detected in a document.This method only gets called if
BeanContext.Builder.ignoreUnknownBeanProperties()setting istrue . Otherwise, the parser will throw aParseException.- Type Parameters:
T- The class type of the bean.- Parameters:
session- The parser session.propertyName- The property name encountered in the document.beanClass- The bean class.bean- The bean.
-