FileDocCategorySizeDatePackage
GOMXmlWriter.javaAPI DocApache Lucene 2.1.02279Wed Feb 14 10:46:00 GMT 2007org.apache.lucene.gdata.gom.writer

GOMXmlWriter

public class GOMXmlWriter extends com.bea.xml.stream.XMLWriterBase
author
Simon Willnauer

Fields Summary
private CharsetEncoder
encoder
Constructors Summary
public GOMXmlWriter()

		super();
	
public GOMXmlWriter(Writer arg0)

param
arg0

		super(arg0);
	
Methods Summary
private voidescapeCharacters(char[] chars, int start, int length)

		for (int i = 0; i < length; i++) {
			final char c = chars[i + start];

			if (c < 32) {
				if ((c != '\t" && c != '\n")) {
					write("&#");
					write(Integer.toString(c));
					write(';");
					continue;
				}
			} else if (c > 127 && encoder != null && !encoder.canEncode(c)) {
				write("&#");
				write(Integer.toString(c));
				write(';");
				continue;
			}

			write(c);
		}
	
public voidwriteCharacters(java.lang.String aString)

see
com.bea.xml.stream.XMLWriterBase#writeCharacters(java.lang.String)

		closeStartElement();
		char[] ch = aString.toCharArray();
		escapeCharacters(ch, 0, ch.length);