com.threerings.whirled.tools.xml

## Class SceneWriter

- java.lang.Object
- - com.threerings.whirled.tools.xml.SceneWriter

Direct Known Subclasses:
  StageSceneWriter

    public class SceneWriter
    extends Object

Generates an XML representation of an `SceneModel`.

### Field Summary

Fields
`static String` `OUTER_ELEMENT` The outer element used to enclose our scene definition.

### Constructor Summary

Constructors
Constructor and Description
`SceneWriter()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `registerAuxWriter(Class<?> aclass, com.threerings.tools.xml.NestableWriter writer)` Registers a writer for writing auxiliary scene models of the supplied class.
`void` `writeScene(File out, SceneModel model)` Writes the supplied scene out to the specified file.
`void` `writeSceneModel(SceneModel model, com.megginson.sax.DataWriter writer)` Writes the data for the supplied `SceneModel` to the XML data writer supplied.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### OUTER_ELEMENT

    public static final String OUTER_ELEMENT

The outer element used to enclose our scene definition.

See Also:
  Constant Field Values

### Constructor Detail

#### SceneWriter

    public SceneWriter()

### Method Detail

#### registerAuxWriter

    public void registerAuxWriter(Class<?> aclass,
                                  com.threerings.tools.xml.NestableWriter writer)

Registers a writer for writing auxiliary scene models of the supplied class.

#### writeScene

    public void writeScene(File out,
                           SceneModel model)
                    throws IOException,
                           SAXException

Writes the supplied scene out to the specified file.

Throws:
  `IOException`
  `SAXException`

#### writeSceneModel

    public void writeSceneModel(SceneModel model,
                                com.megginson.sax.DataWriter writer)
                         throws SAXException

Writes the data for the supplied `SceneModel` to the XML data writer supplied. The writer should already be configured with the appropriate indentation level so that this writer can simply output its elements and allow the calling code to determine where in the greater scene description file the scene data should live.

Throws:
  `SAXException`