520 // write an emptyTag
521 writer.write("<" + tag + "/>");
522 }
523
524 private void setTag(String tag) {
525 // add the tag to stack
526 stack.push(tag);
527 }
528
529 private String getTag() {
530 return stack.pop();
531 }
532
533 private void writeNull() throws java.io.IOException {
534 emptyTag("null");
535 }
536
537 private void writeStringData(String s) throws java.io.IOException {
538 if (s == null) {
539 writeNull();
540 } else if (s.equals("")) {
541 writeEmptyString();
542 } else {
543
544 s = processSpecialCharacters(s);
545
546 writer.write(s);
547 }
548 }
549
550 private void writeString(String s) throws java.io.IOException {
551 if (s != null) {
552 writer.write(s);
553 } else {
554 writeNull();
555 }
556 }
557
558
559 private void writeShort(short s) throws java.io.IOException {
560 writer.write(Short.toString(s));
|
520 // write an emptyTag
521 writer.write("<" + tag + "/>");
522 }
523
524 private void setTag(String tag) {
525 // add the tag to stack
526 stack.push(tag);
527 }
528
529 private String getTag() {
530 return stack.pop();
531 }
532
533 private void writeNull() throws java.io.IOException {
534 emptyTag("null");
535 }
536
537 private void writeStringData(String s) throws java.io.IOException {
538 if (s == null) {
539 writeNull();
540 } else if (s.isEmpty()) {
541 writeEmptyString();
542 } else {
543
544 s = processSpecialCharacters(s);
545
546 writer.write(s);
547 }
548 }
549
550 private void writeString(String s) throws java.io.IOException {
551 if (s != null) {
552 writer.write(s);
553 } else {
554 writeNull();
555 }
556 }
557
558
559 private void writeShort(short s) throws java.io.IOException {
560 writer.write(Short.toString(s));
|