Package org.apache.guacamole.form
Class LanguageField
java.lang.Object
org.apache.guacamole.form.Field
org.apache.guacamole.form.LanguageField
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 -
Method Summary
Methods inherited from class org.apache.guacamole.form.Field
getName, getOptions, getType, setName, setOptions, setType
-
Constructor Details
-
LanguageField
Creates a new LanguageField with the given name.- Parameters:
name
- The unique name to associate with this field.
-
-
Method Details
-
parse
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.
-