Java Doc for BaseParser.java in  » PDF » PDFBox-0.7.3 » org » pdfbox » pdfparser » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » PDF » PDFBox 0.7.3 » org.pdfbox.pdfparser 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.pdfbox.pdfparser.BaseParser

All known Subclasses:   org.pdfbox.pdfparser.PDFStreamParser,  org.pdfbox.pdfparser.PDFObjectStreamParser,  org.pdfbox.pdfparser.PDFParser,
BaseParser
abstract public class BaseParser (Code)
This class is used to contain parsing logic that will be used by both the PDFParser and the COSStreamParser.
author:
   Ben Litchfield
version:
   $Revision: 1.59 $


Field Summary
final public static  StringDEF
     This is a byte array that will be used for comparisons.
final public static  byte[]ENDSTREAM
     This is a byte array that will be used for comparisons.
protected  PushBackInputStreampdfSource
     This is the stream that will be read from.

Constructor Summary
public  BaseParser(InputStream input)
     Constructor.
protected  BaseParser(byte[] input)
     Constructor.

Method Summary
public  voidaddXref(PDFXref xref)
     This will add an xref.
public  ListgetXrefs()
     This will get all of the xrefs.
protected  booleanisClosing()
     This will tell if the next character is a closing brace( close of PDF array ).
protected  booleanisClosing(int c)
     This will tell if the next character is a closing brace( close of PDF array ).
protected  booleanisEOL()
     This will tell if the next byte to be read is an end of line byte.
protected  booleanisEOL(int c)
     This will tell if the next byte to be read is an end of line byte.
protected  booleanisEndOfName(char ch)
     Determine if a character terminates a PDF name.
protected  booleanisWhitespace()
     This will tell if the next byte is whitespace or not.
protected  booleanisWhitespace(int c)
     This will tell if the next byte is whitespace or not.
protected  COSBooleanparseBoolean()
     This will parse a boolean object from the stream.
protected  COSArrayparseCOSArray()
     This will parse a PDF array object.
protected  COSDictionaryparseCOSDictionary()
     This will parse a PDF dictionary.
protected  COSNameparseCOSName()
     This will parse a PDF name from the stream.
protected  COSStreamparseCOSStream(COSDictionary dic, RandomAccess file)
     This will read a COSStream from the input stream.
Parameters:
  file - The file to write the stream to when reading.
Parameters:
  dic - The dictionary that goes with this stream.
protected  COSStringparseCOSString()
     This will parse a PDF string.
protected  COSBaseparseDirObject()
     This will parse a directory object from the stream.
protected  StringreadExpectedString(String theString)
     This will read bytes until the end of line marker occurs.
Parameters:
  theString - The next expected string in the stream.
protected  intreadInt()
     This will read an integer from the stream.
protected  StringreadLine()
     This will read bytes until the end of line marker occurs.
protected  StringreadString()
     This will read the next string from the stream.
protected  StringreadString(int length)
     This will read the next string from the stream up to a certain length.
Parameters:
  length - The length to stop reading at.
public  voidsetDocument(COSDocument doc)
     Set the document for this stream.
protected  voidskipSpaces()
     This will skip all spaces and comments that are present.

Field Detail
DEF
final public static String DEF(Code)
This is a byte array that will be used for comparisons.



ENDSTREAM
final public static byte[] ENDSTREAM(Code)
This is a byte array that will be used for comparisons.



pdfSource
protected PushBackInputStream pdfSource(Code)
This is the stream that will be read from.




Constructor Detail
BaseParser
public BaseParser(InputStream input) throws IOException(Code)
Constructor.
Parameters:
  input - The input stream to read the data from.
throws:
  IOException - If there is an error reading the input stream.



BaseParser
protected BaseParser(byte[] input) throws IOException(Code)
Constructor.
Parameters:
  input - The array to read the data from.
throws:
  IOException - If there is an error reading the byte data.




Method Detail
addXref
public void addXref(PDFXref xref)(Code)
This will add an xref.
Parameters:
  xref - The xref to add.



getXrefs
public List getXrefs()(Code)
This will get all of the xrefs. A list of all xrefs.



