public class DbaseFileHeader
extends java.lang.Object
| Constructor and Description |
|---|
DbaseFileHeader()
DbaseFileHreader constructor comment.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addColumn(java.lang.String fieldName,
char fieldType,
int fieldSize,
int fieldPrecision,
int fieldScale)
Add a column to this DbaseFileHeader.The type is one of (C N L or D)
character, number, logical(true/false), or date.
|
static DbaseFileHeader |
fromFeatureType(FeatureType featureType) |
static DbaseFileHeader |
fromFeatureType(FeatureType featureType,
java.lang.String charsetName) |
java.lang.String |
getCharsetName() |
java.lang.String |
getCharsetName(int ldid) |
DbaseFieldDescriptor |
getFieldDescription(int index)
Return the Field Descriptor for the given field.
|
DbaseFieldDescriptor |
getFieldDescription(java.lang.String name) |
int |
getFieldIndex(java.lang.String name) |
int |
getHeaderLength()
Return the length of the header
|
int |
getLanguageID()
Gets the Language driver IDs (code page) defined on the file header (or
guessed from the provided charset)
Some examples: 01h DOS USA code page 437 02h DOS Multilingual code page 850
03h Windows ANSI code page 1252 04h Standard Macintosh 64h EE MS-DOS code
page 852 65h Nordic MS-DOS code page 865 66h Russian MS-DOS code page 866
67h Icelandic MS-DOS 68h Kamenicky (Czech) MS-DOS 69h Mazovia (Polish)
MS-DOS 6Ah Greek MS-DOS (437G) 6Bh Turkish MS-DOS 96h Russian Macintosh 97h
Eastern European Macintosh 98h Greek Macintosh C8h Windows EE code page
1250 C9h Russian Windows CAh Turkish Windows CBh Greek Windows
See the java equivalences in
DbaseCodepage.dbfLdid and DbaseCodepage.ldidJava objects. |
java.util.Date |
getLastUpdateDate()
Return the date this file was last updated.
|
int |
getNumFields()
Return the number of fields in the records.
|
int |
getNumRecords()
Return the number of records in the file
|
java.lang.String |
getOriginalCharset() |
int |
getRecordLength()
Return the length of the records in bytes.
|
java.lang.String |
mappingEncoding(java.lang.String dbfEnconding) |
void |
read(BigByteBuffer2 in,
java.lang.String charsName,
boolean allowDuplicatedFieldNames)
Read the header data from the DBF file.
|
int |
removeColumn(java.lang.String inFieldName)
Remove a column from this DbaseFileHeader.
|
void |
setNumRecords(int inNumRecords)
Set the number of records in the file
|
EditableFeatureType |
toFeatureType(EditableFeatureType featureType,
boolean handleDatesAsStrings) |
void |
write(java.nio.channels.FileChannel out)
Write the header data to the DBF file.
|
public void addColumn(java.lang.String fieldName,
char fieldType,
int fieldSize,
int fieldPrecision,
int fieldScale)
throws AttributeFeatureTypeNotSuportedException
public int removeColumn(java.lang.String inFieldName)
public DbaseFieldDescriptor getFieldDescription(int index)
index, - the index of the requeted field descriptionpublic DbaseFieldDescriptor getFieldDescription(java.lang.String name)
public int getFieldIndex(java.lang.String name)
public java.util.Date getLastUpdateDate()
public int getNumFields()
public int getNumRecords()
public int getRecordLength()
public int getHeaderLength()
public void read(BigByteBuffer2 in, java.lang.String charsName, boolean allowDuplicatedFieldNames) throws UnsupportedVersionException, AttributeFeatureTypeNotSuportedException
public void setNumRecords(int inNumRecords)
public int getLanguageID()
DbaseCodepage.dbfLdid and DbaseCodepage.ldidJava objects.
See some others here:
https://github.com/infused/dbf/blob/master/docs/supported_encodings.csvpublic void write(java.nio.channels.FileChannel out)
throws java.io.IOException
out - A channel to write to. If you have an OutputStream you can
obtain the correct channel by using
java.nio.Channels.newChannel(OutputStream out).java.io.IOExceptionpublic java.lang.String getCharsetName()
public java.lang.String getCharsetName(int ldid)
public java.lang.String getOriginalCharset()
public java.lang.String mappingEncoding(java.lang.String dbfEnconding)
public EditableFeatureType toFeatureType(EditableFeatureType featureType, boolean handleDatesAsStrings) throws DataException
DataExceptionpublic static DbaseFileHeader fromFeatureType(FeatureType featureType) throws DataException
DataExceptionpublic static DbaseFileHeader fromFeatureType(FeatureType featureType, java.lang.String charsetName) throws DataException
DataException