Groovy Documentation

java.gate.yam.convert
Class JSPWikiToYamConverter

java.lang.Object
  java.gate.yam.convert.JSPWikiToYamConverter

class JSPWikiToYamConverter

Convert JSPWiki syntax to YAM.

author:
Valentin Tablan


Field Summary
private static String INPUT_ENCODING

Encoding used when reading JSPWiki files and writing YAM files

private static String OUTPUT_ENCODING

private static char[] YAM_SPECIAL_CHARACTERS

Characters that should be escaped when generating Yam.

 
Constructor Summary
JSPWikiToYamConverter()

 
Method Summary
private static void processHeadings(def jdomDoc)

Find all headings in a DOM, and add an empty paragraph after all of those headings that don't have one already.

static String readerToString(Reader jspReader)

Converts text in JSPWiki format to YAM format.

static String readerToStringWithTitle(Reader jspReader, String title)

Converts text in JSPWiki format to YAM format, adding the given title to the document.

static String stringToString(String jspWikiSource)

Converts a JSPWiki page into YAM format.

 
Methods inherited from class Object
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll
 

Field Detail

INPUT_ENCODING

private static final String INPUT_ENCODING
Encoding used when reading JSPWiki files and writing YAM files


OUTPUT_ENCODING

private static final String OUTPUT_ENCODING


YAM_SPECIAL_CHARACTERS

private static final char[] YAM_SPECIAL_CHARACTERS
Characters that should be escaped when generating Yam.


 
Constructor Detail

JSPWikiToYamConverter

JSPWikiToYamConverter()


 
Method Detail

processHeadings

private static void processHeadings(def jdomDoc)
Find all headings in a DOM, and add an empty paragraph after all of those headings that don't have one already. JSPWiki headings are terminated by new lines, whereas YAM headings are terminated by blank lines - this method ensures a correct translation.
param:
jdomDoc The document in which headings will be adjusted


readerToString

public static String readerToString(Reader jspReader)
Converts text in JSPWiki format to YAM format.
param:
jspReader a reader that provides the JSPWiki content
return:
a String with YAM data
throws:
TransformerException
throws:
IOException


readerToStringWithTitle

public static String readerToStringWithTitle(Reader jspReader, String title)
Converts text in JSPWiki format to YAM format, adding the given title to the document. If the title is null, none is added.
param:
jspReader a reader that provides the JSPWiki content
param:
title the title to give the YAM document
return:
a String with YAM data
throws:
TransformerException
throws:
IOException


stringToString

public static String stringToString(String jspWikiSource)
Converts a JSPWiki page into YAM format.
param:
jspWikiSource the String representing the JSPWiki content
return:
a String representation of a YAM page
throws:
TransformerException if problems occurred while performing the XSL transformation
throws:
IOException if problems occurred while parsing the JSPWiki format


 

Groovy Documentation