|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.palamedes.ui.preferences.stylesheets.StylesheetReaderWriter
public class StylesheetReaderWriter
Serializes style sheet as character or byte stream and reads the same format back.
Constructor Summary | |
---|---|
StylesheetReaderWriter()
Create a new instance. |
Method Summary | |
---|---|
StylesheetPersistenceData[] |
read(java.io.InputStream stream,
java.util.ResourceBundle bundle)
Reads style sheet from a stream and adds them to the style sheets. |
StylesheetPersistenceData[] |
read(java.io.Reader reader)
Reads style sheets from a reader and returns them. |
StylesheetPersistenceData[] |
read(java.io.Reader reader,
java.util.ResourceBundle bundle)
Reads style sheet from a stream and adds them to the style sheets. |
StylesheetPersistenceData |
readSingle(java.io.Reader reader,
java.lang.String id)
Reads the style sheet with identifier id from a reader and
returns it. |
void |
save(StylesheetPersistenceData[] styles,
java.io.OutputStream stream)
Saves the templates as XML, encoded as UTF-8 onto the given byte stream. |
void |
save(StylesheetPersistenceData[] templates,
java.io.Writer writer)
Saves the templates as XML. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StylesheetReaderWriter()
Method Detail |
---|
public StylesheetPersistenceData[] read(java.io.InputStream stream, java.util.ResourceBundle bundle) throws java.io.IOException
stream
- the byte stream to read style sheets frombundle
- a resource bundle to use for translating the read style
sheets, or null
if no translation should occur
StylesheetPersistenceData
java.io.IOException
- if reading from the stream failspublic StylesheetPersistenceData[] read(java.io.Reader reader) throws java.io.IOException
save
method.
reader
- the reader to read templates from
TemplatePersistenceData
java.io.IOException
- if reading from the stream failspublic StylesheetPersistenceData[] read(java.io.Reader reader, java.util.ResourceBundle bundle) throws java.io.IOException
reader
- the reader to read style sheets frombundle
- a resource bundle to use for translating the read style
sheets, or null
if no translation should occur
StylesheetPersistenceData
java.io.IOException
- if reading from the stream failspublic StylesheetPersistenceData readSingle(java.io.Reader reader, java.lang.String id) throws java.io.IOException
id
from a reader and
returns it. The reader must present a serialized form as produced by the
save
method.
reader
- the reader to read style sheets fromid
- the id of the style sheet to return
StylesheetPersistenceData
java.io.IOException
- if reading from the stream failspublic void save(StylesheetPersistenceData[] styles, java.io.OutputStream stream) throws java.io.IOException
stream
- the byte output to write the templates to in XML
java.io.IOException
- if writing the templates failspublic void save(StylesheetPersistenceData[] templates, java.io.Writer writer) throws java.io.IOException
templates
- the templates to savewriter
- the writer to write the templates to in XML
java.io.IOException
- if writing the templates fails
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |