Java Doc for TranslatorReader.java in  » Portal » Open-Portal » com » ecyrd » jspwiki » 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 » Portal » Open Portal » com.ecyrd.jspwiki 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.io.Reader
      com.ecyrd.jspwiki.TranslatorReader

TranslatorReader
public class TranslatorReader extends Reader (Code)
Handles conversion from Wiki format into fully featured HTML. This is where all the magic happens. It is CRITICAL that this class is tested, or all Wikis might die horribly.

The output of the HTML has not yet been validated against the HTML DTD. However, it is very simple.
author:
   Janne Jalkanen


Inner Class :public class Heading

Field Summary
final public static  intATTACHMENT
    
final protected static  intBOLD
    
final public static  StringDEFAULT_INLINEPATTERN
     The default inlining pattern.
final public static  intEDIT
    
final protected static  intITALIC
    
final public static  StringPROP_ALLOWHTML
     If set to "true", allows using raw HTML within Wiki text.
final public static  StringPROP_CAMELCASELINKS
     If true, consider CamelCase hyperlinks as well.
final public static  StringPROP_INLINEIMAGEPTRN
     This property defines the inline image pattern.
final public static  StringPROP_PLAINURIS
     If true, all hyperlinks are translated as well, regardless whether they are surrounded by brackets.
final public static  StringPROP_RUNPLUGINS
    
final public static  StringPROP_USEOUTLINKIMAGE
     If true, all outward links (external links) have a small link image appended.
final public static  StringPROP_USERELNOFOLLOW
    
final public static  intREAD
    
final protected static  intTYPED
    
final static  String[]c_externalLinks
     This list contains all IANA registered URI protocol types as of September 2004 + a few well-known extra types.

Constructor Summary
public  TranslatorReader(WikiContext context, Reader in)
     Creates a TranslatorReader using the default HTML renderer.
public  TranslatorReader(WikiContext context, Reader in, TextRenderer renderer)
    

Method Summary
public  voidaddAttachmentLinkHook(StringTransmutator mutator)
     Adds a hook for processing attachment links.
Parameters:
  mutator - The hook to call.
public  voidaddExternalLinkHook(StringTransmutator mutator)
     Adds a hook for processing external links.
public  voidaddHeadingListener(HeadingListener listener)
    
public  voidaddLinkTransmutator(StringTransmutator mutator)
     Adds a hook for processing link texts.
public  voidaddLocalLinkHook(StringTransmutator mutator)
     Adds a hook for processing local links.
public static  StringcleanLink(String link)
     Cleans a Wiki name.

[ This is a link ] -> ThisIsALink
Parameters:
  link - Link to be cleared.

public static  StringcleanLinkPart(String link, boolean morph)
    
public  voidclose()
    
public  voiddisableAccessRules()
    
public  voidenableImageInlining(boolean toggle)
     Use this to turn on or off image inlining.
public  voidenablePlugins(boolean toggle)
    
protected static  CollectiongetImagePatterns(WikiEngine engine)
     Figure out which image suffixes should be inlined.
public  StringmakeLink(int type, String link, String text)
     Write a HTMLized link depending on its type.
public  intread()
    
public  intread(char[] buf, int off, int len)
    
public  booleanready()
    
public  ReadersetInputReader(Reader in)
     Replaces the current input character stream with a new one.
Parameters:
  in - New source for input.
protected  voidsetRenderer(TextRenderer renderer)
     Sets the currently used renderer.

Field Detail
ATTACHMENT
final public static int ATTACHMENT(Code)



BOLD
final protected static int BOLD(Code)



DEFAULT_INLINEPATTERN
final public static String DEFAULT_INLINEPATTERN(Code)
The default inlining pattern. Currently "*.png"



EDIT
final public static int EDIT(Code)



ITALIC
final protected static int ITALIC(Code)



PROP_ALLOWHTML
final public static String PROP_ALLOWHTML(Code)
If set to "true", allows using raw HTML within Wiki text. Be warned, this is a VERY dangerous option to set - never turn this on in a publicly allowable Wiki, unless you are absolutely certain of what you're doing.



PROP_CAMELCASELINKS
final public static String PROP_CAMELCASELINKS(Code)
If true, consider CamelCase hyperlinks as well.



PROP_INLINEIMAGEPTRN
final public static String PROP_INLINEIMAGEPTRN(Code)
This property defines the inline image pattern. It's current value is jspwiki.translatorReader.inlinePattern



PROP_PLAINURIS
final public static String PROP_PLAINURIS(Code)
If true, all hyperlinks are translated as well, regardless whether they are surrounded by brackets.



