public class DfMapFile extends Object
Detail Specification:
o using DfMapStyle o file encoding is fixedly UTF-8 o trimmed lines that start with '#' is treated as line comment o basically thread-safe if no changing option in progress
| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected boolean |
_checkDuplicateEntry |
protected String |
_fileEncoding |
protected String |
_lineCommentMark |
protected boolean |
_skipLineSeparator |
static String |
LINE_COMMENT_MARK |
protected static String |
UTF8_ENCODING |
| 修飾子 | コンストラクタと説明 |
|---|---|
|
DfMapFile()
Constructor for settings as default.
|
protected |
DfMapFile(String fileEncoding,
String lineCommentMark) |
| 修飾子とタイプ | メソッドと説明 |
|---|---|
protected void |
assertObjectNotNull(String variableName,
Object value) |
protected void |
assertStringNotNullAndNotTrimmedEmpty(String variableName,
String value) |
DfMapFile |
checkDuplicateEntry() |
protected DfMapStyle |
createMapStyle() |
protected List<Object> |
createResultList(DfMapStyle mapStyle) |
protected Map<String,Object> |
createResultMap(DfMapStyle mapStyle) |
protected String |
ln() |
protected DfMapStyle |
newMapStyle() |
List<Object> |
readList(InputStream ins)
Read the list string file.
|
<ELEMENT> List<ELEMENT> |
readList(InputStream ins,
Class<ELEMENT> elementType)
Read the list string file, as specified typed list element.
|
Map<String,Object> |
readMap(InputStream ins)
Read the map string file.
|
<VALUE> Map<String,VALUE> |
readMap(InputStream ins,
Class<VALUE> valueType)
Read the map string file as specified typed map value.
|
String |
readString(InputStream ins)
Read the string file.
|
protected String |
removeInitialUnicodeBomIfNeeds(String encoding,
String value) |
DfMapFile |
skipLineSeparator() |
void |
writeList(OutputStream ous,
List<? extends Object> list) |
void |
writeMap(OutputStream ous,
Map<String,? extends Object> map) |
void |
writeString(OutputStream ous,
String str) |
protected final String _fileEncoding
protected final String _lineCommentMark
protected boolean _skipLineSeparator
protected boolean _checkDuplicateEntry
public DfMapFile skipLineSeparator()
public DfMapFile checkDuplicateEntry()
public Map<String,Object> readMap(InputStream ins) throws IOException
map:{
; key1 = string-value1
; key2 = list:{element1 ; element2 }
; key3 = map:{key1 = value1 ; key2 = value2 }
; ... = ...
}
ins - The input stream for DBFlute property file, which is closed here. (NotNull)IOException - When it fails to handle the IO.public <VALUE> Map<String,VALUE> readMap(InputStream ins, Class<VALUE> valueType) throws IOException
e.g.
map:{
; key1 = map:{string-key1 = string-value1 ; string-key2 = string-value2 }
; key2 = map:{string-key1 = string-value1 ; string-key2 = string-value2 }
; ... = map:{...}
}
VALUE - The type of value.ins - The input stream for DBFlute property file, which is closed here. (NotNull)valueType - The type of value to cast. (NotNull)IOException - When it fails to handle the IO.public void writeMap(OutputStream ous, Map<String,? extends Object> map) throws IOException
IOExceptionpublic List<Object> readList(InputStream ins) throws IOException
list:{
; element1
; list:{element2-1 ; element2-2 }
; map:{key3-1 = value3-1 ; key3-2 = value3-2 }
; ...
}
ins - The input stream for DBFlute property file, which is closed here. (NotNull)IOException - When it fails to handle the IO.public <ELEMENT> List<ELEMENT> readList(InputStream ins, Class<ELEMENT> elementType) throws IOException
list:{
; string-value1
; string-value1
; ...
}
ELEMENT - The type of list element.ins - The input stream for DBFlute property file, which is closed here. (NotNull)elementType - The type of list element to cast. (NotNull)IOException - When it fails to handle the IO.public void writeList(OutputStream ous, List<? extends Object> list) throws IOException
IOExceptionpublic String readString(InputStream ins) throws IOException
ins - The input stream for DBFlute property file. (NotNull)IOException - When it fails to handle the IO.public void writeString(OutputStream ous, String str) throws IOException
IOExceptionprotected DfMapStyle createMapStyle()
protected DfMapStyle newMapStyle()
protected Map<String,Object> createResultMap(DfMapStyle mapStyle)
protected List<Object> createResultList(DfMapStyle mapStyle)
protected String removeInitialUnicodeBomIfNeeds(String encoding, String value)
protected String ln()
protected void assertStringNotNullAndNotTrimmedEmpty(String variableName, String value)
Copyright © 2014–2021 The DBFlute Project. All rights reserved.