public class PdfContentParser
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
COMMAND_TYPE
Commands have this type.
|
private PRTokeniser |
tokeniser
Holds value of property tokeniser.
|
| Constructor and Description |
|---|
PdfContentParser(PRTokeniser tokeniser)
Creates a new instance of PdfContentParser
|
| Modifier and Type | Method and Description |
|---|---|
PRTokeniser |
getTokeniser()
Gets the tokeniser.
|
boolean |
nextValidToken()
Reads the next token skipping over the comments.
|
java.util.ArrayList |
parse(java.util.ArrayList ls)
Parses a single command from the content.
|
PdfArray |
readArray()
Reads an array.
|
PdfDictionary |
readDictionary()
Reads a dictionary.
|
PdfObject |
readPRObject()
Reads a pdf object.
|
void |
setTokeniser(PRTokeniser tokeniser)
Sets the tokeniser.
|
public static final int COMMAND_TYPE
private PRTokeniser tokeniser
public PdfContentParser(PRTokeniser tokeniser)
tokeniser - the tokeniser with the contentpublic java.util.ArrayList parse(java.util.ArrayList ls)
throws java.io.IOException
ls - an ArrayList to use. It will be cleared before using. If it's
null will create a new ArrayListArrayList given as argument or a new onejava.io.IOException - on errorpublic PRTokeniser getTokeniser()
public void setTokeniser(PRTokeniser tokeniser)
tokeniser - the tokeniserpublic PdfDictionary readDictionary() throws java.io.IOException
java.io.IOException - on errorpublic PdfArray readArray() throws java.io.IOException
java.io.IOException - on errorpublic PdfObject readPRObject() throws java.io.IOException
java.io.IOException - on errorpublic boolean nextValidToken()
throws java.io.IOException
true if a token was read, false if the end of content was reachedjava.io.IOException - on error