Java Doc for XIncludeTextReader.java in  » XML » xerces-2_9_1 » org » apache » xerces » xinclude » 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 » XML » xerces 2_9_1 » org.apache.xerces.xinclude 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.xerces.xinclude.XIncludeTextReader

All known Subclasses:   org.apache.xerces.xinclude.XInclude11TextReader,
XIncludeTextReader
public class XIncludeTextReader (Code)
This class is used for reading resources requested in <include> elements, when the parse attribute of the <include> element is "text". Using this class will open the location, detect the encoding, and discard the byte order mark, if applicable. REVISIT: Much of the code in this class is taken from XMLEntityManager. It would be nice if this code could be shared in some way. However, since XMLEntityManager is used for reading files as XML, and this needs to read files as text, there would need to be some refactoring done.
author:
   Michael Glavassevich, IBM
author:
   Peter McCracken, IBM
author:
   Ankit Pasricha, IBM
author:
   Arun Yadav, Sun Microsystems Inc.
version:
   $Id: XIncludeTextReader.java 572046 2007-09-02 17:33:57Z mrglavas $
See Also:   XIncludeHandler



Constructor Summary
public  XIncludeTextReader(XMLInputSource source, XIncludeHandler handler, int bufferSize)
     Construct the XIncludeReader using the XMLInputSource and XIncludeHandler.

Method Summary
public  voidclose()
     Closes the stream.
protected  StringconsumeBOM(InputStream stream, String encoding)
     Removes the byte order mark from the stream, if it exists and returns the encoding name.
protected  StringgetEncodingName(InputStream stream)
     XMLEntityManager cares about endian-ness, since it creates its own optimized readers.
protected  StringgetEncodingName(byte[] b4)
     REVISIT: This code is taken from org.apache.xerces.impl.XMLEntityManager. Is there any way we can share the code, without having it implemented twice? I think we should make it public and static in XMLEntityManager.
protected  ReadergetReader(XMLInputSource source)
     Return the Reader for given XMLInputSource.
protected  booleanisValid(int ch)
     Returns true if the specified character is a valid XML character as per the rules of XML 1.0.
public  voidparse()
     Read the input stream as text, and pass the text on to the XIncludeHandler using calls to characters().
protected  voidsetBufferSize(int bufferSize)
    
public  voidsetErrorReporter(XMLErrorReporter errorReporter)
     Sets the XMLErrorReporter used for reporting errors while reading the text include.
public  voidsetInputSource(XMLInputSource source)
     Sets the input source on this text reader.


Constructor Detail
XIncludeTextReader
public XIncludeTextReader(XMLInputSource source, XIncludeHandler handler, int bufferSize) throws IOException(Code)
Construct the XIncludeReader using the XMLInputSource and XIncludeHandler.
Parameters:
  source - The XMLInputSource to use.
Parameters:
  handler - The XIncludeHandler to use.
Parameters:
  bufferSize - The size of this text reader's buffer.




Method Detail
close
public void close() throws IOException(Code)
Closes the stream. Call this after parse(), or when there is no longer any need for this object.
throws:
  IOException -



consumeBOM
protected String consumeBOM(InputStream stream, String encoding) throws IOException(Code)
Removes the byte order mark from the stream, if it exists and returns the encoding name.
Parameters:
  stream -
Parameters:
  encoding -
throws:
  IOException -



getEncodingName
protected String getEncodingName(InputStream stream) throws IOException(Code)
XMLEntityManager cares about endian-ness, since it creates its own optimized readers. Since we're just using generic Java readers for now, we're not caring about endian-ness. If this changes, even more code needs to be copied from XMLEntity manager. -- PJM



getEncodingName
protected String getEncodingName(byte[] b4)(Code)
REVISIT: This code is taken from org.apache.xerces.impl.XMLEntityManager. Is there any way we can share the code, without having it implemented twice? I think we should make it public and static in XMLEntityManager. --PJM Returns the IANA encoding name that is auto-detected from the bytes specified, with the endian-ness of that encoding where appropriate.
Parameters:
  b4 - The first four bytes of the input. the encoding name, or null if no encoding could be detected



getReader
protected Reader getReader(XMLInputSource source) throws IOException(Code)
Return the Reader for given XMLInputSource.
Parameters:
  source - The XMLInputSource to use.



isValid
protected boolean isValid(int ch)(Code)
Returns true if the specified character is a valid XML character as per the rules of XML 1.0.
Parameters:
  ch - The character to check.



parse
public void parse() throws IOException(Code)
Read the input stream as text, and pass the text on to the XIncludeHandler using calls to characters(). This will read all of the text it can from the resource.
throws:
  IOException -



setBufferSize
protected void setBufferSize(int bufferSize)(Code)
Sets the buffer size property for the reader which decides the chunk sizes that are parsed by the reader at a time and passed to the handler
Parameters:
  bufferSize - The size of the buffer desired



setErrorReporter
public void setErrorReporter(XMLErrorReporter errorReporter)(Code)
Sets the XMLErrorReporter used for reporting errors while reading the text include.
Parameters:
  errorReporter - the XMLErrorReporter to be used forreporting errors.



setInputSource
public void setInputSource(XMLInputSource source)(Code)
Sets the input source on this text reader.
Parameters:
  source - The XMLInputSource to use.



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.