Class PlistReader

Object
PlistReader
All Implemented Interfaces:
Iterator<PlistTag>

public class PlistReader extends Object implements Iterator<PlistTag>
Iterator over tags in plist-string.
Author:
Christoph Hauert
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) PlistTag
    Buffered tag to return on the next next() call.
    (package private) static final String
    Tag identifying DOCTYPE declaration.
    (package private) boolean
    true if done reading the plist-string.
    (package private) boolean
    true if no processing has occurred yet.
    (package private) String
    Remainder of plist-string.
    (package private) int
    Number of lines read in plist-string.
    (package private) String
    Name of root tag as specified in DOCTYPE declaration
    (package private) PlistTag
    Next tag.
    (package private) static final String
    Tag identifying start of XML declaration.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create reader for plist-string.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Return line number of last line read.
    boolean
     
     
    protected void
    Parse (and discard) header of plist-string.
    (package private) void
    Push a tag to the stream and return it on the next next() call.
    private void
    Utility method to skip comments in plist-string.

    Methods inherited from class Object

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

    Methods inherited from interface Iterator

    forEachRemaining, remove
  • Field Details

    • DOCTYPE_TAG

      static final String DOCTYPE_TAG
      Tag identifying DOCTYPE declaration.
      See Also:
    • XML_TAG

      static final String XML_TAG
      Tag identifying start of XML declaration.
      See Also:
    • read

      int read
      Number of lines read in plist-string.
    • line

      String line
      Remainder of plist-string.
    • root

      String root
      Name of root tag as specified in DOCTYPE declaration
    • done

      boolean done
      true if done reading the plist-string.
    • tag

      Next tag.
    • buffered

      PlistTag buffered
      Buffered tag to return on the next next() call.
    • isVirgin

      boolean isVirgin
      true if no processing has occurred yet. In particular this means that the header has not yet been parsed.
      See Also:
  • Constructor Details

  • Method Details

    • parseHeader

      protected void parseHeader()
      Parse (and discard) header of plist-string. Performs only very rudimentary sanity checks.
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<PlistTag>
    • next

      public PlistTag next()
      Specified by:
      next in interface Iterator<PlistTag>
    • skipComments

      private void skipComments()
      Utility method to skip comments in plist-string.
    • getLine

      public int getLine()
      Return line number of last line read. This is mainly useful to provide some context in case an error or inconsistency is encountered.
      Returns:
      last line read
    • pushTag

      void pushTag(PlistTag aTag)
      Push a tag to the stream and return it on the next next() call.
      Parameters:
      aTag - the tag to push back