Package gmbh.pagina.tools.gradle.mac_app
Class Plist
java.lang.Object
gmbh.pagina.tools.gradle.mac_app.Plist
A lazy XML builder object that represents an apple property list.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a<key>node to the root dictionary.voidAdd a<key>node to a parent element.voidAdd a<string>node to the root dictionary.voidAdd a<string>node to a parent element.voidcreateEntries(Map<String, ?> entries) Create or replace multiple entries in the root dictionary.voidcreateEntries(Node parent, Map<String, ?> entries) Create or replace multiple entries in a parent dictionary.voidcreateEntry(String key, boolean value) Create an entry with a key and a boolean value in the root property list.voidcreateEntry(String key, Object value) Create or replace an entry with a key and a plist-compatible value in the root dictionary.voidcreateEntry(String key, String value) Create an entry with a key and a string value in the root property list.voidcreateEntry(Node parent, String key, boolean value) Create an entry with a key and a boolean value in a parent node.voidcreateEntry(Node parent, String key, Object value) Create or replace an entry with a key and a plist-compatible value in a parent dictionary.voidcreateEntry(Node parent, String key, String value) Create an entry with a key and a string value in a parent node.voiddocumentTypes(DocumentType[] documentTypes) Set up document types the document can read/edit.voidjavaX(String mainClass, int minimumVersion, List<String> properties, List<String> vmOptions, Boolean startOnMainThread, List<String> mainArguments, String splashFile, Map<String, ?> customEntries) Set up the JavaX block to integrate with UniversalJavaApplicationStub.voidSave the property list to a target file.
-
Constructor Details
-
Plist
public Plist()Create the property list and set up a minimal XML structure.
-
-
Method Details
-
save
Save the property list to a target file.- Parameters:
file- The file to write it to.- Throws:
ParserConfigurationException- If XML transformer setup fails.TransformerException- If writing the XML document fails.
-
addString
Add a<string>node to a parent element.- Parameters:
parent- The parent XML node to append to.value- The string value to store.
-
addKey
Add a<key>node to a parent element.- Parameters:
parent- The parent XML node to append to.value- The key value to store.
-
addString
Add a<string>node to the root dictionary.- Parameters:
value- The string value to store.
-
addKey
Add a<key>node to the root dictionary.- Parameters:
value- The key value to store.
-
createEntry
Create an entry with a key and a boolean value in a parent node.- Parameters:
parent- The parent XML node.key- The plist key.value- The boolean value.
-
createEntry
Create an entry with a key and a boolean value in the root property list.- Parameters:
key- The plist key.value- The boolean value.
-
createEntry
Create an entry with a key and a string value in a parent node.- Parameters:
parent- The parent XML node.key- The plist key.value- The string value.
-
createEntry
Create or replace an entry with a key and a plist-compatible value in a parent dictionary.- Parameters:
parent- The parent XML dictionary node.key- The plist key.value- The plist-compatible value.
-
createEntry
Create an entry with a key and a string value in the root property list.- Parameters:
key- The plist key.value- The string value.
-
createEntry
Create or replace an entry with a key and a plist-compatible value in the root dictionary.- Parameters:
key- The plist key.value- The plist-compatible value.
-
createEntries
Create or replace multiple entries in a parent dictionary.- Parameters:
parent- The parent XML dictionary node.entries- Key/value entries to apply.
-
createEntries
Create or replace multiple entries in the root dictionary.- Parameters:
entries- Key/value entries to apply.
-
javaX
public void javaX(String mainClass, int minimumVersion, List<String> properties, List<String> vmOptions, Boolean startOnMainThread, List<String> mainArguments, String splashFile, Map<String, ?> customEntries) Set up the JavaX block to integrate with UniversalJavaApplicationStub.- Parameters:
mainClass- The main class in the format com.package.ClassminimumVersion- The minimum version of Java required.properties- Java system properties in-Dkey=valueform.vmOptions- JVM options passed to the launcher.startOnMainThread- Whether to launch on the macOS main thread.mainArguments- Arguments passed to the Java main class.splashFile- Optional splash file name.
-
documentTypes
Set up document types the document can read/edit.- Parameters:
documentTypes- Document type definitions to write intoCFBundleDocumentTypes.
-