ch.dieseite.colladaloader.coreproc

## Class SaxParser.Context<CI,RI>

- java.lang.Object
- - ch.dieseite.colladaloader.coreproc.SaxParser.Context<CI,RI>

- Enclosing class:
    SaxParser<CI,RI>

      public static class SaxParser.Context<CI,RI>
      extends java.lang.Object

  A helper class

- a) to cache callbacks from SaxParser
- b) to define a certain tag in a certain xml tree to be found and
- c) additional infos what to do next with that Record

Author:
  mrcoffee

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private java.lang.String` | `cData` callback cache
    `private int` | `currentDepth` callback cache: walkthrough counter in xml tree
    `private java.util.List<SaxParser.Record<CI,RI>>` | `filteredChildren` callback cache: contains records if defined by nested context
    `CI` | `info` can be used by upper application Layer Sax parser does not use it.
    `private long` | `matchHistory` callback cache: 0=true (stays true if all tree walk through is match)
    `private SaxParser.Context<CI,RI>` | `parent` the context from relative parent Tag
    `private java.util.Properties` | `targetAttrVals` callback cache
    `private java.lang.String[]` | `xmlSearchPattern` search params

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `private` | `Context()`
    `private` | `Context(SaxParser.Context<CI,RI> parent, java.lang.String[] xmlSearchPattern)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `private void` | `decrementHistory()` focus back to prev upper level of xml depth
    `private void` | `incrementHistory()` focus to next deeper level of xml depth
    `private boolean` | `isMatch()` says if this level can be parsed Important; this method works only if inc/dec/updateHistory() is done before correctly i.e. oneOrMore: ( 1. inc(), 2.
    `private void` | `updateHistory(java.lang.String tagName, org.xml.sax.Attributes attributes)` check if current depth is a possible fetch tree.

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

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

- - ### Field Detail

    - #### xmlSearchPattern

          private java.lang.String[] xmlSearchPattern

      search params

    - #### parent

          private SaxParser.Context<CI,RI> parent

      the context from relative parent Tag

    - #### matchHistory

          private long matchHistory

      callback cache: 0=true (stays true if all tree walk through is match)

    - #### currentDepth

          private int currentDepth

      callback cache: walkthrough counter in xml tree

    - #### targetAttrVals

          private java.util.Properties targetAttrVals

      callback cache

    - #### cData

          private java.lang.String cData

      callback cache

    - #### filteredChildren

          private java.util.List<SaxParser.Record<CI,RI>> filteredChildren

      callback cache: contains records if defined by nested context

    - #### info

          public CI info

      can be used by upper application Layer Sax parser does not use it.

  - ### Constructor Detail

    - #### Context

          private Context()

    - #### Context

          private Context(SaxParser.Context<CI,RI> parent,
                          java.lang.String[] xmlSearchPattern)

  - ### Method Detail

    - #### isMatch

          private boolean isMatch()

      says if this level can be parsed Important; this method works only if inc/dec/updateHistory() is done before correctly i.e. oneOrMore: ( 1. inc(), 2. [dec()] update() ) Because size of history cache, the xml depth is limited to Long.BYTES*8 (=64)
      Parameters:
        `currentDepth` -
      Returns:

    - #### incrementHistory

          private void incrementHistory()

      focus to next deeper level of xml depth

    - #### decrementHistory

          private void decrementHistory()

      focus back to prev upper level of xml depth

    - #### updateHistory

          private void updateHistory(java.lang.String tagName,
                                     org.xml.sax.Attributes attributes)

      check if current depth is a possible fetch tree. It sets true/false to the current focused history stack The history keeps true if the whole walkthrough until target xml leaf tag is match
      Parameters:
        `currentDepth` -
        `tagName` - can be a "name" or fine search "name#attribName=value" this can help to distinguish same tags using their attributes
        `tagAttributes` -