Class PListReader
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionPListReader(byte[] xmlData) PListReader(Node node) Creates plist reader from the given node. -
Method Summary
Modifier and TypeMethodDescriptionfindArrayValue(String keyName, boolean fetchDictionaries) findBoolValue(String keyName) findDictValue(String keyName) findStringArrayValue(String keyName) queryArrayValue(String keyName, boolean fetchDictionaries) Returns the value of the given array property in the underlying "dict" element as a stream ofObject-s.booleanqueryBoolValue(String keyName) Returns the value of the given boolean property in the underlying "dict" element.queryDictValue(String keyName) Returns the value of the given "dict" property in the underlying "dict" element.queryStringArrayValue(String keyName) Returns the value of the given array property in the underlying "dict" element as a list of strings.queryValue(String keyName) Returns the value of the given string property in the underlying "dict" element.toMap(boolean fetchDictionaries) Returns the contents of the the underlying "dict" element as a Map.
-
Constructor Details
-
PListReader
Creates plist reader from the given node.If the specified node is an element with the name "dict", the reader is bound to the specified node; otherwise, it is bound to the
/plist/dictelement in the document.- Parameters:
node- the node- Throws:
NoSuchElementException- if the specified node is not an element with name "dict" and there is no/plist/dictnode in the document
-
PListReader
-
-
Method Details
-
toMap
Returns the contents of the the underlying "dict" element as a Map.The keys in the returned map are names of the properties.
Values of nested "dict" properties are stored as
Map<String, Object>orPListReaderobjects depending on the value of thefetchDictionariesparameter.Values of "array" properties are stored as
List<Object>objects.Values of other properties are stored as
Rawobjects.- Parameters:
fetchDictionaries- controls the type of objects of nested "dict" elements. If the value istrue,Map<String, Object>type is used, andPListReadertype otherwise.- Returns:
- the contents of the the underlying "dict" element as a Map
-
queryValue
Returns the value of the given string property in the underlying "dict" element.- Parameters:
keyName- the name of a string property whose value to query- Returns:
- the value of the string property with the specified name in the underlying "dict" element
- Throws:
NoSuchElementException- if there is no string property with the given name in the underlying "dict" element
-
findValue
-
queryDictValue
Returns the value of the given "dict" property in the underlying "dict" element.- Parameters:
keyName- the name of a "dict" property whose value to query- Returns:
- the value of the "dict" property with the specified name in the underlying "dict" element
- Throws:
NoSuchElementException- if there is no "dict" property with the given name in the underlying "dict" element
-
findDictValue
-
queryBoolValue
Returns the value of the given boolean property in the underlying "dict" element.- Parameters:
keyName- the name of a boolean property whose value to query- Returns:
- the value of the boolean property with the specified name in the underlying "dict" element
- Throws:
NoSuchElementException- if there is no string property with the given name in the underlying "dict" element
-
findBoolValue
-
queryStringArrayValue
Returns the value of the given array property in the underlying "dict" element as a list of strings.Processes the result of calling
on the specified property name by filteringinvalid reference
#queryArrayValue(String)PListReader.Rawinstances of typePListReader.Raw.Type.STRING.- Parameters:
keyName- the name of an array property whose value to query- Returns:
- the value of the array property with the specified name in the underlying "dict" element
- Throws:
NoSuchElementException- if there is no array property with the given name in the underlying "dict" element
-
findStringArrayValue
-
queryArrayValue
Returns the value of the given array property in the underlying "dict" element as a stream ofObject-s.Values of "dict" array items are stored as
Map<String, Object>orPListReaderobjects depending on the value of thefetchDictionariesparameter.Values of "array" array items are stored as
List<Object>objects.Values of other types are stored as
Rawobjects.- Parameters:
keyName- the name of an array property whose value to queryfetchDictionaries- controls the type of objects of "dict" elements. If the value istrue,Map<String, Object>type is used, andPListReadertype otherwise.- Returns:
- the value of the array property with the specified name in the underlying "dict" element
- Throws:
NoSuchElementException- if there is no array key with the given name in the underlying "dict" element
-
findArrayValue
-
toXmlConsumer
-