public class TargetLob extends LobCopyOutput
TO [ OBJECT ] target-lob phrase.| Modifier and Type | Field and Description |
|---|---|
private FieldReference |
field
Field reference to LOB, if LOB is a record buffer field
|
private LargeObject |
lob
Large object which is the target of the copy operation
|
private NumberType |
offset
1-based offset at which data will be written into the target large object
|
private boolean |
trim
If
true, truncate any data remaining in the target, which was not overwritten |
TYPE_BLOB, TYPE_CHAR_BIT, TYPE_CLOB, TYPE_FIELD_BIT, TYPE_FILE, TYPE_LONGCHAR, TYPE_MEMPTR, TYPE_UNKNOWN| Constructor and Description |
|---|
TargetLob(FieldReference field)
Constructor which takes a field reference which must be a wrapper for a
LargeObject. |
TargetLob(LargeObject lob)
Constructor.
|
TargetLob(java.lang.Object lob)
Constructor which takes an object that is expected to be a LOB.
|
| Modifier and Type | Method and Description |
|---|---|
private boolean |
checkTargetSize(int offset,
int srcLength)
Check the target size, and resize if it doesn't fit.
|
java.lang.String |
getCodePage()
Get the code page of this parameter, if any.
|
int |
getObjectType()
Obtain the type of the object wrapped by this parameter
|
private int |
getOffset()
Get the offset at which to overlay data in the target.
|
boolean |
isCharacterData()
Indicate whether the large object represented by this parameter natively represents
encoded character data, as opposed to binary data.
|
boolean |
isLargeObject()
Indicate whether this object is a valid large object data type.
|
protected boolean |
isOverlay()
Check if the OVERLAY option is used.
|
TargetLob |
offset(int offset)
Set the starting offset at which to write content; corresponds with the OVERLAY AT option.
|
TargetLob |
offset(NumberType offset)
Set the starting offset at which to write content; corresponds with the OVERLAY AT option.
|
protected void |
setOverrideLength(int newOverrideLength)
Sets new value for longchar overridden length.
|
TargetLob |
trim()
Configure the copy operation to trim any data remaining in the target object which was not
overwritten by the copy.
|
boolean |
validate(int sourceType)
Validate this parameter.
|
boolean |
validateOffset(int sourceType)
Checks if the optional offset is valid.
|
void |
write(byte[] data)
Write the given array of bytes into the large object.
|
void |
write(java.lang.String data,
java.lang.String oecp)
Write the given character data into the large object.
|
private final LargeObject lob
private final FieldReference field
private NumberType offset
private boolean trim
true, truncate any data remaining in the target, which was not overwrittenpublic TargetLob(LargeObject lob)
lob - Large object which is the target of the copy operation.public TargetLob(java.lang.Object lob)
lob - Large object which is the target of the copy operation.ConditionException - if lob is not an instance of @LargeObject@.public TargetLob(FieldReference field)
LargeObject.field - Field reference to a large object which is the source of the copy operation.public TargetLob offset(NumberType offset)
offset - 1-based starting offset.public TargetLob offset(int offset)
offset - 1-based starting offset.public TargetLob trim()
public boolean isLargeObject()
true if valid, else false. The default implementation assumes
validity; implementors which must handle runtime type verification must override
this method.public int getObjectType()
LobCopyParameter interface.public boolean isCharacterData()
true if character data; false if binary data.public java.lang.String getCodePage()
null if parameter represents non-character data.public boolean validateOffset(int sourceType)
sourceType - The type of the source object. The error messages are different in some cases.true if the optional offset is valid.public boolean validate(int sourceType)
sourceType - The type of the source object. The error messages are different in some cases.true if validation did not encounter any issue and false otherwise, when in
NO-ERROR mode and the ErrorConditionException is not thrown.ErrorConditionException - if the parameter fails validation and silent error mode is not active.public void write(byte[] data)
write in class LobCopyOutputdata - Data to be assigned to this object.public void write(java.lang.String data,
java.lang.String oecp)
write in class LobCopyOutputdata - Data to be assigned to this object.oecp - Target OE codepage to be used in write operation. Ignored.private int getOffset()
protected boolean isOverlay()
true of offset is non-null.protected void setOverrideLength(int newOverrideLength)
newOverrideLength - The new value of the internal longchar length.private boolean checkTargetSize(int offset,
int srcLength)
offset - The offset where to write in the target.srcLength - The source length.true if the target passed validation.