PDF Clown
0.1.2

org.pdfclown.tokens
Class BaseParser

java.lang.Object
  extended by org.pdfclown.util.parsers.PostScriptParser
      extended by org.pdfclown.tokens.BaseParser
All Implemented Interfaces:
Closeable
Direct Known Subclasses:
ContentParser, FileParser

public class BaseParser
extends PostScriptParser

Base PDF parser [PDF:1.7:3.2].

Since:
0.1.1
Version:
0.1.2, 08/23/12
Author:
Stefano Chizzolini (http://www.stefanochizzolini.it)

Nested Class Summary
 
Nested classes/interfaces inherited from class org.pdfclown.util.parsers.PostScriptParser
PostScriptParser.TokenTypeEnum
 
Constructor Summary
protected BaseParser(byte[] data)
           
protected BaseParser(IInputStream stream)
           
 
Method Summary
 boolean moveNext()
          Moves the pointer to the next token.
 PdfDataObject parsePdfObject()
          Parses the current PDF object [PDF:1.6:3.2].
 PdfDataObject parsePdfObject(int offset)
          Parses a PDF object after moving to the given token offset.
 
Methods inherited from class org.pdfclown.util.parsers.PostScriptParser
close, finalize, getHex, getLength, getPosition, getStream, getToken, getToken, getTokenType, hashCode, isDelimiter, isEOL, isWhitespace, moveNext, seek, setToken, setTokenType, skip, skipEOL, skipWhitespace
 
Methods inherited from class java.lang.Object
clone, equals, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseParser

protected BaseParser(IInputStream stream)

BaseParser

protected BaseParser(byte[] data)
Method Detail

moveNext

public boolean moveNext()
Description copied from class: PostScriptParser
Moves the pointer to the next token.

To properly parse the current token, the pointer MUST be just before its starting (leading whitespaces are ignored). When this method terminates, the pointer IS at the last byte of the current token.

Overrides:
moveNext in class PostScriptParser
Returns:
Whether a new token was found.

parsePdfObject

public PdfDataObject parsePdfObject()
Parses the current PDF object [PDF:1.6:3.2].


parsePdfObject

public PdfDataObject parsePdfObject(int offset)
Parses a PDF object after moving to the given token offset.

Parameters:
offset - Number of tokens to skip before reaching the intended one.
See Also:
parsePdfObject()

PDF Clown
0.1.2

Project home page

Copyright © 2006-2013 Stefano Chizzolini. Some Rights Reserved.
This documentation is available under the terms of the GNU Free Documentation License.