Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.commons.validator
Class FormSet

    java.lang.Object
      |
      +--org.apache.commons.validator.FormSet

All Implemented Interfaces:
  java.io.Serializable

public class FormSet
extends java.lang.Object
implements java.io.Serializable

Holds a set of `Form`s stored associated with a `Locale` based on the country, language, and variant specified. Instances of this class are configured with a <formset> xml element.

See Also:
  Serialized Form

Field Summary
`protected static int` | `COUNTRY_FORMSET` This is the type of `FormSet`s where only language and country locale are specified.
`protected static int` | `GLOBAL_FORMSET` This is the type of `FormSet`s where no locale is specified.
`protected static int` | `LANGUAGE_FORMSET` This is the type of `FormSet`s where only language locale is specified.
`protected static int` | `VARIANT_FORMSET` This is the type of `FormSet`s where full locale has been set.

Constructor Summary
`FormSet()`

Method Summary
`void` | `addConstant(java.lang.String name, java.lang.String value)` Add a `Constant` to the locale level.
`void` | `addForm(Form f)` Add a `Form` to the `FormSet`.
`java.lang.String` | `displayKey()` Returns a string representation of the object's key.
`java.lang.String` | `getCountry()` Gets the equivalent of the country component of `Locale`.
`Form` | `getForm(java.lang.String formName)` Retrieve a `Form` based on the form name.
`java.util.Map` | `getForms()` A `Map` of `Form`s is returned as an unmodifiable `Map` with the key based on the form name.
`java.lang.String` | `getLanguage()` Gets the equivalent of the language component of `Locale`.
`protected int` | `getType()` Returns the type of `FormSet`:`GLOBAL_FORMSET`, `LANGUAGE_FORMSET`,`COUNTRY_FORMSET` or `VARIANT_FORMSET` .
`java.lang.String` | `getVariant()` Gets the equivalent of the variant component of `Locale`.
`protected boolean` | `isMerged()` Has this formSet been merged?
`boolean` | `isProcessed()` Whether or not the this `FormSet` was processed for replacing variables in strings with their values.
`protected void` | `merge(FormSet depends)` Merges the given `FormSet` into this one.
`void` | `setCountry(java.lang.String country)` Sets the equivalent of the country component of `Locale`.
`void` | `setLanguage(java.lang.String language)` Sets the equivalent of the language component of `Locale`.
`void` | `setVariant(java.lang.String variant)` Sets the equivalent of the variant component of `Locale`.
`java.lang.String` | `toString()` Returns a string representation of the object.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### GLOBAL_FORMSET

    protected static final int GLOBAL_FORMSET

  This is the type of `FormSet`s where no locale is specified.

### LANGUAGE_FORMSET

    protected static final int LANGUAGE_FORMSET

  This is the type of `FormSet`s where only language locale is specified.

### COUNTRY_FORMSET

    protected static final int COUNTRY_FORMSET

  This is the type of `FormSet`s where only language and country locale are specified.

### VARIANT_FORMSET

    protected static final int VARIANT_FORMSET

  This is the type of `FormSet`s where full locale has been set.

Constructor Detail

### FormSet

    public FormSet()

Method Detail

### isMerged

    protected boolean isMerged()

  Has this formSet been merged?
  Returns:
    true if it has been merged
  Since:
    Validator 1.2.0

### getType

    protected int getType()

  Returns the type of `FormSet`:`GLOBAL_FORMSET`, `LANGUAGE_FORMSET`,`COUNTRY_FORMSET` or `VARIANT_FORMSET` .
  Returns:
    The type value
  Throws:
    `NullPointerException` - if there is inconsistency in the locale definition (not sure about this)
  Since:
    Validator 1.2.0

### merge

    protected void merge(FormSet depends)

  Merges the given `FormSet` into this one. If any of `depends` s `Forms` are not in this `FormSet` then, include them, else merge both `Forms`. Theoretically we should only merge a "parent" formSet.
  Parameters:
    `depends` - FormSet to be merged
  Since:
    Validator 1.2.0

### isProcessed

    public boolean isProcessed()

  Whether or not the this `FormSet` was processed for replacing variables in strings with their values.
  Returns:
    The processed value

### getLanguage

    public java.lang.String getLanguage()

  Gets the equivalent of the language component of `Locale`.
  Returns:
    The language value

### setLanguage

    public void setLanguage(java.lang.String language)

  Sets the equivalent of the language component of `Locale`.
  Parameters:
    `language` - The new language value

### getCountry

    public java.lang.String getCountry()

  Gets the equivalent of the country component of `Locale`.
  Returns:
    The country value

### setCountry

    public void setCountry(java.lang.String country)

  Sets the equivalent of the country component of `Locale`.
  Parameters:
    `country` - The new country value

### getVariant

    public java.lang.String getVariant()

  Gets the equivalent of the variant component of `Locale`.
  Returns:
    The variant value

### setVariant

    public void setVariant(java.lang.String variant)

  Sets the equivalent of the variant component of `Locale`.
  Parameters:
    `variant` - The new variant value

### addConstant

    public void addConstant(java.lang.String name,
                            java.lang.String value)

  Add a `Constant` to the locale level.
  Parameters:
    `name` - The constant name
    `value` - The constant value

### addForm

    public void addForm(Form f)

  Add a `Form` to the `FormSet`.
  Parameters:
    `f` - The form

### getForm

    public Form getForm(java.lang.String formName)

  Retrieve a `Form` based on the form name.
  Parameters:
    `formName` - The form name
  Returns:
    The form

### getForms

    public java.util.Map getForms()

  A `Map` of `Form`s is returned as an unmodifiable `Map` with the key based on the form name.
  Returns:
    The forms map

### displayKey

    public java.lang.String displayKey()

  Returns a string representation of the object's key.
  Returns:
    A string representation of the key

### toString

    public java.lang.String toString()

  Returns a string representation of the object.
  Overrides:
    `toString` in class `java.lang.Object`
  Returns:
    A string representation

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002-2006 The Apache Software Foundation. All Rights Reserved.