[Idrs-commit] CVS: Idrs/dev/src/net/sourceforge/idrs/deploy/macro MacroToXML.java,1.18,1.19
Brought to you by:
bigman921
|
From: Marc B. <big...@us...> - 2003-02-17 02:48:52
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/macro
In directory sc8-pr-cvs1:/tmp/cvs-serv8260/dev/src/net/sourceforge/idrs/deploy/macro
Modified Files:
MacroToXML.java
Log Message:
Added methods to assist in file upload
Index: MacroToXML.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/deploy/macro/MacroToXML.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** MacroToXML.java 22 Aug 2002 20:06:35 -0000 1.18
--- MacroToXML.java 17 Feb 2003 02:48:48 -0000 1.19
***************
*** 23,26 ****
--- 23,30 ----
*/
public class MacroToXML {
+ String errWord;
+ int line;
+
+
String rmlSrc;
Writer out;
***************
*** 67,70 ****
--- 71,77 ----
this.rmlNS=rmlNS;
+ this.line = 0;
+ this.errWord = null;
+
XMLReader xmlParser = XMLReaderFactory.createXMLReader(parser);
***************
*** 373,377 ****
*@param tag Tag to check
*/
! protected boolean isRMLTag(String tag) {
int begin=0, end=0,tmp;
--- 380,384 ----
*@param tag Tag to check
*/
! protected boolean isRMLTag(String tag) throws Exception {
int begin=0, end=0,tmp;
***************
*** 397,400 ****
--- 404,413 ----
}
+ if (tmp < 0) {
+ this.countLines(this.rmlSrc.indexOf(tag));
+ this.errWord = tag;
+ throw new Exception("The tag is not properly closed");
+ }
+
tagName = tag.substring(begin,tmp);
***************
*** 656,659 ****
--- 669,683 ----
}
+ protected void countLines(int pos) {
+ int begin = 0;
+
+ this.line = 0;
+ while (begin != -1 && begin < pos) {
+
+ line++;
+ begin = this.rmlSrc.indexOf('\n', begin +1);
+ }
+ }
+
***************
*** 668,671 ****
--- 692,711 ----
}
}*/
+ /**
+ * Returns the errWord.
+ * @return String
+ */
+ public String getErrWord() {
+ return errWord;
+ }
+
+ /**
+ * Returns the line.
+ * @return int
+ */
+ public int getLine() {
+ return line;
+ }
+
}
|