Class PListParser
java.lang.Object
com.github.markusbernhardt.proxy.util.PListParser
Plist xml handling (serialization and deserialization)
The xml plist dtd can be found at http://www.apple.com/DTDs/PropertyList-1.0.dtd
The plist spec handles 8 types of objects: booleans, real, integers, dates, binary data, strings, arrays (lists) and dictionaries (maps).
The java Plist lib handles converting xml plists to a nested
Map<String, Object> that can be trivially read from java. It also
provides a simple way to convert a nested Map<String, Object> into an
xml plist representation.
The following mapping will be done when converting from plist to Map :
true/false -> Boolean real -> Double integer -> Integer/Long (depends on size, values exceeding an int will be rendered as longs) data -> byte[] string -> String array -> List dict -> Map
When converting from Map -> plist the conversion is as follows:
Boolean -> true/false Float/Double -> real Byte/Short/Integer/Long -> integer byte[] -> data List -> array Map -> dict
- Author:
- Markus Bernhardt, Copyright 2016, Bernd Rosstauscher, Copyright 2009, Christoffer Lerno / Modified by Bernd Rosstauscher
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSmall helper class representing a tree node.static classException is used for XML parse problems. -
Method Summary
Modifier and TypeMethodDescriptionstatic PListParser.DictCreate a nestedmap<String, Object>from a plist xml file using the default mapping.
-
Method Details
-
load
Create a nestedmap<String, Object>from a plist xml file using the default mapping.- Parameters:
file- the File containing the the plist xml.- Returns:
- the resulting map as read from the plist data.
- Throws:
PListParser.XmlParseException- if the plist could not be properly parsed.IOException- if there was an issue reading the plist file.
-