Class JavadocEscapeWriter

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.Appendable, java.lang.AutoCloseable

    public class JavadocEscapeWriter
    extends java.io.FilterWriter
    Writer that escapes characters that are unsafe as Javadoc comments. Such characters include '<' and '&'.

    Note that this class doesn't escape other Unicode characters that are typically unsafe. For example, &#x611B; (A kanji that means "love") can be considered as unsafe because javac with English Windows cannot accept this character in the source code.

    If the application needs to escape such characters as well, then they are on their own.

    Author:
    Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
    • Field Summary

      • Fields inherited from class java.io.FilterWriter

        out
      • Fields inherited from class java.io.Writer

        lock
    • Constructor Summary

      Constructors 
      Constructor Description
      JavadocEscapeWriter​(java.io.Writer next)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void write​(char[] buf)  
      void write​(char[] buf, int off, int len)  
      void write​(int ch)  
      void write​(java.lang.String buf)  
      void write​(java.lang.String buf, int off, int len)  
      • Methods inherited from class java.io.FilterWriter

        close, flush
      • Methods inherited from class java.io.Writer

        append, append, append, nullWriter
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JavadocEscapeWriter

        public JavadocEscapeWriter​(java.io.Writer next)
    • Method Detail

      • write

        public void write​(int ch)
                   throws java.io.IOException
        Overrides:
        write in class java.io.FilterWriter
        Throws:
        java.io.IOException
      • write

        public void write​(char[] buf,
                          int off,
                          int len)
                   throws java.io.IOException
        Overrides:
        write in class java.io.FilterWriter
        Throws:
        java.io.IOException
      • write

        public void write​(char[] buf)
                   throws java.io.IOException
        Overrides:
        write in class java.io.Writer
        Throws:
        java.io.IOException
      • write

        public void write​(java.lang.String buf,
                          int off,
                          int len)
                   throws java.io.IOException
        Overrides:
        write in class java.io.FilterWriter
        Throws:
        java.io.IOException
      • write

        public void write​(java.lang.String buf)
                   throws java.io.IOException
        Overrides:
        write in class java.io.Writer
        Throws:
        java.io.IOException