isClosing
protected boolean isClosing() throws IOException(Code)
This will tell if the next character is a closing brace( close of PDF array ). true if the next byte is ']', false otherwise.
throws:
  IOException - If an IO error occurs.



isClosing
protected boolean isClosing(int c)(Code)
This will tell if the next character is a closing brace( close of PDF array ).
Parameters:
  c - The character to check against end of line true if the next byte is ']', false otherwise.



isEOL
protected boolean isEOL() throws IOException(Code)
This will tell if the next byte to be read is an end of line byte. true if the next byte is 0x0A or 0x0D.
throws:
  IOException - If there is an error reading from the stream.



isEOL
protected boolean isEOL(int c)(Code)
This will tell if the next byte to be read is an end of line byte.
Parameters:
  c - The character to check against end of line true if the next byte is 0x0A or 0x0D.



isEndOfName
protected boolean isEndOfName(char ch)(Code)
Determine if a character terminates a PDF name.
Parameters:
  ch - The character true if the character terminates a PDF name, otherwise false.



isWhitespace
protected boolean isWhitespace() throws IOException(Code)
This will tell if the next byte is whitespace or not. true if the next byte in the stream is a whitespace character.
throws:
  IOException - If there is an error reading from the stream.



isWhitespace
protected boolean isWhitespace(int c)(Code)
This will tell if the next byte is whitespace or not.
Parameters:
  c - The character to check against whitespace true if the next byte in the stream is a whitespace character.



parseBoolean
protected COSBoolean parseBoolean() throws IOException(Code)
This will parse a boolean object from the stream. The parsed boolean object.
throws:
  IOException - If an IO error occurs during parsing.



parseCOSArray
protected COSArray parseCOSArray() throws IOException(Code)
This will parse a PDF array object. The parsed PDF array.
throws:
  IOException - If there is an error parsing the stream.



parseCOSDictionary
protected COSDictionary parseCOSDictionary() throws IOException(Code)
This will parse a PDF dictionary. The parsed dictionary.
throws:
  IOException - IF there is an error reading the stream.



parseCOSName
protected COSName parseCOSName() throws IOException(Code)
This will parse a PDF name from the stream. The parsed PDF name.
throws:
  IOException - If there is an error reading from the stream.



parseCOSStream
protected COSStream parseCOSStream(COSDictionary dic, RandomAccess file) throws IOException(Code)
This will read a COSStream from the input stream.
Parameters:
  file - The file to write the stream to when reading.
Parameters:
  dic - The dictionary that goes with this stream. The parsed pdf stream.
throws:
  IOException - If there is an error reading the stream.



parseCOSString
protected COSString parseCOSString() throws IOException(Code)
This will parse a PDF string. The parsed PDF string.
throws:
  IOException - If there is an error reading from the stream.



parseDirObject
protected COSBase parseDirObject() throws IOException(Code)
This will parse a directory object from the stream. The parsed object.
throws:
  IOException - If there is an error during parsing.



readExpectedString
protected String readExpectedString(String theString) throws IOException(Code)
This will read bytes until the end of line marker occurs.
Parameters:
  theString - The next expected string in the stream. The characters between the current position and the end of the line.
throws:
  IOException - If there is an error reading from the stream or theString does not match what was read.



readInt
protected int readInt() throws IOException(Code)
This will read an integer from the stream. The integer that was read from the stream.
throws:
  IOException - If there is an error reading from the stream.



readLine
protected String readLine() throws IOException(Code)
This will read bytes until the end of line marker occurs. The characters between the current position and the end of the line.
throws:
  IOException - If there is an error reading from the stream.



readString
protected String readString() throws IOException(Code)
This will read the next string from the stream. The string that was read from the stream.
throws:
  IOException - If there is an error reading from the stream.



readString
protected String readString(int length) throws IOException(Code)
This will read the next string from the stream up to a certain length.
Parameters:
  length - The length to stop reading at. The string that was read from the stream of length 0 to length.
throws:
  IOException - If there is an error reading from the stream.



setDocument
public void setDocument(COSDocument doc)(Code)
Set the document for this stream.
Parameters:
  doc - The current document.



skipSpaces
protected void skipSpaces() throws IOException(Code)
This will skip all spaces and comments that are present.
throws:
  IOException - If there is an error reading from the stream.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.