Class SerializerImpl
- java.lang.Object
-
- org.eclipse.birt.chart.model.impl.SerializerImpl
-
- All Implemented Interfaces:
Serializer
public class SerializerImpl extends java.lang.Object implements Serializer
SerializerImpl
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCHART_END_MARKERstatic java.lang.StringCHART_START_MARKER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.ByteArrayOutputStreamasXml(Chart cModel, boolean bStripHeaders)Write the chart described by the model to a ByteArrayOutputStream.ChartfromXml(java.io.ByteArrayInputStream byais, boolean bStripHeaders)Reads the chart model from the ByteArrayInputStream.static Serializerinstance()ChartPreferencesloadPreferences(java.io.InputStream is)Loads the chart preferences from the InputStream.Chartread(java.io.InputStream is)Reads the chart model from the given InputStreamChartread(org.eclipse.emf.common.util.URI uri)Reads the chart model from the location defined by the URI provided.ChartreadEmbedded(org.eclipse.emf.common.util.URI uri)Reads the chart model embedded inside other XML content defined by the URI provided.voidsavePreferences(ChartPreferences preferences, java.io.OutputStream os)Saves the chart preferences to the specified OutputStream.voidwrite(Chart cModel, java.io.OutputStream os)Write the chart described by the model to the OutputStream provided.voidwrite(Chart cModel, org.eclipse.emf.common.util.URI uri)Write the chart described by the model to the location defined by the URI provided.
-
-
-
Field Detail
-
CHART_START_MARKER
public static final java.lang.String CHART_START_MARKER
- See Also:
- Constant Field Values
-
CHART_END_MARKER
public static final java.lang.String CHART_END_MARKER
- See Also:
- Constant Field Values
-
-
Method Detail
-
instance
public static final Serializer instance()
- Returns:
- A singleton instance of the chart serializer
-
write
public void write(Chart cModel, java.io.OutputStream os) throws java.io.IOException
Description copied from interface:SerializerWrite the chart described by the model to the OutputStream provided.- Specified by:
writein interfaceSerializer- Parameters:
cModel- The model to be serialized os The OutputStream to which the model is to be serialized- Throws:
java.io.IOException
-
write
public void write(Chart cModel, org.eclipse.emf.common.util.URI uri) throws java.io.IOException
Description copied from interface:SerializerWrite the chart described by the model to the location defined by the URI provided.- Specified by:
writein interfaceSerializer- Parameters:
cModel- The model to be serialized uri The URI to which the model is to be serialized- Throws:
java.io.IOException
-
asXml
public java.io.ByteArrayOutputStream asXml(Chart cModel, boolean bStripHeaders) throws java.io.IOException
Description copied from interface:SerializerWrite the chart described by the model to a ByteArrayOutputStream.- Specified by:
asXmlin interfaceSerializer- 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:
java.io.IOException
-
savePreferences
public void savePreferences(ChartPreferences preferences, java.io.OutputStream os) throws java.io.IOException
Description copied from interface:SerializerSaves the chart preferences to the specified OutputStream.- Specified by:
savePreferencesin interfaceSerializer- Parameters:
preferences- The ChartPreferences object to be savedos- The OutputStream to which the preferences are to be written- Throws:
java.io.IOException
-
read
public Chart read(java.io.InputStream is) throws java.io.IOException
Description copied from interface:SerializerReads the chart model from the given InputStream- Specified by:
readin interfaceSerializer- Returns:
- chart model read from the stream
- Throws:
java.io.IOException
-
read
public Chart read(org.eclipse.emf.common.util.URI uri) throws java.io.IOException
Description copied from interface:SerializerReads the chart model from the location defined by the URI provided.- Specified by:
readin interfaceSerializer- Parameters:
uri- URI of the location holding the chart model- Returns:
- chart model read from the source
- Throws:
java.io.IOException
-
readEmbedded
public Chart readEmbedded(org.eclipse.emf.common.util.URI uri) throws java.io.IOException
Description copied from interface:SerializerReads the chart model embedded inside other XML content defined by the URI provided.- Specified by:
readEmbeddedin interfaceSerializer- Parameters:
uri- URI of the location holding the embedded chart model- Returns:
- chart model read from the source
- Throws:
java.io.IOException
-
fromXml
public Chart fromXml(java.io.ByteArrayInputStream byais, boolean bStripHeaders) throws java.io.IOException
Description copied from interface:SerializerReads the chart model from the ByteArrayInputStream.- Specified by:
fromXmlin interfaceSerializer- Parameters:
byais- The ByteArrayInputStream holding the chart modelbStripHeaders- Specifies whether or not the headers were removed when the chart model was saved- Returns:
- chart model read from the stream
- Throws:
java.io.IOException
-
loadPreferences
public ChartPreferences loadPreferences(java.io.InputStream is) throws java.io.IOException
Description copied from interface:SerializerLoads the chart preferences from the InputStream.- Specified by:
loadPreferencesin interfaceSerializer- Parameters:
is- InputStream from which the chart preferences are to be read- Returns:
- ChartPreferences instance read from the stream
- Throws:
java.io.IOException
-
-