biz.c24.io.api.presentation
Class FIXSource

java.lang.Object
  extended by biz.c24.io.api.presentation.Source
      extended by biz.c24.io.api.presentation.FIXSource
All Implemented Interfaces:
Serializable, Cloneable

public class FIXSource
extends Source

Note that this implementation is not synchronized. If multiple threads use an instance concurrently, it must be synchronized externally. Created by IntelliJ IDEA. User: divanmostert Date: 15/06/2011 Time: 17:22 To change this template use File | Settings | File Templates.

See Also:
Serialized Form

Constructor Summary
FIXSource()
          Constructs a new instance.
FIXSource(FIXSource clone)
          Constructs a new instance cloned from clone.
FIXSource(InputStream stream)
          Constructs a new instance which will read from stream.
FIXSource(Reader reader)
          Constructs a new instance which will read from reader.
 
Method Summary
 Object clone()
           
 int getLookAhead()
          Returns the maximum number of characters to look ahead.
 int getLookBehind()
          Returns the maximum number of characters to look behind.
 InputStream getMarkableInputStream()
           
 boolean isAllowFieldsOutOfOrder()
          Returns whether fields are in the correct order.
 boolean isAllowNoData()
          Returns whether fields with no data are allowed.
 boolean isEndOfDataRequired()
          Returns whether the stream / reader must be emptied for the read to succeed.
 boolean isIgnoreRepeatingGroupOrder()
          Returns whether repeating group data order should be checked
 boolean isIgnoreUnknownFields()
          Returns whether fields not defined in the model should be ignored
 void readObject(ComplexDataObject context)
          Reads an object from the the reader or input stream that has been set (optional operation).
 ComplexDataObject readObject(Element element)
          Reads an object from the the reader or input stream that has been set.
 boolean ready()
          Tests whether the underlying stream or reader contains more data waiting to be parsed.
 void setAllowFieldsOutOfOrder(boolean allowFieldsOutOfOrder)
          Sets whether field order should be validated.
 void setAllowNoData(boolean allowNoData)
          Sets whether to check that all fields have data associated with them.
 void setEndOfDataRequired(boolean endOfDataRequired)
          Sets whether the stream / reader must be emptied for the read to succeed.
 void setIgnoreRepeatingGroupOrder(boolean ignoreRepeatingGroupOrder)
          Sets whether repeating group order should be validated
 void setIgnoreUnknownFields(boolean ignoreUnknownFields)
          Sets whether fields not defined in the model should be ignored
 void setInputStream(InputStream stream, URI systemId)
          Sets the input stream and system ID (optional operation).
 void setLookAhead(int lookAhead)
          Sets the maximum number of characters to look ahead.
 void setLookBehind(int lookBehind)
          Sets the maximum number of characters to look behind.
 void setReader(Reader reader, URI systemId)
          Sets the reader (optional operation).
 
Methods inherited from class biz.c24.io.api.presentation.Source
checkInit, getEncoding, getInputStream, getParseListener, getReader, getSystemId, reader, setEncoding, setInputStream, setParseListener, setReader, setSystemId, stream
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FIXSource

public FIXSource()
Constructs a new instance.


FIXSource

public FIXSource(FIXSource clone)
Constructs a new instance cloned from clone.

Parameters:
clone - The instance to clone.

FIXSource

public FIXSource(Reader reader)
Constructs a new instance which will read from reader.

Parameters:
reader - The reader to read the data from.

FIXSource

public FIXSource(InputStream stream)
Constructs a new instance which will read from stream.

Parameters:
stream - The stream to read the data from.
Method Detail

ready

public boolean ready()
Description copied from class: Source
Tests whether the underlying stream or reader contains more data waiting to be parsed.
This method should be called in preference to Reader.ready() and InputStream.available() since it may need to take into account data which has been buffered by the Source implementation.

Overrides:
ready in class Source
Returns:
Whether there is unparsed data available.

getLookAhead

public int getLookAhead()
Returns the maximum number of characters to look ahead. This parameter controls the maximum buffer size beyond the current offset.

Returns:
The look ahead value.

setLookAhead

public void setLookAhead(int lookAhead)
Sets the maximum number of characters to look ahead.