PROP_RUNPLUGINS
final public static String PROP_RUNPLUGINS(Code)
If set to "true", enables plugins during parsing



PROP_USEOUTLINKIMAGE
final public static String PROP_USEOUTLINKIMAGE(Code)
If true, all outward links (external links) have a small link image appended.



PROP_USERELNOFOLLOW
final public static String PROP_USERELNOFOLLOW(Code)
If set to "true", all external links are tagged with 'rel="nofollow"'



READ
final public static int READ(Code)



TYPED
final protected static int TYPED(Code)



c_externalLinks
final static String[] c_externalLinks(Code)
This list contains all IANA registered URI protocol types as of September 2004 + a few well-known extra types. JSPWiki recognises all of them as external links.




Constructor Detail
TranslatorReader
public TranslatorReader(WikiContext context, Reader in)(Code)
Creates a TranslatorReader using the default HTML renderer.



TranslatorReader
public TranslatorReader(WikiContext context, Reader in, TextRenderer renderer)(Code)




Method Detail
addAttachmentLinkHook
public void addAttachmentLinkHook(StringTransmutator mutator)(Code)
Adds a hook for processing attachment links.
Parameters:
  mutator - The hook to call. Null is safe.



addExternalLinkHook
public void addExternalLinkHook(StringTransmutator mutator)(Code)
Adds a hook for processing external links. This includes all http:// ftp://, etc. links, including inlined images.
Parameters:
  mutator - The hook to call. Null is safe.



addHeadingListener
public void addHeadingListener(HeadingListener listener)(Code)



addLinkTransmutator
public void addLinkTransmutator(StringTransmutator mutator)(Code)
Adds a hook for processing link texts. This hook is called when the link text is written into the output stream, and you may use it to modify the text. It does not affect the actual link, only the user-visible text.
Parameters:
  mutator - The hook to call. Null is safe.



addLocalLinkHook
public void addLocalLinkHook(StringTransmutator mutator)(Code)
Adds a hook for processing local links. The engine transforms both non-existing and existing page links.
Parameters:
  mutator - The hook to call. Null is safe.



cleanLink
public static String cleanLink(String link)(Code)
Cleans a Wiki name.

[ This is a link ] -> ThisIsALink
Parameters:
  link - Link to be cleared. Null is safe, and causes this to return null. A cleaned link.
since:
   2.0




cleanLinkPart
public static String cleanLinkPart(String link, boolean morph)(Code)



close
public void close()(Code)



disableAccessRules
public void disableAccessRules()(Code)



enableImageInlining
public void enableImageInlining(boolean toggle)(Code)
Use this to turn on or off image inlining.
Parameters:
  toggle - If true, images are inlined (as per set in jspwiki.properties)If false, then images won't be inlined; instead, they will betreated as standard hyperlinks.
since:
   2.2.9



enablePlugins
public void enablePlugins(boolean toggle)(Code)
Can be used to turn on plugin execution on a translator-reader basis



getImagePatterns
protected static Collection getImagePatterns(WikiEngine engine)(Code)
Figure out which image suffixes should be inlined. Collection of Strings with patterns.



makeLink
public String makeLink(int type, String link, String text)(Code)
Write a HTMLized link depending on its type. The link mutator chain is processed.
Parameters:
  type - Type of the link.
Parameters:
  link - The actual link.
Parameters:
  text - The user-visible text for the link.



read
public int read() throws IOException(Code)



read
public int read(char[] buf, int off, int len) throws IOException(Code)



ready
public boolean ready() throws IOException(Code)



setInputReader
public Reader setInputReader(Reader in)(Code)
Replaces the current input character stream with a new one.
Parameters:
  in - New source for input. If null, this method does nothing. the old stream



setRenderer
protected void setRenderer(TextRenderer renderer)(Code)
Sets the currently used renderer. This method is protected because we only want to use it internally for now. The renderer interface is not yet set to stone, so it's not expected that third parties would use this.



Fields inherited from java.io.Reader
protected Object lock(Code)(Java Doc)

Methods inherited from java.io.Reader
abstract public void close() throws IOException(Code)(Java Doc)
public void mark(int readAheadLimit) throws IOException(Code)(Java Doc)
public boolean markSupported()(Code)(Java Doc)
public int read(java.nio.CharBuffer target) throws IOException(Code)(Java Doc)
public int read() throws IOException(Code)(Java Doc)
public int read(char cbuf) throws IOException(Code)(Java Doc)
abstract public int read(char cbuf, int off, int len) throws IOException(Code)(Java Doc)
public boolean ready() throws IOException(Code)(Java Doc)
public void reset() throws IOException(Code)(Java Doc)
public long skip(long n) throws IOException(Code)(Java Doc)

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.