org.inxar.syntacs.util
Interface Session

All Known Implementing Classes:
StandardSession

public interface Session

The Session interface acts a central repository for properties as well as a logging access.


Method Summary
 void close()
          To be called at the end of the session.
 boolean contains(String key)
          Returns true if an entry exists for the given key, false otherwise.
 Object get(String key)
          Returns the Object under the given key or null if no such key exists.
 boolean getBoolean(String key)
          Returns the boolean under the given key.
 boolean getBoolean(String key, boolean def)
          Returns the boolean under the given key.
 int getInt(String key)
          Returns the Object under the given key.
 int getInt(String key, int def)
          Returns the Object under the given key.
 String getString(String key)
          Returns the String under the given key or null if no such key exists.
 String getString(String key, String defaultValue)
          Returns the String under the given key or the given default if no such key exists.
 boolean isFalse(String key)
          Returns true if an extry exists for the given key and the value is either a boolean having value false, the string "false", or the string "no".
 boolean isNotFalse(String key)
          Returns true if no entry exists for the given key, the value is either a boolean having value true, or any string other than "false" or "no".
 boolean isNotTrue(String key)
          Returns true if no entry exists for the given key, the value is either a boolean having value false, or any string other than "true" or "yes".
 boolean isTrue(String key)
          Returns true if an extry exists for the given key and the value is either a boolean having value true, the string "true", or the string "yes".
 Log log(String name, Object src)
          Registers the object with the control such that it may emit messages through the log channels.
 void put(String key, Object value)
          Stores the given value under the given key.
 Object remove(String key)
          Removes the key/value pair and returns the value or null if no such key exists.
 

Method Detail

get

public Object get(String key)
Returns the Object under the given key or null if no such key exists.

put

public void put(String key,
                Object value)
Stores the given value under the given key.

remove

public Object remove(String key)
Removes the key/value pair and returns the value or null if no such key exists.

getString

public String getString(String key)
Returns the String under the given key or null if no such key exists.

getString

public String getString(String key,
                        String defaultValue)
Returns the String under the given key or the given default if no such key exists.

getInt

public int getInt(String key)
Returns the Object under the given key. If no such key exists, an IllegalArgumentException will be thrown.

getInt

public int getInt(String key,
                  int def)
Returns the Object under the given key. If no such key exists, the given default will be returned.

getBoolean

public boolean getBoolean(String key)
Returns the boolean under the given key. If no such key exists, an IllegalArgumentException will be thrown.

getBoolean

public boolean getBoolean(String key,
                          boolean def)
Returns the boolean under the given key. If no such key exists, the given default will be returned.

contains

public boolean contains(String key)
Returns true if an entry exists for the given key, false otherwise.

isTrue

public boolean isTrue(String key)
Returns true if an extry exists for the given key and the value is either a boolean having value true, the string "true", or the string "yes". If no entry exists for the given key, false is returned.

isFalse

public boolean isFalse(String key)
Returns true if an extry exists for the given key and the value is either a boolean having value false, the string "false", or the string "no". If no entry exists for the given key, false is returned.

isNotTrue

public boolean isNotTrue(String key)
Returns true if no entry exists for the given key, the value is either a boolean having value false, or any string other than "true" or "yes".

isNotFalse

public boolean isNotFalse(String key)
Returns true if no entry exists for the given key, the value is either a boolean having value true, or any string other than "false" or "no".

log

public Log log(String name,
               Object src)
Registers the object with the control such that it may emit messages through the log channels.

close

public void close()
To be called at the end of the session.