Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.jface.text.templates.persistence
Class TemplateReaderWriter

java.lang.Object
  extended by 
org.eclipse.jface.text.templates.persistence.TemplateReaderWriter

public class TemplateReaderWriter
extends Object

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.

Since:
3.0
Restriction:
This class is not intended to be subclassed by clients.

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

TemplateReaderWriter

public TemplateReaderWriter()
Create a new instance.

Method Detail

read

public 
TemplatePersistenceData[] read(
Reader reader)
                               throws 
IOException
Reads templates from a reader and returns them. The reader must present a serialized form as produced by the save method.

Parameters:
reader - the reader to read templates from
Returns:
the read templates, encapsulated in instances of TemplatePersistenceData
Throws:
IOException - if reading from the stream fails

readSingle

public 
TemplatePersistenceData readSingle(
Reader reader,
                                          
String id)
                                   throws 
IOException
Reads the template with identifier id from a reader and returns it. The reader must present a serialized form as produced by the save method.

Parameters:
reader - the reader to read templates from
id - the id of the template to return
Returns:
the read template, encapsulated in an instances of TemplatePersistenceData
Throws:
IOException - if reading from the stream fails
Since:
3.1

read

public 
TemplatePersistenceData[] read(
Reader reader,
                                      
ResourceBundle bundle)
                               throws 
IOException
Reads templates from a stream and adds them to the templates.

Parameters:
reader - the reader to read templates from
bundle - a resource bundle to use for translating the read templates, or null if no translation should occur
Returns:
the read templates, encapsulated in instances of TemplatePersistenceData
Throws:
IOException - if reading from the stream fails

read

public 
TemplatePersistenceData[] read(
InputStream stream,
                                      
ResourceBundle bundle)
                               throws 
IOException
Reads templates from a stream and adds them to the templates.

Parameters:
stream - the byte stream to read templates from
bundle - a resource bundle to use for translating the read templates, or null if no translation should occur
Returns:
the read templates, encapsulated in instances of TemplatePersistenceData
Throws:
IOException - if reading from the stream fails

save

public void save(
TemplatePersistenceData[] templates,
                 
OutputStream stream)
          throws 
IOException
Saves the templates as XML, encoded as UTF-8 onto the given byte stream.

Parameters:
templates - the templates to save
stream - the byte output to write the templates to in XML
Throws:
IOException - if writing the templates fails

save

public void save(
TemplatePersistenceData[] templates,
                 
Writer writer)
          throws 
IOException
Saves the templates as XML.

Parameters:
templates - the templates to save
writer - the writer to write the templates to in XML
Throws:
IOException - if writing the templates fails

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire