Interface XmlVisitor.TextPredictor

All Known Implementing Classes:
UnmarshallingContext
Enclosing interface:
XmlVisitor

public static interface XmlVisitor.TextPredictor
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if the visitor is expecting a text event as the next event.
  • Method Details

    • expectText

      boolean expectText()
      Returns true if the visitor is expecting a text event as the next event.

      This is primarily intended to be used for optimization to avoid buffering characters unnecessarily. If this method returns false and the connector sees whitespace it can safely skip it.

      If this method returns true, all the whitespaces are considered significant and thus need to be reported as a XmlVisitor.text(java.lang.CharSequence) event. Furthermore, if the element has no children (like <foo/>), then it has to be reported an empty XmlVisitor.text(java.lang.CharSequence) event.