public class CobolComplexTypeFinder extends CobolTypeFinder
This finder is constructed using a Cobol complex type and a stop field which delimits the number of fields at the start of the complex type forming the type's 'signature'.
Note that some Cobol types are easier to recognize than others, for instance
CobolPackedDecimalType and
CobolZonedDecimalType impose severe
limitations on their content and therefore are unlikely to be missed for some
other type. So you want to have as many as possible of these in your
signature.
Decimal types can be defined with boundaries (minInclusive and maxInclusive) which are very useful to avoid the risk of a mismatch.
Note that this implementation will not work if the signature part of the type contains variable size arrays (DEPENDING ON) or choices (REDEFINES).
| Constructor and Description |
|---|
CobolComplexTypeFinder(CobolContext cobolContext,
CobolComplexType cobolComplexType)
Construct the finder.
|
CobolComplexTypeFinder(CobolContext cobolContext,
CobolComplexType cobolComplexType,
String stopFieldInclusive)
Construct the finder.
|
| Modifier and Type | Method and Description |
|---|---|
CobolComplexType |
getCobolComplexType() |
long |
getMaxBytesLen() |
long |
getMinBytesLen() |
int |
getSignatureLen() |
String |
getStopFieldInclusive() |
boolean |
match(byte[] hostData,
int start,
int length)
Match a Cobol type to an incoming host bytes set.
|
indexOfpublic CobolComplexTypeFinder(CobolContext cobolContext, CobolComplexType cobolComplexType)
cobolContext - host COBOL configuration parameterscobolComplexType - the Cobol complex type we are looking forpublic CobolComplexTypeFinder(CobolContext cobolContext, CobolComplexType cobolComplexType, String stopFieldInclusive)
cobolContext - host COBOL configuration parameterscobolComplexType - the Cobol complex type we are looking forstopFieldInclusive - what is the last field of the signature (the
signature is formed by all fields from the start of the
complex type up to this one). If you pass null or a field that
is not in the complex type, the entire complex type form the
signature.public boolean match(byte[] hostData,
int start,
int length)
match in class CobolTypeFinderhostData - the host bytes setstart - where to start matchinglength - the size of the incoming host bytes set. This should be large
enough to hold a signature but is not guaranteed to hold more
than that.public int getSignatureLen()
getSignatureLen in class CobolTypeFinderpublic CobolComplexType getCobolComplexType()
public String getStopFieldInclusive()
public long getMinBytesLen()
public long getMaxBytesLen()
Copyright © 2021 LegSem. All rights reserved.