com.infoteria.asteria.flowlibrary2.stream
Class StreamFactory

java.lang.Object
  |
  +--com.infoteria.asteria.flowlibrary2.stream.StreamFactory
Direct Known Subclasses:
StreamFactoryBinary, StreamFactoryParameterList, StreamFactoryRecord, StreamFactoryText

public abstract class StreamFactory
extends java.lang.Object

ストリームファクトリ。
ストリームファクトリはコンポーネントで設定されたフィールド定義とストリームプロパティを保持し、 ストリームに対して適用します。


Constructor Summary
protected StreamFactory()
           
protected StreamFactory(com.infoteria.asteria.flowlibrary2.stream.strategy.IStreamStrategy strategy)
           
protected StreamFactory(StreamFactory factory)
           
 
Method Summary
 void addProperty(java.lang.String name, java.lang.String value)
          ストリーム定義のプロパティを設定します
protected static boolean compare(java.lang.Object o1, java.lang.Object o2)
           
 StreamDataObject create()
          Create a StreamDataObject instance.
abstract  StreamDataObject create(byte[] b)
          バイト列を基にストリームを作成します。
返り値のストリームにはストリームプロパティが適用されています。
 StreamDataObject create(java.io.File file)
          Fileオブジェクトからストリームを作成します。
 StreamDataObject create(java.io.InputStream is)
          java.io.InputStreamからストリームを作成します。
 StreamDataObject createEmptyStream()
          空のストリームを作成します。
protected  boolean doEquals(StreamFactory sf)
           
 boolean equals(java.lang.Object o)
           
 java.io.OutputStream getFactoryOutputStream()
          Get OutputStream to write stream data to.
 FieldDefinition getFieldDefinition()
          フィールド定義を取得します。
static StreamFactory getInstance(int type)
          StreamTypeに応じたStreamFactoryのインスタンスを生成します
static StreamFactory getInstance(int type, com.infoteria.asteria.flowlibrary2.stream.strategy.IStreamStrategy streamFactoryStrategy)
          StreamTypeに応じたStreamFactoryのインスタンスを生成します
 int getType()
          このファクトリのストリームフォーマットを返します。
返り値はStreamTypeクラスで宣言されているシンボルのいずれかになります。
 void initialize()
          Initialize instance and discard previously added data.
 void setFieldDefinition(FieldDefinition value)
          フィールド定義を設定します。
 void setNeedCheckpointParse(boolean b)
           
 void setProperties(StreamDataObject stream)
          引数のstreamに対してストリームプロパティを適用します。
引数のstreamに既にストリームプロパティが設定されている場合は何もしません。
 void terminate()
          Close any resources and discard previously added data.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamFactory

protected StreamFactory()

StreamFactory

protected StreamFactory(com.infoteria.asteria.flowlibrary2.stream.strategy.IStreamStrategy strategy)

StreamFactory

protected StreamFactory(StreamFactory factory)
Method Detail

getInstance

public static StreamFactory getInstance(int type)
StreamTypeに応じたStreamFactoryのインスタンスを生成します

getInstance

public static StreamFactory getInstance(int type,
                                        com.infoteria.asteria.flowlibrary2.stream.strategy.IStreamStrategy streamFactoryStrategy)
StreamTypeに応じたStreamFactoryのインスタンスを生成します

addProperty

public void addProperty(java.lang.String name,
                        java.lang.String value)
                 throws CompileException
ストリーム定義のプロパティを設定します

setProperties

public void setProperties(StreamDataObject stream)
                   throws StreamException
引数のstreamに対してストリームプロパティを適用します。
引数のstreamに既にストリームプロパティが設定されている場合は何もしません。

setFieldDefinition

public void setFieldDefinition(FieldDefinition value)
フィールド定義を設定します。

getFieldDefinition

public FieldDefinition getFieldDefinition()
フィールド定義を取得します。

getType

public int getType()
このファクトリのストリームフォーマットを返します。
返り値はStreamTypeクラスで宣言されているシンボルのいずれかになります。

initialize

public void initialize()
Initialize instance and discard previously added data. Used together with "add" methods, create() and terminate(). Example usage:
 
 try {
 	initialize();
 	add(dataPart1);
 	add(dataPart2);
 	stream = create();
 } finally {
 	terminate();
 }
 
 

getFactoryOutputStream

public java.io.OutputStream getFactoryOutputStream()
                                            throws StreamException
Get OutputStream to write stream data to. Call #initialize(StreamProperties) prior to this method. When finished writing all data to the output stream, call #create(StreamProperties) to create the stream object. Data can only be provided either with #getFactoryOutputStream(StreamProperties) or "add" methods, but not both.
Parameters:
streamProperties - properties to use for the new stream
Returns:
the output stream to write stream data to
Throws:
StreamException -  

terminate

public void terminate()
Close any resources and discard previously added data. See initialize() for more details.

create

public abstract StreamDataObject create(byte[] b)
                                 throws StreamException
バイト列を基にストリームを作成します。
返り値のストリームにはストリームプロパティが適用されています。

create

public StreamDataObject create()
                        throws StreamException
Create a StreamDataObject instance. If data is available from previous calls of "add" methods, the instance will be created using these data. Otherwise, an empty StreamDataObject instance will be returned. This method automatically calls terminate() in the end. See initialize() for more details.
返り値のストリームにはストリームプロパティが適用されています。
Returns:
the new stream object
Throws:
StreamException - in case of an exception

createEmptyStream

public StreamDataObject createEmptyStream()
                                   throws StreamException
空のストリームを作成します。

create

public StreamDataObject create(java.io.File file)
                        throws StreamException
Fileオブジェクトからストリームを作成します。

create

public StreamDataObject create(java.io.InputStream is)
                        throws StreamException
java.io.InputStreamからストリームを作成します。

compare

protected static boolean compare(java.lang.Object o1,
                                 java.lang.Object o2)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

doEquals

protected boolean doEquals(StreamFactory sf)

setNeedCheckpointParse

public void setNeedCheckpointParse(boolean b)