T - the underlying java typepublic abstract class CobolPrimitiveType<T> extends Object implements CobolType, CobolOptionalType
Because primitive types tend to have lots of optional properties they are created using Builders.
| Modifier and Type | Class and Description |
|---|---|
static class |
CobolPrimitiveType.Builder<T,B extends CobolPrimitiveType.Builder<T,B>> |
| Constructor and Description |
|---|
CobolPrimitiveType(CobolPrimitiveType.Builder<T,?> builder) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(CobolVisitor visitor)
Propagate a visitor.
|
abstract FromHostPrimitiveResult<T> |
fromHost(Class<T> javaClass,
CobolContext cobolContext,
byte[] hostData,
int start)
Convert mainframe data into a Java object.
|
FromHostPrimitiveResult<T> |
fromHost(CobolContext cobolContext,
byte[] hostData,
int start)
Convert mainframe data into a Java object.
|
abstract int |
getBytesLen()
Determine the length in bytes of the mainframe representation of this
type.
|
String |
getCobolName()
Get the original COBOL name of this type.
|
String |
getDependingOn()
Name of the field that conditions the existence of this type.
|
Class<T> |
getJavaClass() |
long |
getMaxBytesLen()
Determine the maximum length in bytes of the mainframe representation of
this type.
|
long |
getMinBytesLen()
Determine the minimum length in bytes of the mainframe representation of
this type.
|
boolean |
isCustomVariable() |
boolean |
isOdoObject() |
abstract boolean |
isValid(Class<T> javaClass,
CobolContext cobolContext,
byte[] hostData,
int start)
Check if a byte array contains valid mainframe data for this type
characteristics.
|
boolean |
isValid(CobolContext cobolContext,
byte[] hostData,
int start)
Check if a byte array contains valid mainframe data for this type
characteristics.
|
public CobolPrimitiveType(CobolPrimitiveType.Builder<T,?> builder)
public boolean isValid(CobolContext cobolContext, byte[] hostData, int start)
cobolContext - host COBOL configuration parametershostData - the byte array containing mainframe datastart - the start position for the expected type in the byte arraypublic abstract boolean isValid(Class<T> javaClass, CobolContext cobolContext, byte[] hostData, int start)
javaClass - target java typecobolContext - host COBOL configuration parametershostData - the byte array containing mainframe datastart - the start position for the expected type in the byte arraypublic FromHostPrimitiveResult<T> fromHost(CobolContext cobolContext, byte[] hostData, int start)
cobolContext - host COBOL configuration parametershostData - the byte array containing mainframe datastart - the start position for the expected type in the byte arraypublic long getMaxBytesLen()
getMaxBytesLen in interface CobolTypepublic long getMinBytesLen()
getMinBytesLen in interface CobolTypepublic abstract int getBytesLen()
public abstract FromHostPrimitiveResult<T> fromHost(Class<T> javaClass, CobolContext cobolContext, byte[] hostData, int start)
javaClass - target java typecobolContext - host COBOL configuration parametershostData - the byte array containing mainframe datastart - the start position for the expected type in the byte arraypublic void accept(CobolVisitor visitor)
public String getCobolName()
CobolTypegetCobolName in interface CobolTypepublic boolean isOdoObject()
public boolean isCustomVariable()
public String getDependingOn()
CobolOptionalTypegetDependingOn in interface CobolOptionalTypeCopyright © 2021 LegSem. All rights reserved.