public class DBFField extends Object
DBFReader.getField(int) query.| Modifier and Type | Field and Description |
|---|---|
static byte |
FIELD_TYPE_C
Deprecated.
You must use
DBFDataType.CHARACTER instead |
static byte |
FIELD_TYPE_D
Deprecated.
You must use
DBFDataType.DATE instead |
static byte |
FIELD_TYPE_F
Deprecated.
You must use
DBFDataType.FLOATING_POINT instead |
static byte |
FIELD_TYPE_L
Deprecated.
You must use
DBFDataType.LOGICAL instead |
static byte |
FIELD_TYPE_M
Deprecated.
You must use
DBFDataType.MEMO instead |
static byte |
FIELD_TYPE_N
Deprecated.
You must use
DBFDataType.NUMERIC instead |
| Constructor and Description |
|---|
DBFField()
Default constructor
|
DBFField(String name,
DBFDataType type)
Creates a field definition
|
DBFField(String name,
DBFDataType type,
int length)
Creates a field definition
|
DBFField(String name,
DBFDataType type,
int length,
int decimalCount)
Creates a field definition
|
| Modifier and Type | Method and Description |
|---|---|
protected static DBFField |
createField(DataInput in,
Charset charset,
boolean useFieldFlags,
boolean supportExtendedCharacterFields)
Creates a DBFField object from the data read from the given
DataInputStream.
|
protected static DBFField |
createFieldDB7(DataInput in,
Charset charset,
boolean supportExtendedCharacterFields) |
byte |
getDataType()
Deprecated.
This method is deprecated and is replaced by
getType() |
int |
getDecimalCount()
Returns the decimal part.
|
int |
getFieldLength()
Deprecated.
use
getLength() |
byte |
getIndexFieldFlag()
Get index field flag
|
int |
getLength()
Returns field length.
|
String |
getName()
Returns the name of the field.
|
int |
getReserv1()
Gets reserved field 1 (for internal use only)
|
short |
getReserv2()
Gets reserved field 2 (for internal use only)
|
short |
getReserv3()
Gets reserved field 3 (for internal use only)
|
byte[] |
getReserv4()
Gets reserved field 4 (for internal use only)
|
byte |
getSetFieldsFlag() |
DBFDataType |
getType()
Gets the type for this field
|
byte |
getWorkAreaId()
Gets reserved workareaid (for internal use only)
|
boolean |
isBinary()
Checks if the field is binary
|
boolean |
isNullable()
Checks if the field is nullable
|
boolean |
isSystem()
Checks if is a system field
|
void |
setDataType(byte type)
Deprecated.
This method is deprecated and is replaced by
setType(DBFDataType) |
void |
setDecimalCount(int size)
Sets the decimal place size of the field.
|
void |
setFieldLength(int length)
Deprecated.
use
setLength(int) |
void |
setFieldName(String value)
Deprecated.
This method is deprecated and is replaced by
setName(String). |
void |
setLength(int length)
Set Length of the field.
|
void |
setName(String name)
Sets the name of the field.
|
void |
setType(DBFDataType type)
Set the type for this field
|
String |
toString() |
protected void |
write(DataOutput out,
Charset charset)
Writes the content of DBFField object into the stream as per DBF format
specifications.
|
@Deprecated public static final byte FIELD_TYPE_C
DBFDataType.CHARACTER instead@Deprecated public static final byte FIELD_TYPE_L
DBFDataType.LOGICAL instead@Deprecated public static final byte FIELD_TYPE_N
DBFDataType.NUMERIC instead@Deprecated public static final byte FIELD_TYPE_F
DBFDataType.FLOATING_POINT instead@Deprecated public static final byte FIELD_TYPE_D
DBFDataType.DATE instead@Deprecated public static final byte FIELD_TYPE_M
DBFDataType.MEMO insteadpublic DBFField()
public DBFField(String name, DBFDataType type)
name - Field nametype - field typepublic DBFField(String name, DBFDataType type, int length)
name - Field nametype - Field typelength - Field lengthpublic DBFField(String name, DBFDataType type, int length, int decimalCount)
name - Field nametype - Field typelength - Field lengthdecimalCount - number of decimal places to useprotected static DBFField createField(DataInput in, Charset charset, boolean useFieldFlags, boolean supportExtendedCharacterFields) throws IOException
in - DataInputStreamcharset - charset to useuseFieldFlags - If the file can store field flags (setting this to false ignore any data in byes 18-19)supportExtendedCharacterFields - True if 2-byte (extended) length character fields should be supported, see adjustLengthForLongCharSupport()IOException - If any stream reading problems occures.protected static DBFField createFieldDB7(DataInput in, Charset charset, boolean supportExtendedCharacterFields) throws IOException
IOExceptionprotected void write(DataOutput out, Charset charset) throws IOException
out - OutputStreamcharset - dbf file's charsetIOException - if any stream related issues occur.public String getName()
public int getLength()
public int getDecimalCount()
public void setName(String name)
name - of the field as String.public int getReserv1()
public short getReserv2()
public byte getWorkAreaId()
public short getReserv3()
public byte getSetFieldsFlag()
public byte[] getReserv4()
public byte getIndexFieldFlag()
public void setLength(int length)
length - of the field as int.public DBFDataType getType()
public void setType(DBFDataType type)
type - The type for this fieldIllegalArgumentException - if type is not write supportedpublic void setDecimalCount(int size)
size - of the decimal field.public boolean isSystem()
public boolean isNullable()
public boolean isBinary()
@Deprecated public int getFieldLength()
getLength()@Deprecated public void setFieldLength(int length)
setLength(int)length - of the field as int.@Deprecated public void setDataType(byte type)
setType(DBFDataType)type - of the field. One of the following:@Deprecated public void setFieldName(String value)
setName(String).value - the name of the field@Deprecated public byte getDataType()
getType()Copyright © 2020. All rights reserved.