public class MapListString extends Object
e.g. map-string
map:{key1=value1,key2=list:{value21,value22,value23},key3=map:{key31=value31}}
e.g. list-string
list:{key1=value1,key2=list:{value21,value22,value23},key3=map:{key31=value31}}
| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected boolean |
_checkDuplicateEntry
Does it check duplicate entry of map?
|
protected String |
_delimiter
The control mark of delimiter.
|
protected String |
_endBrace
The control mark of end brace.
|
protected String |
_equal
The control mark of equal for map-string.
|
protected String |
_escapeChar
The escape character for control marks.
|
protected String |
_listMark
The mark of list.
|
protected String |
_mapMark
The mark of map.
|
protected String |
_remainderString
The string of remainder as temporary variable for generation.
|
protected String |
_startBrace
The control mark of start brace.
|
protected String |
_topString
The string of top (full) string as temporary variable for generation.
|
static String |
DEFAULT_DELIMITER
The default control mark of delimiter.
|
static String |
DEFAULT_END_BRACE
The default control mark of end-brace.
|
static String |
DEFAULT_EQUAL
The default control mark of equal.
|
static String |
DEFAULT_LIST_MARK
The default mark of list value.
|
static String |
DEFAULT_MAP_MARK
The default mark of map value.
|
static String |
DEFAULT_START_BRACE
The default control mark of start-brace.
|
protected static String |
ESCAPE_CHAR
The escape character for control marks.
|
protected static String |
ESCAPED_ESCAPE_MARK
The temporary mark of escaped escape character.
|
| コンストラクタと説明 |
|---|
MapListString()
Constructor setting as default.
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
protected void |
assertListString(String listString) |
protected void |
assertListStringEndBraceIndex(String remainderString,
int endBraceIndex,
String listString,
List<?> currentList) |
protected void |
assertMapString(String mapString) |
protected void |
assertMapStringEndBraceIndex(String remainderString,
int endBraceIndex,
String mapString,
Map<String,Object> currentMap) |
protected void |
assertMapStringEqualIndex(String remainderString,
int equalIndex,
String mapString,
Map<String,Object> currentMap) |
protected String |
buildLengthSpace(String value) |
String |
buildListString(List<? extends Object> list)
Build list-string from the list object.
|
String |
buildMapString(Map<String,? extends Object> map)
Build map-string from the map object.
|
protected String |
calculateNextIndent(String preIndent,
String curIndent) |
MapListString |
checkDuplicateEntry()
Check duplicate entry of map.
|
protected boolean |
closeAfterParseNestMapList()
Close after parse nest map list.
|
protected void |
closeByEndBraceIndex(int endBraceIndex)
Close by end-brace index.
|
protected void |
doBuildListString(StringBuilder sb,
List<? extends Object> list,
String preIndent,
String curIndent) |
protected void |
doBuildMapString(StringBuilder sb,
Map<String,Object> map,
String preIndent,
String curIndent) |
protected void |
doCheckDuplicateEntryIfNeeds(Map<String,Object> currentMap,
String key,
Object element) |
String |
escapeControlMark(Object value)
Escape control marks as plain string in the value.
|
protected String |
filterMapListKey(String value) |
protected String |
filterMapListValue(String value) |
protected int |
findIndexOfControlMark(String remainderString,
String controlMark) |
List<Object> |
generateList(String listString)
Generate map object from list-string.
|
Map<String,Object> |
generateMap(String mapString)
Generate map object from the map-string.
|
protected int |
getControlMarkCount(String targetString,
String controlMark) |
protected String |
getListPrefix() |
protected String |
getMapPrefix() |
protected int |
indexOfDelimiter() |
protected int |
indexOfEndBrace() |
protected int |
indexOfEqual() |
protected int |
indexOfStartBrace() |
protected boolean |
initializeAtLoopBeginning()
Initialize at loop beginning.
|
boolean |
isCheckDuplicateEntry() |
protected boolean |
isEndsWithEndBrace(String targetString)
Does it end with end-brace?
|
protected boolean |
isEscapeCharEscape() |
protected boolean |
isStartsWithDelimiter(String targetString)
Does it start with the delimiter?
|
protected boolean |
isStartsWithEndBrace(String targetString)
Does it start with end-brace?
|
protected boolean |
isStartsWithListPrefix(String targetString)
Does it start with the list-prefix?
|
protected boolean |
isStartsWithMapPrefix(String targetString)
Does it start with the map-prefix?
|
protected String |
ln() |
protected String |
lnd() |
protected List<Object> |
newObjectList()
New object-type list.
|
protected Map<String,Object> |
newStringObjectMap()
New string-object map.
|
protected void |
parseRemainderListString(List<Object> currentList)
Parse remainder list string.
|
protected void |
parseRemainderMapString(Map<String,Object> currentMap)
Parse the current remainder string as map.
|
protected void |
prepareControlMarkMessage(ExceptionMessageBuilder br) |
protected void |
registerToMap(Map<String,Object> currentMap,
String key,
Object element) |
protected void |
removeBothSideSpaceAndTabAndNewLine()
Remove both side space and tab and new-line.
|
protected void |
removePrefix(String prefixString)
Remove prefix as mark.
|
protected void |
removePrefixAllDelimiter()
Remove prefix and all delimiters.
|
protected void |
removePrefixDelimiter()
Remove prefix delimiter.
|
protected void |
removePrefixEndBrace()
Remove prefix end-brace.
|
protected void |
removePrefixListMarkAndStartBrace()
Remove prefix list-mark and start-brace.
|
protected void |
removePrefixMapMarkAndStartBrace()
Remove prefix map-mark and start-brace.
|
protected void |
removePrefixTargetIndexPlus(int index,
int plusCount)
Remove prefix by the index and plus count.
|
protected String |
replace(String str,
String fromStr,
String toStr) |
void |
setDelimiter(String delimiter) |
void |
setEndBrace(String endBrace) |
void |
setEqual(String equal) |
void |
setListMark(String listMark) |
void |
setMapMark(String mapMark) |
void |
setStartBrace(String startBrace) |
protected List<Object> |
setupNestList(List<Object> currentList)
Set up new-created nest list as element of the current list.
|
protected List<Object> |
setupNestList(Map<String,Object> currentMap,
String mapKey)
Set up new-created nest list as element of the current map.
|
protected Map<String,Object> |
setupNestMap(List<Object> currentList)
Set up new-created nest map as element of the current list.
|
protected Map<String,Object> |
setupNestMap(Map<String,Object> currentMap,
String mapKey)
Set up new-created nest map as element of the current map.
|
protected void |
throwListStringBasicFailureException(String notice,
String listString) |
protected void |
throwListStringDifferentCountBracesException(String listString,
int startCount,
int endCount) |
protected void |
throwListStringEndBraceFailureException(String notice,
String remainderMapString,
int equalIndex,
String listString,
List<?> currentList) |
protected void |
throwListStringUnneededStringFoundException(String listString,
List<Object> generatedList) |
protected void |
throwMapListStringPrefixFailureException(String notice,
String prefixString,
String mapString) |
protected void |
throwMapStringBasicFailureException(String notice,
String mapString) |
protected void |
throwMapStringDifferentCountBracesException(String mapString,
int startCount,
int endCount) |
protected void |
throwMapStringDuplicateEntryFoundException(Map<String,Object> currentMap,
String key,
Object element) |
protected void |
throwMapStringEndBraceFailureException(String notice,
String remainderMapString,
int equalIndex,
String mapString,
Map<String,Object> currentMap) |
protected void |
throwMapStringEqualFailureException(String notice,
String remainderMapString,
int equalIndex,
String mapString,
Map<String,Object> currentMap) |
protected void |
throwMapStringUnneededStringFoundException(String mapString,
Map<String,Object> generatedMap) |
protected String |
toEscapedMark(String mark) |
String |
unescapeControlMark(String value)
Un-escape control marks as plain string in the value.
|
public static final String DEFAULT_MAP_MARK
public static final String DEFAULT_LIST_MARK
public static final String DEFAULT_START_BRACE
public static final String DEFAULT_END_BRACE
public static final String DEFAULT_DELIMITER
public static final String DEFAULT_EQUAL
protected static final String ESCAPE_CHAR
protected static final String ESCAPED_ESCAPE_MARK
protected String _mapMark
protected String _listMark
protected String _startBrace
protected String _endBrace
protected String _delimiter
protected String _equal
protected final String _escapeChar
protected String _topString
protected String _remainderString
protected boolean _checkDuplicateEntry
public MapListString()
public String buildMapString(Map<String,? extends Object> map)
map - The map object that has string keys. (NotNull)protected void doBuildMapString(StringBuilder sb, Map<String,Object> map, String preIndent, String curIndent)
public String buildListString(List<? extends Object> list)
list - The list object that has object elements. (NotNull)protected void doBuildListString(StringBuilder sb, List<? extends Object> list, String preIndent, String curIndent)
public Map<String,Object> generateMap(String mapString)
mapString - The string as map expression. (NotNull)protected void throwMapStringUnneededStringFoundException(String mapString, Map<String,Object> generatedMap)
public List<Object> generateList(String listString)
listString - The string as list expression. (NotNull)protected void throwListStringUnneededStringFoundException(String listString, List<Object> generatedList)
protected void parseRemainderMapString(Map<String,Object> currentMap)
currentMap - The current map made by parse process. (NotNull)protected void parseRemainderListString(List<Object> currentList)
currentList - current list.protected boolean initializeAtLoopBeginning()
protected boolean closeAfterParseNestMapList()
protected void closeByEndBraceIndex(int endBraceIndex)
endBraceIndex - The index of end-brace. (NotMinus)protected int indexOfStartBrace()
protected int indexOfEndBrace()
protected int indexOfDelimiter()
protected int indexOfEqual()
protected int findIndexOfControlMark(String remainderString, String controlMark)
protected void removePrefixMapMarkAndStartBrace()
protected void removePrefixListMarkAndStartBrace()
protected void removePrefixDelimiter()
protected void removePrefixEndBrace()
protected void removePrefix(String prefixString)
prefixString - The string for prefix. (NotNull)protected void throwMapListStringPrefixFailureException(String notice, String prefixString, String mapString)
protected void removePrefixAllDelimiter()
protected void removeBothSideSpaceAndTabAndNewLine()
protected void removePrefixTargetIndexPlus(int index,
int plusCount)
index - The base index. (NotMinus)plusCount - The plus count for index. (NotMinus)protected boolean isStartsWithMapPrefix(String targetString)
targetString - The target string to determine. (NotNull)protected String getMapPrefix()
protected boolean isStartsWithListPrefix(String targetString)
targetString - The target-string to determine. (NotNull)protected String getListPrefix()
protected boolean isStartsWithDelimiter(String targetString)
targetString - The target string to determine. (NotNull)protected boolean isStartsWithEndBrace(String targetString)
targetString - The target string to determine. (NotNull)protected boolean isEndsWithEndBrace(String targetString)
targetString - The target string to determine. (NotNull)protected Map<String,Object> setupNestMap(Map<String,Object> currentMap, String mapKey)
currentMap - the current map to set up. (NotNull)mapKey - The key of nest map. (NotNull)protected Map<String,Object> setupNestMap(List<Object> currentList)
currentList - the current list to set up. (NotNull)protected List<Object> setupNestList(Map<String,Object> currentMap, String mapKey)
currentMap - the current map to set up. (NotNull)mapKey - The key of nest map. (NotNull)protected List<Object> setupNestList(List<Object> currentList)
currentList - the current map to set up. (NotNull)protected Map<String,Object> newStringObjectMap()
protected List<Object> newObjectList()
protected void registerToMap(Map<String,Object> currentMap, String key, Object element)
protected void doCheckDuplicateEntryIfNeeds(Map<String,Object> currentMap, String key, Object element)
protected void throwMapStringDuplicateEntryFoundException(Map<String,Object> currentMap, String key, Object element)
public String escapeControlMark(Object value)
value - The value, might contain control marks. (NullAllowed: if null, return null)public String unescapeControlMark(String value)
value - The value, might contain escaped control marks. (NullAllowed: if null, return null)protected boolean isEscapeCharEscape()
protected void assertMapString(String mapString)
protected void throwMapStringBasicFailureException(String notice, String mapString)
protected void throwMapStringDifferentCountBracesException(String mapString, int startCount, int endCount)
protected void assertListString(String listString)
protected void throwListStringBasicFailureException(String notice, String listString)
protected void throwListStringDifferentCountBracesException(String listString, int startCount, int endCount)
protected void assertMapStringEqualIndex(String remainderString, int equalIndex, String mapString, Map<String,Object> currentMap)
protected void throwMapStringEqualFailureException(String notice, String remainderMapString, int equalIndex, String mapString, Map<String,Object> currentMap)
protected void assertMapStringEndBraceIndex(String remainderString, int endBraceIndex, String mapString, Map<String,Object> currentMap)
protected void assertListStringEndBraceIndex(String remainderString, int endBraceIndex, String listString, List<?> currentList)
protected void throwMapStringEndBraceFailureException(String notice, String remainderMapString, int equalIndex, String mapString, Map<String,Object> currentMap)
protected void throwListStringEndBraceFailureException(String notice, String remainderMapString, int equalIndex, String listString, List<?> currentList)
protected void prepareControlMarkMessage(ExceptionMessageBuilder br)
protected String lnd()
protected String ln()
public void setMapMark(String mapMark)
public void setListMark(String listMark)
public void setStartBrace(String startBrace)
public void setEndBrace(String endBrace)
public void setDelimiter(String delimiter)
public void setEqual(String equal)
public MapListString checkDuplicateEntry()
public boolean isCheckDuplicateEntry()
Copyright © 2014–2015 The DBFlute Project. All rights reserved.