Package net.ontopia.topicmaps.nav2.utils
Class ContextUtils
- java.lang.Object
-
- net.ontopia.topicmaps.nav2.utils.ContextUtils
-
public final class ContextUtils extends Object
PUBLIC: Utility methods for working with the variable bindings in the Navigator context.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TopicMapRepositoryIF
getRepository(javax.servlet.ServletContext servletContext)
EXPERIMENTAL: Gets the topic map repository used by the navigator framework.static Object
getSingleValue(String name, javax.servlet.jsp.PageContext pageContext)
PUBLIC: Returns the first value in the collection bound to a specific variable in the current scope.static Object
getSingleValue(String name, javax.servlet.ServletRequest request)
PUBLIC: Returns the first value in the collection bound to a specific variable in the current scope.static TopicMapIF
getTopicMap(javax.servlet.jsp.PageContext pageContext)
EXPERIMENTAL: Get the topic map object the context tag is working with.static TopicMapIF
getTopicMap(javax.servlet.ServletRequest request)
EXPERIMENTAL: Get the topic map object the context tag is working with.static Collection
getValue(String name, javax.servlet.jsp.PageContext pageContext)
PUBLIC: Returns the value bound to a specific variable in the current scope.static Collection
getValue(String name, javax.servlet.jsp.PageContext pageContext, Collection defaultValue)
PUBLIC: Returns the value bound to a specific variable in the current scope.static void
setSingleValue(String name, javax.servlet.jsp.PageContext pageContext, Object value)
PUBLIC: Sets the value of the named variable to a collection consisting only of the single value given.static void
setValue(String name, javax.servlet.jsp.PageContext pageContext, Collection value)
PUBLIC: Sets the value of the named variable to the collection given.
-
-
-
Method Detail
-
getRepository
public static TopicMapRepositoryIF getRepository(javax.servlet.ServletContext servletContext)
EXPERIMENTAL: Gets the topic map repository used by the navigator framework.- Since:
- 3.4
-
getTopicMap
public static TopicMapIF getTopicMap(javax.servlet.ServletRequest request)
EXPERIMENTAL: Get the topic map object the context tag is working with. This method will give direct access to the same transaction as the context tag is using.- Since:
- 3.4
-
getTopicMap
public static TopicMapIF getTopicMap(javax.servlet.jsp.PageContext pageContext)
EXPERIMENTAL: Get the topic map object the context tag is working with. This method will give direct access to the same transaction as the context tag is using.- Since:
- 3.2.1
-
getValue
public static Collection getValue(String name, javax.servlet.jsp.PageContext pageContext)
PUBLIC: Returns the value bound to a specific variable in the current scope. The value returned will be null if the variable is unknown.
-
getValue
public static Collection getValue(String name, javax.servlet.jsp.PageContext pageContext, Collection defaultValue)
PUBLIC: Returns the value bound to a specific variable in the current scope. The value returned will be defaultValue if the variable is unknown.
-
getSingleValue
public static Object getSingleValue(String name, javax.servlet.jsp.PageContext pageContext)
PUBLIC: Returns the first value in the collection bound to a specific variable in the current scope. The value returned will be null if the variable is unknown or if the collection is empty.
-
getSingleValue
public static Object getSingleValue(String name, javax.servlet.ServletRequest request)
PUBLIC: Returns the first value in the collection bound to a specific variable in the current scope. The value returned will be null if the variable is unknown or if the collection is empty.- Since:
- 2.2.1
-
setValue
public static void setValue(String name, javax.servlet.jsp.PageContext pageContext, Collection value)
PUBLIC: Sets the value of the named variable to the collection given. The value can be null, which effectively unsets the variable.
-
-