|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectto.etc.domui.state.PageParameters
public class PageParameters
Encapsulates parameters for a page. All parameters must be presentable in URL form,
i.e. they must be renderable as part of a GET or POST. A page request formed by a
Page class and a PageParameters class is bookmarkable.
This is a mutable object.
A PageParameters object can be rendered on an URL by using DomUtil.addUrlParameters(StringBuilder, PageParameters, boolean)
.
Constructor Summary | |
---|---|
PageParameters()
Create an empty PageParameters. |
|
PageParameters(java.lang.Object... list)
Create page parameters and fill with the initial set defined in the argument list. |
Method Summary | |
---|---|
void |
addParameter(java.lang.String name,
java.lang.Object value)
Adds a parameter with the specified name. |
void |
addParameters(java.lang.Object... plist)
Add parameters. |
static PageParameters |
createFrom(IRequestContext ctx)
Create this from an actual request. |
boolean |
equals(java.lang.Object obj)
Compare this with another instance. |
boolean |
getBoolean(java.lang.String name)
Gets the value for the specified parametername as a boolean (primitive). |
boolean |
getBoolean(java.lang.String name,
boolean df)
Gets the value for the specified parametername as a boolean (primitive). |
int |
getInt(java.lang.String name)
Gets the value for the specified parametername as an int (primitive). |
int |
getInt(java.lang.String name,
int df)
Gets the value for the specified parametername as an int (primitive). |
long |
getLong(java.lang.String name)
Gets the value for the specified parametername as a long (primitive). |
long |
getLong(java.lang.String name,
long df)
Gets the value for the specified parametername as a long (primitive). |
java.lang.Long |
getLongW(java.lang.String name)
Gets the value for the specified parametername as a Long object. |
java.lang.Long |
getLongW(java.lang.String name,
long df)
Gets the value for the specified parametername as a Long object. |
java.lang.Long |
getLongW(java.lang.String name,
java.lang.Long df)
Gets the value for the specified parametername as a Long object. |
java.lang.String[] |
getParameterNames()
Gets all the names of the parameters this object is holding |
java.lang.String |
getString(java.lang.String name)
Gets the value for the specified parametername as a String object. |
java.lang.String |
getString(java.lang.String name,
java.lang.String df)
Gets the value for the specified parametername as a String object. |
java.lang.String[] |
getStringArray(java.lang.String name)
Gets the value for the specified parametername as a String array. |
PageParameters |
getUnlockedCopy()
Creates copy of current PageParameters. |
int |
hashCode()
|
boolean |
hasParameter(java.lang.String name)
Indicates whether a given parameter name exists in this PageParameters object. |
void |
removeParameter(java.lang.String name)
Removes the parameter with specified name entirely from the map. |
void |
setReadOnly()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PageParameters()
public PageParameters(java.lang.Object... list)
addParameters(Object...)
.
list
- Method Detail |
---|
public PageParameters getUnlockedCopy()
public void setReadOnly()
public void addParameters(java.lang.Object... plist) throws java.lang.Exception
ILongIdentifyable
the primary key for the object will be rendered as the value, otherwise it will be rendered as a tostring.
You can also specify a single object in the location for the next key; in this case both key and value will
be determined from this object; it must be some persistent object which knows it's key field.
plist
-
java.lang.Exception
public void addParameter(java.lang.String name, java.lang.Object value)
name,
- the parameter name.value,
- the (new) value.public void removeParameter(java.lang.String name)
name,
- the name of the parameter to be removed.public boolean hasParameter(java.lang.String name)
name,
- the name of the parameter to be checked for.
public int getInt(java.lang.String name)
name,
- the name of the parameter who's value is to be retrieved.
public int getInt(java.lang.String name, int df)
name,
- the name of the parameter who's value is to be retrieved.df,
- the default value to be returned, when the specified parameter does not exist.
public long getLong(java.lang.String name)
name,
- the name of the parameter who's value is to be retrieved.
public long getLong(java.lang.String name, long df)
name,
- the name of the parameter who's value is to be retrieved.df,
- the default value to be returned, when the specified parameter does not exist.
public boolean getBoolean(java.lang.String name)
name,
- the name of the parameter who's value is to be retrieved.
public boolean getBoolean(java.lang.String name, boolean df)
name,
- the name of the parameter who's value is to be retrieved.df,
- the default value to be returned, when the specified parameter does not exist.
public java.lang.Long getLongW(java.lang.String name)
name,
- the name of the parameter who's value is to be retrieved.
public java.lang.Long getLongW(java.lang.String name, long df)
name,
- the name of the parameter who's value is to be retrieved.df,
- the default value to be returned, when the specified parameter does not exist.
public java.lang.Long getLongW(java.lang.String name, java.lang.Long df)
name,
- the name of the parameter who's value is to be retrieved.df,
- the default value to be returned, when the specified parameter does not exist.
@Nonnull public java.lang.String getString(java.lang.String name)
name,
- the name of the parameter who's value is to be retrieved.
@Nullable public java.lang.String getString(java.lang.String name, java.lang.String df)
name,
- the name of the parameter who's value is to be retrieved.df,
- the default value to be returned, when the specified parameter does not exist.
@Nonnull public java.lang.String[] getStringArray(java.lang.String name)
name,
- the name of the parameter who's value is to be retrieved.
@Nonnull public static PageParameters createFrom(IRequestContext ctx)
c
-
public java.lang.String toString()
toString
in class java.lang.Object
@Nonnull public java.lang.String[] getParameterNames()
public boolean equals(java.lang.Object obj)
We check the size of the maps; if they are equal we ONLY have to check that each key-value pair in SOURCE exists in TARGET AND is the same. We don't need to check for "thingies in SRC that do not occur in TGT" because that cannot happen if the map sizes are equal.
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |