Class FINWriterVisitor
- java.lang.Object
-
- com.prowidesoftware.swift.io.writer.FINWriterVisitor
-
- All Implemented Interfaces:
IMessageVisitor
public class FINWriterVisitor extends java.lang.Object implements IMessageVisitor
Main class for writing SwiftMessage objects into SWIFT FIN message text.The implementation preserves the EOLS as they are found in the message object. This is particularly important for block 4 where fields can have multiple lines. To serialize into a compliant FIN text you can apply
SwiftWriter.ensureEols(String)to the result.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSWIFT_EOLEOL as defined by swift
-
Constructor Summary
Constructors Constructor Description FINWriterVisitor(java.io.Writer writer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendBlock1(SwiftBlock1 b)voidendBlock2(SwiftBlock2 b)voidendBlock3(SwiftBlock3 b)voidendBlock4(SwiftBlock4 b)voidendBlock5(SwiftBlock5 b)voidendBlockUser(SwiftBlockUser b)voidendMessage(SwiftMessage m)protected java.lang.StringgetTagValue(Tag t, int block)Returns the tags value.booleanisTrimTagValues()voidsetTrimTagValues(boolean trimTagValues)voidstartBlock1(SwiftBlock1 b)voidstartBlock2(SwiftBlock2 b)voidstartBlock3(SwiftBlock3 b)voidstartBlock4(SwiftBlock4 b)voidstartBlock5(SwiftBlock5 b)voidstartBlockUser(SwiftBlockUser b)voidstartMessage(SwiftMessage m)voidtag(SwiftBlock3 b, Tag t)voidtag(SwiftBlock4 b, Tag t)voidtag(SwiftBlock5 b, Tag t)voidtag(SwiftBlockUser b, Tag t)voidvalue(SwiftBlock1 b, java.lang.String v)voidvalue(SwiftBlock2 b, java.lang.String v)
-
-
-
Field Detail
-
SWIFT_EOL
public static final java.lang.String SWIFT_EOL
EOL as defined by swift- See Also:
- Constant Field Values
-
-
Method Detail
-
isTrimTagValues
public boolean isTrimTagValues()
- Returns:
- true if the visitor is setup to trim tag values
- Since:
- 8.0.2
-
setTrimTagValues
public void setTrimTagValues(boolean trimTagValues)
- Parameters:
trimTagValues- true if the visitor should trim tag values (it is false by default)- Since:
- 8.0.2
-
startMessage
public void startMessage(SwiftMessage m)
- Specified by:
startMessagein interfaceIMessageVisitor
-
endMessage
public void endMessage(SwiftMessage m)
- Specified by:
endMessagein interfaceIMessageVisitor
-
startBlock1
public void startBlock1(SwiftBlock1 b)
- Specified by:
startBlock1in interfaceIMessageVisitor- Parameters:
b- block to visit
-
value
public void value(SwiftBlock1 b, java.lang.String v)
- Specified by:
valuein interfaceIMessageVisitor
-
endBlock1
public void endBlock1(SwiftBlock1 b)
- Specified by:
endBlock1in interfaceIMessageVisitor- Parameters:
b- block to visit
-
startBlock2
public void startBlock2(SwiftBlock2 b)
- Specified by:
startBlock2in interfaceIMessageVisitor- Parameters:
b- block to visit
-
value
public void value(SwiftBlock2 b, java.lang.String v)
- Specified by:
valuein interfaceIMessageVisitor
-
endBlock2
public void endBlock2(SwiftBlock2 b)
- Specified by:
endBlock2in interfaceIMessageVisitor- Parameters:
b- block to visit
-
startBlock3
public void startBlock3(SwiftBlock3 b)
- Specified by:
startBlock3in interfaceIMessageVisitor- Parameters:
b- block to visit
-
tag
public void tag(SwiftBlock3 b, Tag t)
- Specified by:
tagin interfaceIMessageVisitor
-
endBlock3
public void endBlock3(SwiftBlock3 b)
- Specified by:
endBlock3in interfaceIMessageVisitor- Parameters:
b- block to visit
-
startBlock4
public void startBlock4(SwiftBlock4 b)
- Specified by:
startBlock4in interfaceIMessageVisitor- Parameters:
b- block to visit
-
tag
public void tag(SwiftBlock4 b, Tag t)
- Specified by:
tagin interfaceIMessageVisitor
-
endBlock4
public void endBlock4(SwiftBlock4 b)
- Specified by:
endBlock4in interfaceIMessageVisitor- Parameters:
b- block to visit
-
startBlock5
public void startBlock5(SwiftBlock5 b)
- Specified by:
startBlock5in interfaceIMessageVisitor- Parameters:
b- block to visit
-
tag
public void tag(SwiftBlock5 b, Tag t)
- Specified by:
tagin interfaceIMessageVisitor
-
endBlock5
public void endBlock5(SwiftBlock5 b)
- Specified by:
endBlock5in interfaceIMessageVisitor- Parameters:
b- block to visit
-
startBlockUser
public void startBlockUser(SwiftBlockUser b)
- Specified by:
startBlockUserin interfaceIMessageVisitor- Parameters:
b- block to visit
-
tag
public void tag(SwiftBlockUser b, Tag t)
- Specified by:
tagin interfaceIMessageVisitor
-
endBlockUser
public void endBlockUser(SwiftBlockUser b)
- Specified by:
endBlockUserin interfaceIMessageVisitor- Parameters:
b- block to visit
-
getTagValue
protected java.lang.String getTagValue(Tag t, int block)
Returns the tags value.- Returns:
- the tag value removing the block number if present
-
-