All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----org.xmlmiddleware.xmlutils.XMLWriter | +----org.xmlmiddleware.xmldbms.filters.FilterSerializer
If you want to use a specific encoding, the Writer must be an OutputStreamWriter or a subclass of an OutputStreamWriter. For example, you might use the following code to write a map file with the Shift_JIS encoding:
// Construct the FileOutputStream. OutputStream out = new FileOutputStream("sales.map");
// Construct the OutputStreamWriter with the Shift_JIS encoding. This may // throw an UnsupportedEncodingException. Writer writer = new OutputStreamWriter(out, "Shift_JIS");
// Construct the FilterSerializer. FilterSerializer serializer = new FilterSerializer(writer);
// Serialize the filter set. serializer.serialize(filterSet);
// Close the file. writer.close();
If you want to use the default encoding, you can just use a FileWriter. However, no encoding declaration will be written in the XML declaration. For example:
// Construct a new FileWriter. Writer writer = new FileWriter("sales.map");
// Construct the FilterSerializer. FilterSerializer serializer = new FilterSerializer(writer);
// Serialize the filter set. serializer.serialize(filterSet);
// Close the file. writer.close();
public FilterSerializer()
public FilterSerializer(Writer writer)
public void setWriter(Writer writer)
public void serialize(FilterSet filterSet) throws IOException
No system or public ID is written in the DOCTYPE statement.
public void serialize(FilterSet filterSet, String systemID, String publicID) throws IOException
All Packages Class Hierarchy This Package Previous Next Index