C# Class SimpleFramework.Xml.Core.Session

The Session object represents a session with name value pairs. The persister uses this to allow objects to add or remove name value pairs to an from an internal map. This is done so that the deserialized objects can set template values as well as share information. In particular this is useful for any Strategy implementation as it allows it so store persistence state during the persistence process.

Another important reason for the session map is that it is used to wrap the map that is handed to objects during callback methods. This opens the possibility for those objects to grab a reference to the map, which will cause problems for any of the strategy implementations that wanted to use the session reference for weakly storing persistence artifacts.

Inheritance: Dictionary
Afficher le fichier Open project: ngallagher/simplexml Class Usage Examples

Méthodes publiques

Méthode Description
Clear ( ) : void

The clear method is used to wipe out all the currently existing pairs from the collection. This is used when all mappings within the session should be erased.

ContainsKey ( Object name ) : bool

This is used to determine whether a value representing the name of a pair has been inserted into the internal map. The object passed into this method is typically a string which references a template variable but can be any object.

ContainsValue ( Object value ) : bool

This method is used to determine whether any pair that has been inserted into the internal map had the presented value. If one or more pairs within the collected mappings contains the value provided then this method will return true.

EntrySet ( ) : Set

This method is used to acquire the name and value pairs that have currently been collected by this session. This is used to determine which mappings are available within the session.

Get ( Object name ) : Object

The get method is used to acquire the value for a named pair. So if a mapping for the specified name exists within the internal map the mapped entry value is returned.

IsEmpty ( ) : bool

This method is used to determine whether the session has any pairs available. If the size is zero then the session is empty and this returns true. The is acts as a proxy the the isEmpty of the internal map.

KeySet ( ) : Set

This is used to acquire the names for all the pairs that have currently been collected by this session. This is used to determine which mappings are available within the map.

Put ( Object name, Object value ) : Object

The put method is used to insert the name and value provided into the internal session map. The inserted value will be available to all objects receiving callbacks.

PutAll ( Dictionary data ) : void

This method is used to insert a collection of mappings into the session map. This is used when another source of pairs is required to populate the collection currently maintained within this sessions internal map. Any pairs that currently exist with similar names will be overwritten by this.

Remove ( Object name ) : Object

The remove method is used to remove the named mapping from the internal session map. This ensures that the mapping is no longer available for persister callbacks.

Session ( ) : System.Collections.Generic

Constructor for the Session object. This is used to create a new session that makes use of a hash map to store key value pairs which are maintained throughout the duration of the persistence process this is used in.

Size ( ) : int
Values ( ) : Collection

This method is used to acquire the value for all pairs that have currently been collected by this session. This is used to determine the values that are available in the session.

Method Details

Clear() public méthode

The clear method is used to wipe out all the currently existing pairs from the collection. This is used when all mappings within the session should be erased.
public Clear ( ) : void
Résultat void

ContainsKey() public méthode

This is used to determine whether a value representing the name of a pair has been inserted into the internal map. The object passed into this method is typically a string which references a template variable but can be any object.
public ContainsKey ( Object name ) : bool
name Object /// this is the name of a pair within the map ///
Résultat bool

ContainsValue() public méthode

This method is used to determine whether any pair that has been inserted into the internal map had the presented value. If one or more pairs within the collected mappings contains the value provided then this method will return true.
public ContainsValue ( Object value ) : bool
value Object /// this is the value that is to be searched for ///
Résultat bool

EntrySet() public méthode

This method is used to acquire the name and value pairs that have currently been collected by this session. This is used to determine which mappings are available within the session.
public EntrySet ( ) : Set
Résultat Set

Get() public méthode

The get method is used to acquire the value for a named pair. So if a mapping for the specified name exists within the internal map the mapped entry value is returned.
public Get ( Object name ) : Object
name Object /// this is a name used to search for the value ///
Résultat Object

IsEmpty() public méthode

This method is used to determine whether the session has any pairs available. If the size is zero then the session is empty and this returns true. The is acts as a proxy the the isEmpty of the internal map.
public IsEmpty ( ) : bool
Résultat bool

KeySet() public méthode

This is used to acquire the names for all the pairs that have currently been collected by this session. This is used to determine which mappings are available within the map.
public KeySet ( ) : Set
Résultat Set

Put() public méthode

The put method is used to insert the name and value provided into the internal session map. The inserted value will be available to all objects receiving callbacks.
public Put ( Object name, Object value ) : Object
name Object /// this is the name the value is mapped under ///
value Object /// this is the value to mapped with the name ///
Résultat Object

PutAll() public méthode

This method is used to insert a collection of mappings into the session map. This is used when another source of pairs is required to populate the collection currently maintained within this sessions internal map. Any pairs that currently exist with similar names will be overwritten by this.
public PutAll ( Dictionary data ) : void
data Dictionary /// this is the collection of pairs to be added ///
Résultat void

Remove() public méthode

The remove method is used to remove the named mapping from the internal session map. This ensures that the mapping is no longer available for persister callbacks.
public Remove ( Object name ) : Object
name Object /// this is a string used to search for the value ///
Résultat Object

Session() public méthode

Constructor for the Session object. This is used to create a new session that makes use of a hash map to store key value pairs which are maintained throughout the duration of the persistence process this is used in.
public Session ( ) : System.Collections.Generic
Résultat System.Collections.Generic

Size() public méthode

public Size ( ) : int
Résultat int

Values() public méthode

This method is used to acquire the value for all pairs that have currently been collected by this session. This is used to determine the values that are available in the session.
public Values ( ) : Collection
Résultat Collection