Class DefaultPageState
- java.lang.Object
-
- org.onehippo.forge.pageflow.core.rt.impl.DefaultPageState
-
- All Implemented Interfaces:
Serializable
,PageState
public class DefaultPageState extends Object implements PageState
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAllErrors(Map<String,Errors> errorsMap)
Errors
addErrors(String name, Errors errors)
void
clearAllErrors()
Clear all the application specificErrors
in thisPageState
.boolean
equals(Object o)
Compares the specified object with thisPageState
for equality.Map<String,Errors>
getErrorsMap()
String
getId()
Return the identifier of thisPageState
.int
getIndex()
Return the internal index, which is the same as definition order in the backend, of thePageState
.Map<String,String>
getMetadata()
Return an unmodifiable metadata map of thePageState
.String
getName()
Return the (human readable) name of thisPageState
.String
getPath()
Return the logical path info of thePageState
.int
hashCode()
Returns the hash code value for thisPageState
.boolean
isErrorsEmpty()
Return true if there's no application error at runtime in thisPageState
.Errors
removeErrors(String name)
String
toString()
-
-
-
Method Detail
-
getId
public String getId()
Description copied from interface:PageState
Return the identifier of thisPageState
.
-
getName
public String getName()
Description copied from interface:PageState
Return the (human readable) name of thisPageState
.
-
getPath
public String getPath()
Description copied from interface:PageState
Return the logical path info of thePageState
.This
path
info must be translated into a physical URI or client-side route information by an application. In the definition level, thispath
info doesn't imply any physical translations by itself.
-
getIndex
public int getIndex()
Description copied from interface:PageState
Return the internal index, which is the same as definition order in the backend, of thePageState
.
-
getMetadata
public Map<String,String> getMetadata()
Description copied from interface:PageState
Return an unmodifiable metadata map of thePageState
.- Specified by:
getMetadata
in interfacePageState
- Returns:
- an unmodifiable metadata map of the
PageState
-
isErrorsEmpty
public boolean isErrorsEmpty()
Description copied from interface:PageState
Return true if there's no application error at runtime in thisPageState
.The application errors can be added, retrieved and removed by applications for an easier application development.
- Specified by:
isErrorsEmpty
in interfacePageState
- Returns:
- true if there's no application error at runtime in this
PageState
-
addErrors
public Errors addErrors(String name, Errors errors)
Description copied from interface:PageState
Add an application specificErrors
by thename
to thisPageState
.The
name
can be used by applications to distinguish the sources of errors. e.g, field name.
-
addAllErrors
public void addAllErrors(Map<String,Errors> errorsMap)
Description copied from interface:PageState
Add an application specific map ofErrors
, each entry of which is paired withname
andErrors
object to thisPageState
.- Specified by:
addAllErrors
in interfacePageState
- Parameters:
errorsMap
- an application specific map ofErrors
, each entry of which is paired withname
andErrors
object
-
removeErrors
public Errors removeErrors(String name)
Description copied from interface:PageState
Remove the application specificErrors
by thename
from thisPageState
.The
name
can be used by applications to distinguish the sources of errors. e.g, field name.- Specified by:
removeErrors
in interfacePageState
- Parameters:
name
- application specific source name of the errors.- Returns:
- the previous
Errors
value associated withname
, or null if there was no mapping for thename
-
getErrorsMap
public Map<String,Errors> getErrorsMap()
Description copied from interface:PageState
Return an application specific map ofErrors
, each entry of which is paired withname
andErrors
object in thisPageState
.- Specified by:
getErrorsMap
in interfacePageState
- Returns:
- an application specific map of
Errors
, each entry of which is paired withname
andErrors
object in thisPageState
-
clearAllErrors
public void clearAllErrors()
Description copied from interface:PageState
Clear all the application specificErrors
in thisPageState
.- Specified by:
clearAllErrors
in interfacePageState
-
equals
public boolean equals(Object o)
Description copied from interface:PageState
Compares the specified object with thisPageState
for equality.
-
hashCode
public int hashCode()
Description copied from interface:PageState
Returns the hash code value for thisPageState
.
-
-