|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.prowidesoftware.swift.model.SwiftBlock
com.prowidesoftware.swift.model.SwiftTagListBlock
com.prowidesoftware.swift.model.SwiftBlockUser
public class SwiftBlockUser
Base class for SWIFT User "ad-hoc" Blocks (blocks with number other than 1-5 or names).
The assumption is that these User Defined Blocks are used and defined as tag blocks (meaning
that these blocks behave like a block 3 or 5).
NOTE: this is not part of SWIFT standard, but seems to be common practice for
users to append some locally defined blocks to annotate messages in a semi-compatible
way (for example: add block 9 for some local information or block "S" for system reference).
Field Summary | |
---|---|
protected java.lang.String |
blockName
Block name. |
protected java.lang.Integer |
sortKey
Indicates the position of this user block in a message when persisted. |
Fields inherited from class com.prowidesoftware.swift.model.SwiftTagListBlock |
---|
tags |
Fields inherited from class com.prowidesoftware.swift.model.SwiftBlock |
---|
blockType, id, input, output, unparsedTexts |
Constructor Summary | |
---|---|
SwiftBlockUser()
Default constructor |
|
SwiftBlockUser(java.lang.Integer blockNumber)
Constructor for empty numbered user block |
|
SwiftBlockUser(java.lang.Integer blockNumber,
java.util.List<Tag> tags)
Constructor for numbered user block with tag initialization |
|
SwiftBlockUser(java.lang.String blockName)
Constructor for named user block |
|
SwiftBlockUser(java.lang.String blockName,
java.util.List<Tag> tags)
Constructor for named user block with tag initialization |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
getBlockName()
The block name. |
java.lang.String |
getName()
Returns the block name (this method is to be overwritten for derived classes). |
java.lang.Integer |
getNumber()
Returns the block number (if it can be converted to an integer, -1 otherwise). |
java.lang.Integer |
getSortKey()
get the sortkey of this user block when persisted |
int |
hashCode()
|
protected java.lang.Boolean |
isValidName()
Checks if the block name (and or number) is valid for a user defined block. |
static java.lang.Boolean |
isValidName(java.lang.Integer blockNumber)
Checks if the block number is valid for a user defined block. |
static java.lang.Boolean |
isValidName(java.lang.String blockName)
Checks if the block name is valid for a user defined block. |
static java.lang.Boolean |
isValidName(java.lang.String blockName,
java.lang.Integer blockNumber)
Checks if the block name and are valid for a user defined block. |
protected void |
setBlockName(java.lang.String blockName)
Sets the block name. |
protected void |
setBlockNumber(java.lang.Integer blockNumber)
Sets the block number. |
void |
setSortKey(java.lang.Integer sortKey)
Set the sortkey of this user block when persisted. |
Methods inherited from class com.prowidesoftware.swift.model.SwiftTagListBlock |
---|
add, addTag, addTags, containsAnyOf, containsField, containsTag, containsTag, containsTag, getField, getFieldByName, getFieldsByName, getSubBlock, getSubBlock, getSubBlock, getSubBlockAfterFirst, getSubBlockAfterLast, getSubBlockByIndex, getSubBlocks, getSubBlocks, getSubBlocks, getSubBlocks, getSubBlocks, getSubBlocks, getTag, getTagByName, getTagByNumber, getTagCount, getTagCount, getTagIndex, getTagMap, getTags, getTagsByContent, getTagsByName, getTagsByValue, getTagValue, getTagValues, isEmpty, removeAll, removeTag, removeUntilFirst, setTags, setTags, size, splitByTagName, tagIterator, toString, trimAfterFirst, visit |
Methods inherited from class com.prowidesoftware.swift.model.SwiftBlock |
---|
getBlockType, getId, getInput, getOutput, getUnparsedTexts, getUnparsedTextsSize, isTagBlock, setBlockType, setId, setInput, setOutput, setUnparsedTexts, unparsedTextAddText, unparsedTextAddText, unparsedTextGetAsMessage, unparsedTextGetText, unparsedTextIsMessage, unparsedTextVerify |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.Integer sortKey
protected java.lang.String blockName
Constructor Detail |
---|
public SwiftBlockUser()
public SwiftBlockUser(java.lang.Integer blockNumber)
blockNumber
- the block number to initialize
java.lang.IllegalArgumentException
- if parameter blockNumber is null
java.lang.IllegalArgumentException
- if parameter blockNumber is not a valid User Defined Block number (values 6..9)public SwiftBlockUser(java.lang.Integer blockNumber, java.util.List<Tag> tags)
blockNumber
- the block number to initializetags
- the list of tags to initialize
java.lang.IllegalArgumentException
- if parameter blockNumber or tags are null
java.lang.IllegalArgumentException
- if parameter blockNumber is not a valid User Defined Block number (values 6..9)
java.lang.IllegalArgumentException
- if parameter tags is not composed of Stringspublic SwiftBlockUser(java.lang.String blockName)
blockName
- the block name to initialize
java.lang.IllegalArgumentException
- if parameter blockName is null
java.lang.IllegalArgumentException
- if parameter blockName is not a valid User Defined Block name (single letter)public SwiftBlockUser(java.lang.String blockName, java.util.List<Tag> tags)
blockName
- the block name to initializetags
- the list of tags to initialize
java.lang.IllegalArgumentException
- if parameter blockName or tags are null
java.lang.IllegalArgumentException
- if parameter blockName is not a valid User Defined Block name (single letter)
java.lang.IllegalArgumentException
- if parameter tags is not composed of StringsMethod Detail |
---|
public java.lang.Integer getNumber()
getNumber
in class SwiftTagListBlock
public java.lang.String getName()
SwiftBlock
getName
in class SwiftTagListBlock
getBlockName()
public java.lang.String getBlockName()
protected void setBlockNumber(java.lang.Integer blockNumber)
blockName
setBlockNumber
in class SwiftTagListBlock
blockNumber
- the block number to set
java.lang.IllegalArgumentException
- if parameter blockNumber is null
java.lang.IllegalArgumentException
- if parameter blockNumber is not a valid User Defined Block number (values 6..9)protected void setBlockName(java.lang.String blockName)
setBlockName
in class SwiftTagListBlock
blockName
- the block name to set
java.lang.IllegalArgumentException
- if parameter blockName is null
java.lang.IllegalArgumentException
- if parameter blockName is not a valid User Defined Block name (single letter)protected java.lang.Boolean isValidName()
public static java.lang.Boolean isValidName(java.lang.String blockName, java.lang.Integer blockNumber)
blockName
- the block nameblockNumber
- the block number
public static java.lang.Boolean isValidName(java.lang.String blockName)
blockName
- the block name
public static java.lang.Boolean isValidName(java.lang.Integer blockNumber)
blockNumber
- the block number
public java.lang.Integer getSortKey()
sortKey
public void setSortKey(java.lang.Integer sortKey)
sortKey
- the new sortkeypublic int hashCode()
hashCode
in class SwiftTagListBlock
public boolean equals(java.lang.Object obj)
equals
in class SwiftTagListBlock
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |