public abstract class ZeroTerminatedString extends Parameter implements StringParameter, AlignmentAwareParameter
NOTE: All string lengths include the terminating zero character unless otherwise noted.
LICENSE_TYPE, V| Modifier | Constructor and Description |
|---|---|
protected |
ZeroTerminatedString(byte[] bytes,
int lenBytes,
int charLength)
Constructs a string with specified value, maximum length and characted type
(1-byte or 2-byte).
|
| Modifier and Type | Method and Description |
|---|---|
protected Parameter |
asReturnValue()
Returns a parameter that represents this one as a return value.
|
protected abstract java.lang.String |
bytesToString(byte[] bytes) |
boolean |
equals(java.lang.Object obj)
Compares this
Parameter object to a given object. |
protected int |
getAlignedLength()
Returns a parameter length in bytes aligned to default alignment.
|
java.lang.String |
getDebugInfo()
Return debug info for JNIWrapper parameter.
|
int |
getFirstMemberSize()
Should return first member size.
|
int |
getLength()
Returns the length of this string object.
|
int |
getMaxLength()
Returns the maximum length of a string.
|
protected abstract int |
getStrLen(DataBuffer dataBuffer,
int startOffset) |
java.lang.String |
getValue() |
int |
hashCode() |
void |
read(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
Reads this parameter from a specified data source.
|
void |
setValue(java.lang.String value)
Sets the value for the parameter.
|
protected abstract byte[] |
stringToBytes(java.lang.String value) |
java.lang.String |
toString() |
void |
write(DataBuffer stackBuffer,
int offset,
boolean invokedByCallback)
Writes this parameter to a specified data source.
|
acceptIOPerformer, clone, dataBufferAssigned, getAlignmentRequirement, getDataBuffer, getDataBufferOffset, indent, pop, push, read, read, setDataBuffer, toByteArray, writeprotected ZeroTerminatedString(byte[] bytes,
int lenBytes,
int charLength)
bytes - a string as byteslenBytes - the maximum string length in bytescharLength - the character lengtin in bytespublic int getMaxLength()
charLength is 1. In these cases
ANSI string may not be able to hold getMaxLength() characters. Creating a new
AnsiString object with the string as a parameter or using WideString
eliminates this problem.public final void setValue(java.lang.String value)
StringParametersetValue in interface StringParametervalue - the value to set.public final java.lang.String getValue()
getValue in interface StringParameterprotected abstract int getStrLen(DataBuffer dataBuffer, int startOffset)
public int getLength()
getMaxLength() method.protected int getAlignedLength()
ParametergetAlignedLength in class Parameterprotected Parameter asReturnValue()
ParameterasReturnValue in class Parameterthispublic void write(DataBuffer stackBuffer, int offset, boolean invokedByCallback) throws MemoryAccessViolationException
Parameterwrite in class ParameterMemoryAccessViolationExceptionpublic void read(DataBuffer stackBuffer, int offset, boolean invokedByCallback) throws MemoryAccessViolationException
Parameterread in class ParameterMemoryAccessViolationExceptionpublic java.lang.String getDebugInfo()
ParametergetDebugInfo in class Parameterpublic boolean equals(java.lang.Object obj)
ParameterParameter object to a given object. Two
Parameter objects are considered equal if their byte
representations are equal and they are of the same type. Subclasses may
override this method as appropriate.protected abstract byte[] stringToBytes(java.lang.String value)
protected abstract java.lang.String bytesToString(byte[] bytes)
public java.lang.String toString()
toString in class java.lang.Objectpublic int getFirstMemberSize()
AlignmentAwareParametergetFirstMemberSize in interface AlignmentAwareParameter