Class PListParser
- java.lang.Object
-
- com.github.markusbernhardt.proxy.util.PListParser
-
public final class PListParser extends Object
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 nestedMap<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 Classes Modifier and Type Class Description static classPListParser.DictSmall helper class representing a tree node.static classPListParser.XmlParseExceptionException is used for XML parse problems.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PListParser.Dictload(File file)Create a nestedmap<String, Object>from a plist xml file using the default mapping.
-
-
-
Method Detail
-
load
public static PListParser.Dict load(File file) throws PListParser.XmlParseException, IOException
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.
-
-