Package org.apache.wicket.settings
Class FrameworkSettings
- java.lang.Object
-
- org.apache.wicket.settings.FrameworkSettings
-
- All Implemented Interfaces:
IEventDispatcher
public class FrameworkSettings extends Object implements IEventDispatcher
Framework settings for retrieving and configuring framework settings.- Author:
- Jonathan Locke, Chris Turner, Eelco Hillenius, Juergen Donnerstag, Johan Compagner, Igor Vaynberg (ivaynberg), Martijn Dashorst, James Carman
-
-
Constructor Summary
Constructors Constructor Description FrameworkSettings(Application application)
Construct.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FrameworkSettings
add(IEventDispatcher dispatcher)
Registers a new event dispatchervoid
dispatchEvent(Object sink, IEvent<?> event, Component component)
Dispatches event to registered dispatchersIDetachListener
getDetachListener()
ISerializer
getSerializer()
String
getVersion()
Gets the Wicket version.boolean
hasAnyEventDispatchers()
FrameworkSettings
setDefaultEventDispatcher(IEventDispatcher defaultEventDispatcher)
Allows to set the default events dispatcherFrameworkSettings
setDetachListener(IDetachListener detachListener)
Sets detach listenerFrameworkSettings
setSerializer(ISerializer serializer)
Sets theISerializer
that will be used to convert objects to/from byte arrays
-
-
-
Constructor Detail
-
FrameworkSettings
public FrameworkSettings(Application application)
Construct.- Parameters:
application
-
-
-
Method Detail
-
getVersion
public String getVersion()
Gets the Wicket version. The Wicket version is in the same format as the version element in the pom.xml file (project descriptor). The version is generated by maven in the build/release cycle and put in the /META-INF/MANIFEST.MF file located in the root folder of the Wicket jar.The version usually follows one of the following formats:
- major.minor[.bug] for stable versions. 1.1, 1.2, 1.2.1 are examples
- major.minor-state for development versions. 1.2-beta2, 1.3-SNAPSHOT are examples
- Returns:
- the Wicket version
-
getDetachListener
public IDetachListener getDetachListener()
- Returns:
- detach listener or
null
if none
-
setDetachListener
public FrameworkSettings setDetachListener(IDetachListener detachListener)
Sets detach listener- Parameters:
detachListener
- listener ornull
to remove- Returns:
this
object for chaining
-
add
public FrameworkSettings add(IEventDispatcher dispatcher)
Registers a new event dispatcher- Parameters:
dispatcher
-IEventDispatcher
- Returns:
this
object for chaining
-
hasAnyEventDispatchers
public final boolean hasAnyEventDispatchers()
- Returns:
- Returns
true
if there is at least one event dispatcher
-
dispatchEvent
public void dispatchEvent(Object sink, IEvent<?> event, Component component)
Dispatches event to registered dispatchers- Specified by:
dispatchEvent
in interfaceIEventDispatcher
- Parameters:
sink
- the sink for the event. Sinks usually implementIEventSink
orIComponentAwareEventSink
. See thecomponent
parameter described below.component
- provides context to the sink. Some sinks are owned by the component, egBehavior
s, and thus it is useful for them to have a reference to their owning component. If this method is notnull
the dispatcher should try to look for an alternative sink method which takes a component reference as an additional parameter, one such implementation isIComponentAwareEventSink
.- See Also:
IEventDispatcher.dispatchEvent(Object, IEvent, Component)
-
setDefaultEventDispatcher
public FrameworkSettings setDefaultEventDispatcher(IEventDispatcher defaultEventDispatcher)
Allows to set the default events dispatcher- Parameters:
defaultEventDispatcher
- IEventDispatcher- Returns:
this
object for chaining
-
setSerializer
public FrameworkSettings setSerializer(ISerializer serializer)
Sets theISerializer
that will be used to convert objects to/from byte arrays- Parameters:
serializer
- theISerializer
to use- Returns:
this
object for chaining
-
getSerializer
public ISerializer getSerializer()
- Returns:
- the
ISerializer
that will be used to convert objects to/from byte arrays
-
-