XmlOccurrenceMarker
Date: 2017-02-11

org.fife.ui.rsyntaxtextarea

## Class XmlOccurrenceMarker

- java.lang.Object
- - org.fife.ui.rsyntaxtextarea.XmlOccurrenceMarker

- All Implemented Interfaces:
    OccurrenceMarker

      public class XmlOccurrenceMarker
      extends java.lang.Object
      implements OccurrenceMarker

  Marks occurrences of the current token for XML.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `XmlOccurrenceMarker()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Token` | `getTokenToMark(RSyntaxTextArea textArea)` Returns the token to mark occurrences, of, provided it matches the criteria put forth by `OccurrenceMarker.isValidType(RSyntaxTextArea, Token)`.
    `boolean` | `isValidType(RSyntaxTextArea textArea, Token t)` Returns whether the specified token is a type that we can do a "mark occurrences" of.
    `void` | `markOccurrences(RSyntaxDocument doc, Token t, RSyntaxTextAreaHighlighter h, SmartHighlightPainter p)` Called when occurrences of a token should be marked.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### XmlOccurrenceMarker

          public XmlOccurrenceMarker()

  - ### Method Detail

    - #### getTokenToMark

          public Token getTokenToMark(RSyntaxTextArea textArea)

      Returns the token to mark occurrences, of, provided it matches the criteria put forth by `OccurrenceMarker.isValidType(RSyntaxTextArea, Token)`. For most languages, this method should return the token at the caret position.
      Specified by:
        `getTokenToMark` in interface `OccurrenceMarker`
      Parameters:
        `textArea` - The text area.
      Returns:
        The token to (possibly) mark occurrences of, or `null` if none.

    - #### isValidType

          public boolean isValidType(RSyntaxTextArea textArea,
                            Token t)

      Returns whether the specified token is a type that we can do a "mark occurrences" of. Typically, this will delegate to `RSyntaxTextArea.getMarkOccurrencesOfTokenType(int)`.
      Specified by:
        `isValidType` in interface `OccurrenceMarker`
      Parameters:
        `textArea` - The text area.
        `t` - The token.
      Returns:
        Whether we should mark all occurrences of this token.

    - #### markOccurrences

          public void markOccurrences(RSyntaxDocument doc,
                             Token t,
                             RSyntaxTextAreaHighlighter h,
                             SmartHighlightPainter p)

      Called when occurrences of a token should be marked.
      Specified by:
        `markOccurrences` in interface `OccurrenceMarker`
      Parameters:
        `doc` - The document.
        `t` - The document whose relevant occurrences should be marked.
        `h` - The highlighter to add the highlights to.
        `p` - The painter for the highlights.