Package org.eclipse.birt.chart.model

# Interface Serializer

All Known Implementing Classes:
  `SerializerImpl`

public interface Serializer
This interface provides a means to serialize and/or de-serialize the chart model instance into XML content. Serialization is internally implemented using EMF tools using the Chart XSDs (XML schema definition(s)).

Author:
  Actuate Corporation

## Method Summary

Modifier and Type
Method
Description
`ByteArrayOutputStream`
`asXml(Chart cModel, boolean bStripHeaders)`
Write the chart described by the model to a ByteArrayOutputStream.
`Chart`
`fromXml(ByteArrayInputStream byaIS, boolean bStripHeaders)`
Reads the chart model from the ByteArrayInputStream.
`ChartPreferences`
`loadPreferences(InputStream is)`
Deprecated.
only reserved for compatibility
`Chart`
`read(InputStream is)`
Reads the chart model from the given InputStream
`Chart`
`read(org.eclipse.emf.common.util.URI uri)`
Reads the chart model from the location defined by the URI provided.
`Chart`
`readEmbedded(org.eclipse.emf.common.util.URI uri)`
Reads the chart model embedded inside other XML content defined by the URI provided.
`void`
`savePreferences(ChartPreferences preferences, OutputStream os)`
Deprecated.
only reserved for compatibility
`void`
`write(Chart cModel, OutputStream os)`
Write the chart described by the model to the OutputStream provided.
`void`
`write(Chart cModel, org.eclipse.emf.common.util.URI uri)`
Write the chart described by the model to the location defined by the URI provided.

## Method Details

### write

void write(Chart cModel, OutputStream os) throws IOException
Write the chart described by the model to the OutputStream provided.

Parameters:
  `cModel` - The model to be serialized os The OutputStream to which the model is to be serialized
Throws:
  `IOException`

### write

void write(Chart cModel, org.eclipse.emf.common.util.URI uri) throws IOException
Write the chart described by the model to the location defined by the URI provided.

Parameters:
  `cModel` - The model to be serialized uri The URI to which the model is to be serialized
Throws:
  `IOException`

### asXml

ByteArrayOutputStream asXml(Chart cModel, boolean bStripHeaders) throws IOException
Write the chart described by the model to a ByteArrayOutputStream.

Parameters:
  `cModel` - The model to be serialized bStripHeaders Specifies whether or not the headers are to be removed while serializing the model
Returns:
  the ByteArrayOutputStream containing the serialized model
Throws:
  `IOException`

### savePreferences

@Deprecated void savePreferences(ChartPreferences preferences, OutputStream os) throws IOException
Deprecated.
only reserved for compatibility
Saves the chart preferences to the specified OutputStream.

Parameters:
  `preferences` - The ChartPreferences object to be saved
  `os` - The OutputStream to which the preferences are to be written
Throws:
  `IOException`

### read

Chart read(InputStream is) throws IOException
Reads the chart model from the given InputStream

Returns:
  chart model read from the stream
Throws:
  `IOException`

### read

Chart read(org.eclipse.emf.common.util.URI uri) throws IOException
Reads the chart model from the location defined by the URI provided.

Parameters:
  `uri` - URI of the location holding the chart model
Returns:
  chart model read from the source
Throws:
  `IOException`

### readEmbedded

Chart readEmbedded(org.eclipse.emf.common.util.URI uri) throws IOException
Reads the chart model embedded inside other XML content defined by the URI provided.

Parameters:
  `uri` - URI of the location holding the embedded chart model
Returns:
  chart model read from the source
Throws:
  `IOException`

### fromXml

Chart fromXml(ByteArrayInputStream byaIS, boolean bStripHeaders) throws IOException
Reads the chart model from the ByteArrayInputStream.

Parameters:
  `byaIS` - The ByteArrayInputStream holding the chart model
  `bStripHeaders` - Specifies whether or not the headers were removed when the chart model was saved
Returns:
  chart model read from the stream
Throws:
  `IOException`

### loadPreferences

@Deprecated ChartPreferences loadPreferences(InputStream is) throws IOException
Deprecated.
only reserved for compatibility
Loads the chart preferences from the InputStream.

Parameters:
  `is` - InputStream from which the chart preferences are to be read
Returns:
  ChartPreferences instance read from the stream
Throws:
  `IOException`