Class FieldParsedParameterList

java.lang.Object
name.matthewgreet.strutscommons.util.FieldParsedParameterList
All Implemented Interfaces:
Serializable

public class FieldParsedParameterList extends Object implements Serializable
The list of parsed HTTP parameters that apply to a field. Entries are expected to be either all non-indexed, or all uniquely indexed. When adding indexed entries, indices need not start at zero or be consecutive but cannot already exist, be less than zero, or exceed maximum size.
See Also:
  • Constructor Details

    • FieldParsedParameterList

      public FieldParsedParameterList(int maxListSize, String fieldName)
  • Method Details

    • ensureListIndex

      protected void ensureListIndex(int index)
      Ensures index exists in list by adding null entries till it does.
    • addParsedParameter

      public FieldParsedParameterList.AddResult addParsedParameter(ParsedParameter parsedParameter)
    • convertToSingleValue

      public void convertToSingleValue()
      Reduces list to first entry where only single value is expected.
    • getFieldName

      public String getFieldName()
    • getHasIndexed

      public boolean getHasIndexed()
      Returns whether list contains indexed parameter names.
    • getMultipleParameterValues

      public List<String> getMultipleParameterValues()
      Returns copy of parameter values of entire list with missing entries replaced by empty string. Used for array or collection form fields.
    • getMultipleValues

      public List<ParsedParameter> getMultipleValues()
      Returns copy of entire list with missing entries replaced by fake parameter of empty string. Used for array or collection form fields.
    • getMaxListSize

      public int getMaxListSize()
    • getSingleParameterValue

      public String getSingleParameterValue()
      Returns parameter value of first entry, or empty string if no entries. Used for single value form fields.
    • getSingleValue

      public ParsedParameter getSingleValue()
      Returns first entry, or fake parsed parameter using empty string if no entries. Used for single value form fields.
    • getSize

      public int getSize()
      Returns number of parameters, whether real or fake placeholders.
    • toString

      public String toString()
      Overrides:
      toString in class Object