PageMixer API - 3.1

jp.ne.dti.lares.foozy.pagemixer.mixer
Class PersistentProducer

java.lang.Object
  |
  +--jp.ne.dti.lares.foozy.pagemixer.mixer.PersistentProducer
All Implemented Interfaces:
Producer.Factory

public class PersistentProducer
extends java.lang.Object
implements Producer.Factory

Utility to handle persistent producer.


Constructor Summary
PersistentProducer()
          Constructor.
PersistentProducer(SymbolSet symbolSet)
          Constructor.
 
Method Summary
 Producer create(java.io.InputStream stream, java.lang.String encoding)
          Create "Producer".
 Producer read(java.io.ObjectInputStream stream)
          Read producer identified by specified id in.
 Producer read(java.lang.String filename)
          Read producer from specified file.
static void write(java.io.ObjectOutputStream stream, Producer producer)
          Write producer out to specified OutputStream.
static void write(java.lang.String filename, Producer producer)
          Write producer out.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistentProducer

public PersistentProducer()
Constructor.

This causes HTMLSymbolSet using to resolve symbol of tokens contained by producer. If you want use another SymbolSet, use PersistentProducer(SymbolSet).


PersistentProducer

public PersistentProducer(SymbolSet symbolSet)
Constructor.
Parameters:
symbolSet - symbl set to resolve symbols of tokens
Method Detail

read

public final Producer read(java.lang.String filename)
                    throws java.io.IOException,
                           java.lang.ClassNotFoundException
Read producer from specified file.
Parameters:
filename - of persistent Producer
Returns:
producer read in
Throws:
java.io.IOException - thrown when I/O fail for some reasons
java.lang.ClassNotFoundException - thrown in object reading in

read

public Producer read(java.io.ObjectInputStream stream)
              throws java.io.IOException,
                     java.lang.ClassNotFoundException
Read producer identified by specified id in.
Parameters:
stream - to read page from
Returns:
producer read in
Throws:
java.io.IOException - thrown when I/O fail for some reasons
java.lang.ClassNotFoundException - thrown in object reading in

write

public static void write(java.lang.String filename,
                         Producer producer)
                  throws java.io.IOException
Write producer out.

This causes writing producer out to specified filename. If you want to write producer out to your custom output stream, use write(ObjectOutputStream, Producer).

Parameters:
filename - to write producer out
producer - written out
Throws:
java.io.IOException - thrown when I/O fail for some reasons

write

public static void write(java.io.ObjectOutputStream stream,
                         Producer producer)
                  throws java.io.IOException
Write producer out to specified OutputStream.

This method does not close specified ObjectOutputStream

Please close it explicitly after invocation of this method.

Parameters:
outStream - to write producer out
producer - written out
Throws:
java.io.IOException - thrown when I/O fail for some reasons

create

public Producer create(java.io.InputStream stream,
                       java.lang.String encoding)
                throws java.io.IOException
Create "Producer".
Specified by:
create in interface Producer.Factory
Parameters:
stream - to read persistent producer in
encoding - (this parameter is ignored)
Since:
PageMixer 3.0

PageMixer API - 3.1