|
Eclipse Platform Release 3.3 |
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectorg.eclipse.jface.text.templates.persistence.TemplateReaderWriter
Serializes templates as character or byte stream and reads the same format back.
Clients may instantiate this class, it is not intended to be subclassed.
| Constructor Summary | |
|---|---|
TemplateReaderWriter()
Create a new instance. |
|
| Method Summary | |
|---|---|
TemplatePersistenceData[] |
read(InputStream stream,
ResourceBundle bundle)
Reads templates from a stream and adds them to the templates. |
TemplatePersistenceData[] |
read(Reader reader)
Reads templates from a reader and returns them. |
TemplatePersistenceData[] |
read(Reader reader,
ResourceBundle bundle)
Reads templates from a stream and adds them to the templates. |
TemplatePersistenceData |
readSingle(Reader reader,
String id)
Reads the template with identifier id from a reader and
returns it. |
void |
save(TemplatePersistenceData[] templates,
OutputStream stream)
Saves the templates as XML, encoded as UTF-8 onto the given byte stream. |
void |
save(TemplatePersistenceData[] templates,
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 TemplateReaderWriter()
| Method Detail |
public TemplatePersistenceData[] read(Reader reader)
throws IOException
save method.
reader - the reader to read templates from
TemplatePersistenceData
IOException - if reading from the stream fails
public TemplatePersistenceData readSingle(Reader reader,
String id)
throws 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 templates fromid - the id of the template to return
TemplatePersistenceData
IOException - if reading from the stream fails
public TemplatePersistenceData[] read(Reader reader,
ResourceBundle bundle)
throws IOException
reader - the reader to read templates frombundle - a resource bundle to use for translating the read templates, or null if no translation should occur
TemplatePersistenceData
IOException - if reading from the stream fails
public TemplatePersistenceData[] read(InputStream stream,
ResourceBundle bundle)
throws IOException
stream - the byte stream to read templates frombundle - a resource bundle to use for translating the read templates, or null if no translation should occur
TemplatePersistenceData
IOException - if reading from the stream fails
public void save(TemplatePersistenceData[] templates,
OutputStream stream)
throws IOException
templates - the templates to savestream - the byte output to write the templates to in XML
IOException - if writing the templates fails
public void save(TemplatePersistenceData[] templates,
Writer writer)
throws IOException
templates - the templates to savewriter - the writer to write the templates to in XML
IOException - if writing the templates fails
|
Eclipse Platform Release 3.3 |
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.