public final class PListParser extends Object
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
| Modifier and Type | Class and Description |
|---|---|
static class |
PListParser.Dict
Small helper class representing a tree node.
|
static class |
PListParser.XmlParseException
Exception is used for XML parse problems.
|
| Modifier and Type | Method and Description |
|---|---|
static PListParser.Dict |
load(File file)
Create a nested
map<String, Object> from a plist xml file using
the default mapping. |
public static PListParser.Dict load(File file) throws PListParser.XmlParseException, IOException
map<String, Object> from a plist xml file using
the default mapping.file - the File containing the the plist xml.PListParser.XmlParseException - if the plist could not be properly parsed.IOException - if there was an issue reading the plist file.Copyright © 2020. All rights reserved.