org.ztemplates.form
Class ZFormValues

java.lang.Object
  extended by org.ztemplates.form.ZFormValues
All Implemented Interfaces:
Serializable

public class ZFormValues
extends Object
implements Serializable

Holds the values (as string) from a form. Should be used to extract the values from a form and keep them in a servlet session or serialize them into a hidden form parameter. Never keep the form object itself in the session.

Author:
gerdziegler.de
See Also:
Serialized Form

Constructor Summary
ZFormValues()
           
 
Method Summary
static Set<String> computeChangedPropertyNames(ZFormValues oldFormValues, ZFormValues newFormValues)
          Computes the names of the properties that have different values in the two ZFormValues.
static ZFormValues createFromString(String encoded)
          Deserializes the form Values from a string.
 HashMap<String,String[]> getValues()
           
 void readFromString(String base64)
          decodes the values previously encoded by encodeValues
 String writeToString()
          encodes values to a string that it can be used as value in a hidden form parameter
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZFormValues

public ZFormValues()
Method Detail

computeChangedPropertyNames

public static Set<String> computeChangedPropertyNames(ZFormValues oldFormValues,
                                                      ZFormValues newFormValues)
Computes the names of the properties that have different values in the two ZFormValues. Use this to compute the parameters changed by a user.

Parameters:
oldFormValues -
newFormValues -
Returns:

createFromString

public static ZFormValues createFromString(String encoded)
                                    throws Exception
Deserializes the form Values from a string.

Parameters:
encoded -
Returns:
Throws:
Exception

getValues

public HashMap<String,String[]> getValues()
Returns:
the values as a Map propertyName->propertyValues

writeToString

public String writeToString()
encodes values to a string that it can be used as value in a hidden form parameter

Parameters:
values -
Returns:

readFromString

public void readFromString(String base64)
decodes the values previously encoded by encodeValues

Parameters:
base64 -


Copyright © 2011. All Rights Reserved.