public enum Persistence extends java.lang.Enum<Persistence>
Enum Constant and Description |
---|
PROPERTIES_PAIRS |
PROPERTIES_XML |
SERIAL_HASH |
SERIAL_INPUT |
Modifier and Type | Method and Description |
---|---|
static Persistence |
fromString(java.lang.String str)
Returns the enum representation of a string.
|
java.lang.String |
getOutput(java.util.Map<javax.swing.KeyStroke,java.lang.String> bindings)
Provides the textual output of what this persistence format would save
given a set of bindings.
|
static java.lang.String |
getReadableConstant(java.lang.String input)
Provides a more readable version of constant names.
|
java.util.LinkedHashMap<javax.swing.KeyStroke,java.lang.String> |
load(java.io.InputStream input)
Attempts to load this type of persistent keystroke map from a given
stream.
|
java.util.LinkedHashMap<javax.swing.KeyStroke,java.lang.String> |
load(java.lang.String path)
Attempts to load this type of persistent keystroke map from a given path.
|
void |
save(java.io.OutputStream output,
java.util.Map<javax.swing.KeyStroke,java.lang.String> bindings)
Writes the persistent state of the bindings to an output stream.
|
void |
save(java.lang.String path,
java.util.Map<javax.swing.KeyStroke,java.lang.String> bindings)
Writes the persistent state of the bindings to a file.
|
java.lang.String |
toString() |
static Persistence |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Persistence[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Persistence SERIAL_HASH
public static final Persistence SERIAL_INPUT
public static final Persistence PROPERTIES_PAIRS
public static final Persistence PROPERTIES_XML
public static Persistence[] values()
for (Persistence c : Persistence.values()) System.out.println(c);
public static Persistence valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static Persistence fromString(java.lang.String str)
str
- toString representation of this enumjava.lang.IllegalArgumentException
- if argument is not represented by this
enum.public java.util.LinkedHashMap<javax.swing.KeyStroke,java.lang.String> load(java.lang.String path) throws java.io.IOException, java.text.ParseException
path
- absolute path to resource to be loadedjava.io.IOException
- if unable to load resourcejava.text.ParseException
- if unable to parse contentpublic java.util.LinkedHashMap<javax.swing.KeyStroke,java.lang.String> load(java.io.InputStream input) throws java.io.IOException, java.text.ParseException
input
- source of keybindings to be parsedjava.io.IOException
- if unable to load resourcejava.text.ParseException
- if unable to parse contentpublic void save(java.io.OutputStream output, java.util.Map<javax.swing.KeyStroke,java.lang.String> bindings) throws java.io.IOException
output
- stream where persistent state should be writtenbindings
- keybindings to be savedjava.io.IOException
- if unable to save bindingsjava.lang.UnsupportedOperationException
- if any keys or values of the
binding are nullpublic void save(java.lang.String path, java.util.Map<javax.swing.KeyStroke,java.lang.String> bindings) throws java.io.IOException
path
- absolute path to where bindings should be savedbindings
- keybindings to be savedjava.io.IOException
- if unable to save bindingsjava.lang.UnsupportedOperationException
- if any keys or values of the
binding are nullpublic java.lang.String getOutput(java.util.Map<javax.swing.KeyStroke,java.lang.String> bindings)
bindings
- bindings for which to generate saved outputpublic java.lang.String toString()
toString
in class java.lang.Enum<Persistence>
public static java.lang.String getReadableConstant(java.lang.String input)
input
- string to be converted
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.