[Idrs-commit] CVS: Idrs/dev/src/net/sourceforge/idrs/deploy/macro MacroToXML.java,1.10,1.11
Brought to you by:
bigman921
|
From: Marc B. <big...@us...> - 2002-01-23 19:46:21
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/macro In directory usw-pr-cvs1:/tmp/cvs-serv11820/net/sourceforge/idrs/deploy/macro Modified Files: MacroToXML.java Log Message: added java doc comments Index: MacroToXML.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/macro/MacroToXML.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** MacroToXML.java 2002/01/23 15:18:33 1.10 --- MacroToXML.java 2002/01/23 19:46:18 1.11 *************** *** 19,22 **** --- 19,25 ---- import java.io.*; + /** + *Performs parsing of RML-macro pages and transforms the rml pages into RML-XML pages + */ public class MacroToXML { String rmlSrc; *************** *** 36,39 **** --- 39,48 ---- String currentTagName; + /** + *Constructor, loads transoformation xml document + *@param parser Class of parser to be used to parse XML transformation document + *@param xmlSrc Source of XML document, either a string or a file path + *@param isFile Identifies if xmlSrc is the xml as a string or a path to the xml file + */ public MacroToXML(String parser, String xmlSrc, boolean isFile) throws Exception { ownLine = false; *************** *** 60,71 **** --- 69,91 ---- } + /** + *Sets the rml-macro source as a string + *@param rml The RML-Macro source + */ public void setRML(String rml) { this.rmlSrc = rml; } + /** + *Sets the writer where the RML-XML will be written to + *@param out Writer for output + */ public void setWriter(Writer out) throws IOException { this.out = out; } + /** + *Transforms the RML-Macro page into an RML-XML page + */ public void transformToXML() throws IOException{ int begin=0,end=0,tagEnd; *************** *** 111,118 **** --- 131,146 ---- } + /** + *Determines if current tag is a script tag + *@param begin Begining of tag in rmlSrc + */ protected boolean isScriptTag(int begin) { return rmlSrc.charAt(begin + 1) == info.getScriptChar(); } + /** + *Writes a fully xml compatable version of a script + *@param begin Beginning of tag in rmlSrc + */ protected int outScript(int begin) throws IOException { int end = rmlSrc.indexOf(info.getScriptChar() + ">",begin); *************** *** 132,135 **** --- 160,167 ---- } + /** + *Writes text apropriatly, either with text tags or without them + *@param txt Text to be written + */ protected void outText(String txt) throws IOException { if (txt.length() == 0) return; *************** *** 149,156 **** --- 181,196 ---- } + /** + *Reads rmlSrc for position of the end of the current tag + *@param begin Beginning of tag in rmlSrc + */ protected int readTag(int begin) { return rmlSrc.indexOf(">", begin)+1; } + /** + *Determines if a tag is an RML tag + *@param tag Tag to check + */ protected boolean isRMLTag(String tag) { *************** *** 217,220 **** --- 257,264 ---- } + /** + *Writes the RML tag as full XML 1.0 tag + *@param tag Tag to write + */ protected void outTag(String tag) throws IOException { int begin=0, end=0,tmp; *************** *** 263,266 **** --- 307,313 ---- } + /** + *Determines if the current block of text should be wrapped in text tags + */ protected boolean shouldWrite() { if (lookLastTag) { *************** *** 272,275 **** --- 319,326 ---- } + /** + *Returns an XML escaped version of the text passed it + *@param txt Text to encode + */ protected String xmlEncode(String txt) { StringBuffer buffer = new StringBuffer(); |