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.String
SWIFT_EOL
EOL 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 void
endBlock1(SwiftBlock1 b)
void
endBlock2(SwiftBlock2 b)
void
endBlock3(SwiftBlock3 b)
void
endBlock4(SwiftBlock4 b)
void
endBlock5(SwiftBlock5 b)
void
endBlockUser(SwiftBlockUser b)
void
endMessage(SwiftMessage m)
protected java.lang.String
getTagValue(Tag t, int block)
Returns the tags value.boolean
isTrimTagValues()
void
setTrimTagValues(boolean trimTagValues)
void
startBlock1(SwiftBlock1 b)
void
startBlock2(SwiftBlock2 b)
void
startBlock3(SwiftBlock3 b)
void
startBlock4(SwiftBlock4 b)
void
startBlock5(SwiftBlock5 b)
void
startBlockUser(SwiftBlockUser b)
void
startMessage(SwiftMessage m)
void
tag(SwiftBlock3 b, Tag t)
void
tag(SwiftBlock4 b, Tag t)
void
tag(SwiftBlock5 b, Tag t)
void
tag(SwiftBlock b, Tag t)
void
tag(SwiftBlockUser b, Tag t)
void
value(SwiftBlock1 b, java.lang.String v)
void
value(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:
startMessage
in interfaceIMessageVisitor
-
endMessage
public void endMessage(SwiftMessage m)
- Specified by:
endMessage
in interfaceIMessageVisitor
-
startBlock1
public void startBlock1(SwiftBlock1 b)
- Specified by:
startBlock1
in interfaceIMessageVisitor
- Parameters:
b
- block to visit
-
value
public void value(SwiftBlock1 b, java.lang.String v)
- Specified by:
value
in interfaceIMessageVisitor
-
endBlock1
public void endBlock1(SwiftBlock1 b)
- Specified by:
endBlock1
in interfaceIMessageVisitor
- Parameters:
b
- block to visit
-
startBlock2
public void startBlock2(SwiftBlock2 b)
- Specified by:
startBlock2
in interfaceIMessageVisitor
- Parameters:
b
- block to visit
-
value
public void value(SwiftBlock2 b, java.lang.String v)
- Specified by:
value
in interfaceIMessageVisitor
-
endBlock2
public void endBlock2(SwiftBlock2 b)
- Specified by:
endBlock2
in interfaceIMessageVisitor
- Parameters:
b
- block to visit
-
startBlock3
public void startBlock3(SwiftBlock3 b)
- Specified by:
startBlock3
in interfaceIMessageVisitor
- Parameters:
b
- block to visit
-
tag
public void tag(SwiftBlock3 b, Tag t)
- Specified by:
tag
in interfaceIMessageVisitor
-
endBlock3
public void endBlock3(SwiftBlock3 b)
- Specified by:
endBlock3
in interfaceIMessageVisitor
- Parameters:
b
- block to visit
-
startBlock4
public void startBlock4(SwiftBlock4 b)
- Specified by:
startBlock4
in interfaceIMessageVisitor
- Parameters:
b
- block to visit
-
tag
public void tag(SwiftBlock4 b, Tag t)
- Specified by:
tag
in interfaceIMessageVisitor
-
endBlock4
public void endBlock4(SwiftBlock4 b)
- Specified by:
endBlock4
in interfaceIMessageVisitor
- Parameters:
b
- block to visit
-
startBlock5
public void startBlock5(SwiftBlock5 b)
- Specified by:
startBlock5
in interfaceIMessageVisitor
- Parameters:
b
- block to visit
-
tag
public void tag(SwiftBlock5 b, Tag t)
- Specified by:
tag
in interfaceIMessageVisitor
-
endBlock5
public void endBlock5(SwiftBlock5 b)
- Specified by:
endBlock5
in interfaceIMessageVisitor
- Parameters:
b
- block to visit
-
startBlockUser
public void startBlockUser(SwiftBlockUser b)
- Specified by:
startBlockUser
in interfaceIMessageVisitor
- Parameters:
b
- block to visit
-
tag
public void tag(SwiftBlockUser b, Tag t)
- Specified by:
tag
in interfaceIMessageVisitor
-
endBlockUser
public void endBlockUser(SwiftBlockUser b)
- Specified by:
endBlockUser
in interfaceIMessageVisitor
- Parameters:
b
- block to visit
-
tag
public void tag(SwiftBlock b, Tag t)
-
getTagValue
protected java.lang.String getTagValue(Tag t, int block)
Returns the tags value.- Returns:
- the tag value removing the block number if present
-
-