|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.prowidesoftware.swift.model.SwiftBlock
public abstract class SwiftBlock
Base class for a generic SWIFT block.
This is an abstract class so specific block classes for each block (block 1, 2, 3, etc...)
should be instantiated.
Instances of this class may have a list of unparsed texts (UnparsedTextList).
For easy access, methods have been created that first ensure the lists exists (the
real object is created and then call the base method).
However, not all the base list methods have been implemented. If you need to use not
exposed functionality, retrieve the underlying list with (see getUnparsedTexts method)
Field Summary | |
---|---|
protected java.lang.String |
blockType
helper for hibernate mapping |
protected java.lang.Long |
id
Unique identifier of the swift block. |
protected java.lang.Boolean |
input
Only valid for block2, only when using hibernate for persistence |
protected java.lang.Boolean |
output
Only valid for block2, only when using hibernate for persistence |
protected UnparsedTextList |
unparsedTexts
List of unparsed texts. |
Constructor Summary | |
---|---|
SwiftBlock()
Default constructor, shouldn't be used normally. |
|
SwiftBlock(UnparsedTextList unparsedText)
Constructor for an unparsed text list |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
getBlockType()
|
java.lang.Long |
getId()
Get the unique identifier of this block or null if it is not set |
java.lang.Boolean |
getInput()
Deprecated. use getBlockType() |
abstract java.lang.String |
getName()
Returns the block name (this method is to be overwritten for derived classes). |
abstract java.lang.Integer |
getNumber()
Returns the block number (this method is to be overwritten for derived classes). |
java.lang.Boolean |
getOutput()
Deprecated. use getBlockType() |
UnparsedTextList |
getUnparsedTexts()
Returns the unparsed text list attached to the Block. |
java.lang.Integer |
getUnparsedTextsSize()
returns the size of the unparsed text list |
int |
hashCode()
|
boolean |
isTagBlock()
Tell if this block is a block that contains a list of tags (3-5) or is a block with fixed length value (1-2) |
protected abstract void |
setBlockName(java.lang.String blockName)
Sets the block name (this method is to be overwrite for derived classes). |
protected abstract void |
setBlockNumber(java.lang.Integer blockNumber)
Sets the block number (this method is to be overwrite for derived classes). |
void |
setBlockType(java.lang.String blockType)
should not be normally called |
void |
setId(java.lang.Long id)
Sets the unique identifier of this block |
void |
setInput(java.lang.Boolean input)
Only valid for block2, only when using hibernate for persistence |
void |
setOutput(java.lang.Boolean output)
Only valid for block2, only when using hibernate for persistence |
void |
setUnparsedTexts(UnparsedTextList texts)
sets the list of unparsed texts |
java.lang.String |
toString()
|
void |
unparsedTextAddText(java.lang.String text)
adds a new unparsed text |
void |
unparsedTextAddText(SwiftMessage message)
adds a new unparsed text from a message |
SwiftMessage |
unparsedTextGetAsMessage(java.lang.Integer index)
get an unparsed text as a parsed swift message |
java.lang.String |
unparsedTextGetText(java.lang.Integer index)
get an unparsed text |
java.lang.Boolean |
unparsedTextIsMessage(java.lang.Integer index)
decides if a specific text (by index) is likely a SWIFT FIN message. |
protected void |
unparsedTextVerify()
verifies that the unparsed text list exists |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.Long id
protected UnparsedTextList unparsedTexts
protected java.lang.Boolean input
protected java.lang.Boolean output
protected java.lang.String blockType
Constructor Detail |
---|
public SwiftBlock()
public SwiftBlock(UnparsedTextList unparsedText)
unparsedText
- the list of unparsed textsMethod Detail |
---|
public java.lang.String getBlockType()
null
if not implementedpublic void setBlockType(java.lang.String blockType)
blockType
- protected abstract void setBlockNumber(java.lang.Integer blockNumber)
blockNumber
- the block number to setprotected abstract void setBlockName(java.lang.String blockName)
blockName
- the block name to setpublic abstract java.lang.Integer getNumber()
public abstract java.lang.String getName()
public java.lang.Long getId()
null
if it is not set
public void setId(java.lang.Long id)
id
- the unique identifier to set.public java.lang.String toString()
toString
in class java.lang.Object
public boolean isTagBlock()
true
if this object contains a list of tags (which may be empty or null
protected void unparsedTextVerify()
public UnparsedTextList getUnparsedTexts()
public void setUnparsedTexts(UnparsedTextList texts)
texts
- the new list of unparsed texts (may be null)public java.lang.Integer getUnparsedTextsSize()
public java.lang.Boolean unparsedTextIsMessage(java.lang.Integer index)
index
- the unparsed text number
java.lang.IllegalArgumentException
- if parameter index is null
java.lang.IndexOutOfBoundsException
- if parameter index is out of boundspublic java.lang.String unparsedTextGetText(java.lang.Integer index)
index
- the unparsed text number
java.lang.IllegalArgumentException
- if parameter index is null
java.lang.IndexOutOfBoundsException
- if parameter index is out of boundspublic SwiftMessage unparsedTextGetAsMessage(java.lang.Integer index)
index
- the unparsed text number
java.lang.IllegalArgumentException
- if parameter index is null
public void unparsedTextAddText(java.lang.String text)
text
- the unparsed text to append
java.lang.IllegalArgumentException
- if parameter text is null
public void unparsedTextAddText(SwiftMessage message)
message
- the message to be appended
java.lang.IllegalArgumentException
- if parameter message is null
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.Boolean getInput()
getBlockType()
2I
public void setInput(java.lang.Boolean input)
input
- the is input parameterpublic java.lang.Boolean getOutput()
getBlockType()
true
if message block type is 2O
public void setOutput(java.lang.Boolean output)
output
- the is output parameter
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |