Java Doc for Verbatim.java in  » J2EE » enhydra » com » nwalsh » xalan » 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 » J2EE » enhydra » com.nwalsh.xalan 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.nwalsh.xalan.Verbatim

Verbatim
public class Verbatim (Code)

Xalan extensions supporting DocBook verbatim environments

$Id: Verbatim.java,v 1.4 2005-08-30 08:14:58 draganr Exp $

Copyright (C) 2001 Norman Walsh.

This class provides a Xalan implementation of two features that would be impractical to implement directly in XSLT: line numbering and callouts.

Line Numbering

The numberLines family of functions takes a result tree fragment (assumed to contain the contents of a formatted verbatim element in DocBook: programlisting, screen, address, literallayout, or synopsis) and returns a result tree fragment decorated with line numbers.

Callouts

The insertCallouts family of functions takes an areaspec and a result tree fragment (assumed to contain the contents of a formatted verbatim element in DocBook: programlisting, screen, address, literallayout, or synopsis) and returns a result tree fragment decorated with callouts.

Change Log:

1.0

Initial release.


author:
   Norman Walsh
author:
   ndw@nwalsh.com
version:
   $Id: Verbatim.java,v 1.4 2005-08-30 08:14:58 draganr Exp $



Constructor Summary
public  Verbatim()
    

Method Summary
public  DocumentFragmentinsertCallouts(ExpressionContext context, NodeIterator areaspecNodeSet, NodeIterator xalanNI)
    

Insert graphical callouts into a verbatim environment.

This method examines the areaset and area elements in the supplied areaspec and decorates the supplied result tree fragment with appropriate callout markers.

If a label attribute is supplied on an area, its content will be used for the label, otherwise the callout number will be used.

public  DocumentFragmentinsertCallouts(NodeIterator areaspecNodeSet, NodeIterator xalanNI, int defaultColumn, FormatCallout fCallout)
    
public  DocumentFragmentinsertDingbatCallouts(NodeIterator areaspecNodeSet, NodeIterator xalanNI, int defaultColumn, int gMax, boolean useFO)
    
public  DocumentFragmentinsertGraphicCallouts(NodeIterator areaspecNodeSet, NodeIterator xalanNI, int defaultColumn, String gPath, String gExt, int gMax, boolean useFO)
    
public  DocumentFragmentinsertTextCallouts(NodeIterator areaspecNodeSet, NodeIterator xalanNI, int defaultColumn, boolean useFO)
    
public  DocumentFragmentinsertUnicodeCallouts(NodeIterator areaspecNodeSet, NodeIterator xalanNI, int defaultColumn, String uFont, int uStart, int uMax, boolean useFO)
    
public  DocumentFragmentnumberLines(ExpressionContext context, NodeIterator xalanNI)
    

Number lines in a verbatim environment.

This method adds line numbers to a result tree fragment.



Constructor Detail
Verbatim
public Verbatim()(Code)

Constructor for Verbatim

All of the methods are static, so the constructor does nothing.





Method Detail
insertCallouts
public DocumentFragment insertCallouts(ExpressionContext context, NodeIterator areaspecNodeSet, NodeIterator xalanNI)(Code)

Insert graphical callouts into a verbatim environment.

This method examines the areaset and area elements in the supplied areaspec and decorates the supplied result tree fragment with appropriate callout markers.

If a label attribute is supplied on an area, its content will be used for the label, otherwise the callout number will be used. Callouts are numbered in document order. All of the areas in an areaset get the same number.

If the callout number is not greater than gMax, the callout generated will be:

 <img src="$gPath/conumber$gExt" alt="conumber">
 

Otherwise, it will be the callout number surrounded by parenthesis.

Only the linecolumn and linerange units are supported. If no unit is specifed, linecolumn is assumed. If only a line is specified, the callout decoration appears in the defaultColumn. Lines will be padded with blanks to reach the necessary column, but callouts that are located beyond the last line of the verbatim environment will be ignored.

Callouts are inserted before the character at the line/column where they are to occur.


Parameters:
  areaspecNodeSet - The source node set that contains the areaspec.
Parameters:
  xalanRTF - The result tree fragment of the verbatim environment.
Parameters:
  defaultColumn - The column for callouts that specify only a line.
Parameters:
  gPath - The path to use for callout graphics.
Parameters:
  gExt - The extension to use for callout graphics.
Parameters:
  gMax - The largest number that can be represented as a graphic.
Parameters:
  useFO - Should fo:external-graphics be produced, as opposed toHTML imgs. This is bogus, the extension should figure it out, but Ihaven't figured out how to do that yet. The modified result tree fragment.



insertCallouts
public DocumentFragment insertCallouts(NodeIterator areaspecNodeSet, NodeIterator xalanNI, int defaultColumn, FormatCallout fCallout)(Code)



insertDingbatCallouts
public DocumentFragment insertDingbatCallouts(NodeIterator areaspecNodeSet, NodeIterator xalanNI, int defaultColumn, int gMax, boolean useFO)(Code)



insertGraphicCallouts
public DocumentFragment insertGraphicCallouts(NodeIterator areaspecNodeSet, NodeIterator xalanNI, int defaultColumn, String gPath, String gExt, int gMax, boolean useFO)(Code)



insertTextCallouts
public DocumentFragment insertTextCallouts(NodeIterator areaspecNodeSet, NodeIterator xalanNI, int defaultColumn, boolean useFO)(Code)



insertUnicodeCallouts
public DocumentFragment insertUnicodeCallouts(NodeIterator areaspecNodeSet, NodeIterator xalanNI, int defaultColumn, String uFont, int uStart, int uMax, boolean useFO)(Code)



numberLines
public DocumentFragment numberLines(ExpressionContext context, NodeIterator xalanNI)(Code)

Number lines in a verbatim environment.

This method adds line numbers to a result tree fragment. Each newline that occurs in a text node is assumed to start a new line. The first line is always numbered, every subsequent xalanMod line is numbered (so if xalanMod=5, lines 1, 5, 10, 15, etc. will be numbered. If there are fewer than xalanMod lines in the environment, every line is numbered.

xalanMod is taken from the $linenumbering.everyNth parameter.

Every line number will be right justified in a string xalanWidth characters long. If the line number of the last line in the environment is too long to fit in the specified width, the width is automatically increased to the smallest value that can hold the number of the last line. (In other words, if you specify the value 2 and attempt to enumerate the lines of an environment that is 100 lines long, the value 3 will automatically be used for every line in the environment.)

xalanWidth is taken from the $linenumbering.width parameter.

The xalanSep string is inserted between the line number and the original program listing. Lines that aren't numbered are preceded by a xalanWidth blank string and the separator.

xalanSep is taken from the $linenumbering.separator parameter.

If inline markup extends across line breaks, markup changes are required. All the open elements are closed before the line break and "reopened" afterwards. The reopened elements will have the same attributes as the originals, except that 'name' and 'id' attributes are not duplicated.


Parameters:
  xalanRTF - The result tree fragment of the verbatim environment. The modified result tree fragment.



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.