Java Doc for DSCParser.java in  » Graphic-Library » xmlgraphics-commons-1.2 » org » apache » xmlgraphics » ps » dsc » 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 » Graphic Library » xmlgraphics commons 1.2 » org.apache.xmlgraphics.ps.dsc 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.xmlgraphics.ps.dsc.DSCParser

DSCParser
public class DSCParser implements DSCParserConstants(Code)
Parser for DSC-compliant PostScript files (DSC = Document Structuring Conventions). The parser is implemented as a pull parser but has the ability to act as a push parser through the DSCHandler interface.



Constructor Summary
public  DSCParser(InputStream in)
     Creates a new DSC parser.

Method Summary
public  DSCEventgetCurrentEvent()
     Returns the current event.
public  InputStreamgetInputStream()
     Returns the InputStream the PostScript code is read from.
public  StringgetLine()
     Returns the current PostScript line.
public  booleanhasNext()
     Indicates whether there are additional items.
public  intnext()
     Steps to the next item indicating the type of event.
public  DSCCommentnextDSCComment(String name)
     Advances to the next DSC comment with the given name.
public  DSCCommentnextDSCComment(String name, PSGenerator gen)
     Advances to the next DSC comment with the given name.
public  DSCEventnextEvent()
     Steps to the next item returning the new event.
public  PostScriptCommentnextPSComment(String prefix, PSGenerator gen)
     Advances to the next PostScript comment with the given prefix.
public  voidparse(DSCHandler handler)
     Starts the parser in push parsing mode sending events to the DSCHandler instance.
protected  voidparseNext()
     Parses the next event.
public  DSCEventpeek()
     Returns the next event without moving the cursor to the next event.
protected  StringreadLine()
    
public  voidsetFilter(DSCFilter filter)
     Sets a filter for DSC events.
public  voidsetNestedDocumentHandler(NestedDocumentHandler handler)
     Sets a NestedDocumentHandler which is used to skip nested documents like embedded EPS files.
protected  voidwarn(String msg)
     This method is used to write out warning messages for the parsing process.


Constructor Detail
DSCParser
public DSCParser(InputStream in) throws IOException, DSCException(Code)
Creates a new DSC parser.
Parameters:
  in - InputStream to read the PostScript file from(the stream is not closed by this class, the caller is responsible for that)
throws:
  IOException - In case of an I/O error
throws:
  DSCException - In case of a violation of the DSC spec




Method Detail
getCurrentEvent
public DSCEvent getCurrentEvent()(Code)
Returns the current event. the current event



getInputStream
public InputStream getInputStream()(Code)
Returns the InputStream the PostScript code is read from. the InputStream the PostScript code is read from



getLine
public String getLine()(Code)
Returns the current PostScript line. the current PostScript line
throws:
  IllegalStateException - if the current event is not a normal PostScript line



hasNext
public boolean hasNext()(Code)
Indicates whether there are additional items. true if there are additonal items, false if the end of the file has been reached



next
public int next() throws IOException, DSCException(Code)
Steps to the next item indicating the type of event. the type of event (See DSCParserConstants)
throws:
  IOException - In case of an I/O error
throws:
  DSCException - In case of a violation of the DSC spec
throws:
  NoSuchElementException - If an attempt was made to advance beyond the end of the file



nextDSCComment
public DSCComment nextDSCComment(String name) throws IOException, DSCException(Code)
Advances to the next DSC comment with the given name.
Parameters:
  name - the name of the DSC comment the requested DSC comment or null if the end of the file is reached
throws:
  IOException - In case of an I/O error
throws:
  DSCException - In case of a violation of the DSC spec



nextDSCComment
public DSCComment nextDSCComment(String name, PSGenerator gen) throws IOException, DSCException(Code)
Advances to the next DSC comment with the given name.
Parameters:
  name - the name of the DSC comment
Parameters:
  gen - PSGenerator to pass the skipped events though to the requested DSC comment or null if the end of the file is reached
throws:
  IOException - In case of an I/O error
throws:
  DSCException - In case of a violation of the DSC spec



nextEvent
public DSCEvent nextEvent() throws IOException, DSCException(Code)
Steps to the next item returning the new event. the new event
throws:
  IOException - In case of an I/O error
throws:
  DSCException - In case of a violation of the DSC spec



nextPSComment
public PostScriptComment nextPSComment(String prefix, PSGenerator gen) throws IOException, DSCException(Code)
Advances to the next PostScript comment with the given prefix. This is used to find comments following the DSC extension mechanism.

Example: To find FOP's custom comments, pass in "FOP" as a prefix. This will find comments like "%FOPFontSetup".
Parameters:
  prefix - the prefix of the extension comment
Parameters:
  gen - PSGenerator to pass the skipped events though to the requested PostScript comment or null if the end of the file is reached
throws:
  IOException - In case of an I/O error
throws:
  DSCException - In case of a violation of the DSC spec




parse
public void parse(DSCHandler handler) throws IOException, DSCException(Code)
Starts the parser in push parsing mode sending events to the DSCHandler instance.
Parameters:
  handler - the DSCHandler instance to send the events to
throws:
  IOException - In case of an I/O error
throws:
  DSCException - In case of a violation of the DSC spec



parseNext
protected void parseNext() throws IOException, DSCException(Code)
Parses the next event.
throws:
  IOException - In case of an I/O error
throws:
  DSCException - In case of a violation of the DSC spec



peek
public DSCEvent peek()(Code)
Returns the next event without moving the cursor to the next event. the next event



readLine
protected String readLine() throws IOException, DSCException(Code)
Reads one line from the input file the line or null if there are no more lines
throws:
  IOException - In case of an I/O error
throws:
  DSCException - In case of a violation of the DSC spec



setFilter
public void setFilter(DSCFilter filter)(Code)
Sets a filter for DSC events.
Parameters:
  filter - the filter to use or null to disable filtering



setNestedDocumentHandler
public void setNestedDocumentHandler(NestedDocumentHandler handler)(Code)
Sets a NestedDocumentHandler which is used to skip nested documents like embedded EPS files. You can also process those parts in a special way.
Parameters:
  handler - the NestedDocumentHandler instance or null to disable the feature



warn
protected void warn(String msg)(Code)
This method is used to write out warning messages for the parsing process. Subclass to override this method. The default implementation writes to System.err.
Parameters:
  msg - the warning message



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.