Parameters:
lookAhead - The new look ahead value.

getLookBehind

public int getLookBehind()
Returns the maximum number of characters to look behind. This paraemter controls the maximum buffer size upto the current offset.

Returns:
The look behind value.

setLookBehind

public void setLookBehind(int lookBehind)
Sets the maximum number of characters to look behind.

Parameters:
lookBehind - The new look behind value.

isEndOfDataRequired

public boolean isEndOfDataRequired()
Returns whether the stream / reader must be emptied for the read to succeed.

Returns:
Whether an end of data marker is required in the stream / reader.

setEndOfDataRequired

public void setEndOfDataRequired(boolean endOfDataRequired)
Sets whether the stream / reader must be emptied for the read to succeed. This parameter should be set to false if the readObject method is to be called more than once on the same stream / reader or if the calling code is not concerned about additional data such as blank lines. Set this parameter to true (the default) if you are expecting the stream / reader to contain one and only one data instance.

Parameters:
endOfDataRequired - Whether an end of data marker is required in the stream / reader.

isAllowFieldsOutOfOrder

public boolean isAllowFieldsOutOfOrder()
Returns whether fields are in the correct order. This usually only applies to fields in sub groups and repeating groups.

Returns:
validateFieldsOutOfOrder Whether to check field order

setAllowFieldsOutOfOrder

public void setAllowFieldsOutOfOrder(boolean allowFieldsOutOfOrder)
Sets whether field order should be validated.

Parameters:
allowFieldsOutOfOrder - Whether to check field order

isAllowNoData

public boolean isAllowNoData()
Returns whether fields with no data are allowed.

Returns:
validateFieldsHaveValues Whether to check that fields have data

setAllowNoData

public void setAllowNoData(boolean allowNoData)
Sets whether to check that all fields have data associated with them.

Parameters:
allowNoData - Whether to validate that all fields have data

isIgnoreRepeatingGroupOrder

public boolean isIgnoreRepeatingGroupOrder()
Returns whether repeating group data order should be checked

Returns:
Whether repeating group data order should be checked

setIgnoreRepeatingGroupOrder

public void setIgnoreRepeatingGroupOrder(boolean ignoreRepeatingGroupOrder)
Sets whether repeating group order should be validated

Parameters:
ignoreRepeatingGroupOrder - Whether repeating group order should be validated.

isIgnoreUnknownFields

public boolean isIgnoreUnknownFields()
Returns whether fields not defined in the model should be ignored

Returns:
Whether to ignore or not

setIgnoreUnknownFields

public void setIgnoreUnknownFields(boolean ignoreUnknownFields)
Sets whether fields not defined in the model should be ignored

Parameters:
ignoreUnknownFields - Whether to ignore or not

setReader

public void setReader(Reader reader,
                      URI systemId)
Description copied from class: Source
Sets the reader (optional operation).

Overrides:
setReader in class Source
Parameters:
reader - The new value.
systemId - The system ID identifying the reader.

setInputStream

public void setInputStream(InputStream stream,
                           URI systemId)
Description copied from class: Source
Sets the input stream and system ID (optional operation).

Overrides:
setInputStream in class Source
Parameters:
stream - The new value.
systemId - The system ID identifying the stream.

readObject

public ComplexDataObject readObject(Element element)
                             throws IOException
Description copied from class: Source
Reads an object from the the reader or input stream that has been set.

Specified by:
readObject in class Source
Parameters:
element - The element declaration to which the input data is expected to adhere.
Returns:
The newly created object.
Throws:
IOException - If the complete object could not be read for any reason.

readObject

public void readObject(ComplexDataObject context)
                throws IOException
Description copied from class: Source
Reads an object from the the reader or input stream that has been set (optional operation).

Specified by:
readObject in class Source
Parameters:
context - The object into which the input data should be parsed.
Throws:
IOException - If the complete object could not be read for any reason.

getMarkableInputStream

public InputStream getMarkableInputStream()
Overrides:
getMarkableInputStream in class Source

clone

public Object clone()
Specified by:
clone in class Source


C24 Technologies © 2002-2012: All Rights Reserved.