Package org.apache.guacamole.form
Class LanguageField
- java.lang.Object
-
- org.apache.guacamole.form.Field
-
- org.apache.guacamole.form.LanguageField
-
public class LanguageField extends Field
Represents a language field. The field may contain only valid language identifiers as used by the Guacamole web application for its translations. Language identifiers are defined by the filenames of the JSON files containing the translation.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.guacamole.form.Field
Field.Type
-
-
Constructor Summary
Constructors Constructor Description LanguageField(String name)
Creates a new LanguageField with the given name.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
parse(String language)
Parses the given string into a language ID string.-
Methods inherited from class org.apache.guacamole.form.Field
getName, getOptions, getType, setName, setOptions, setType
-
-
-
-
Constructor Detail
-
LanguageField
public LanguageField(String name)
Creates a new LanguageField with the given name.- Parameters:
name
- The unique name to associate with this field.
-
-
Method Detail
-
parse
public static String parse(String language)
Parses the given string into a language ID string. As any string may be a valid language ID as long as it has a corresponding translation, the only transformation currently performed by this function is to ensure that a blank language string is parsed into null.- Parameters:
language
- The language string to parse, which may be null.- Returns:
- The ID of the language corresponding to the given string, or null if if the given language string was null or blank.
-
-