Package org.apache.guacamole.form
Class Field
- java.lang.Object
-
- org.apache.guacamole.form.Field
-
- Direct Known Subclasses:
BooleanField
,DateField
,EmailField
,EnumField
,LanguageField
,MultilineField
,NumericField
,PasswordField
,RedirectField
,TerminalColorSchemeField
,TextField
,TimeField
,TimeZoneField
,UsernameField
public class Field extends Object
Represents an arbitrary field, such as an HTTP parameter, the parameter of a remote desktop protocol, or an input field within a form. Fields are generic and typed dynamically through a type string, with the semantics of the field defined by the type string. The behavior of each field type is defined either through the web application itself (see FormService.js) or through extensions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Field.Type
All types of fields which are available by default.
-
Constructor Summary
Constructors Constructor Description Field()
Creates a new Parameter with no associated name or type.Field(String name, String type)
Creates a new Field with the given name and type.Field(String name, String type, Collection<String> options)
Creates a new Field with the given name, type, and possible values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getName()
Returns the unique name associated with this field.Collection<String>
getOptions()
Returns a mutable collection of field options.String
getType()
Returns the type of this field.void
setName(String name)
Sets the unique name associated with this field.void
setOptions(Collection<String> options)
Sets the options available as possible values of this field.void
setType(String type)
Sets the type of this field.
-
-
-
Constructor Detail
-
Field
public Field()
Creates a new Parameter with no associated name or type.
-
Field
public Field(String name, String type)
Creates a new Field with the given name and type.- Parameters:
name
- The unique name to associate with this field.type
- The type of this field.
-
Field
public Field(String name, String type, Collection<String> options)
Creates a new Field with the given name, type, and possible values.- Parameters:
name
- The unique name to associate with this field.type
- The type of this field.options
- A collection of all possible valid options for this field.
-
-
Method Detail
-
getName
public String getName()
Returns the unique name associated with this field.- Returns:
- The unique name associated with this field.
-
setName
public void setName(String name)
Sets the unique name associated with this field.- Parameters:
name
- The unique name to assign to this field.
-
getType
public String getType()
Returns the type of this field.- Returns:
- The type of this field.
-
setType
public void setType(String type)
Sets the type of this field.- Parameters:
type
- The type of this field.
-
getOptions
public Collection<String> getOptions()
Returns a mutable collection of field options. Changes to this collection directly affect the available options.- Returns:
- A mutable collection of field options, or null if the field has no options.
-
setOptions
public void setOptions(Collection<String> options)
Sets the options available as possible values of this field.- Parameters:
options
- The options to associate with this field.
-
-