Web Dynpro API Documentation

com.sap.tc.webdynpro.progmodel.api
Interface IWDContext


public interface IWDContext

Access to the context data of a controller.

All data managed by a controller is contained in its context. Contexts are structured as a tree of nodes which in turn contain attributes.

The context interface provides access to the root node, to the meta data of the root node and to the type info for a context attribute.

For contexts created with Web Dynpro design time tools, sub interfaces will be generated that provide typed access to the subnodes of the context rood node.

Version:
$Id: //tc/WebDynproRuntime/630_VAL_REL/src/_webdynpro_progmodel/java/com/sap/tc/webdynpro/progmodel/api/IWDContext.java#1 $

Method Summary
 IWDController getController()
          Returns the API of the controller this context belongs to.
 ISimpleTypeModifiable getModifiableTypeOf(java.lang.String path)
          Returns a modifiable data type of the context attribute identified by the given dot delimited path.
 java.lang.String getName()
          Returns the name of this context.
 IWDNode getRootNode()
          Returns the root node of this context.
 IWDNodeInfo getRootNodeInfo()
          Returns the node info of the root node of this context.
 ISimpleType getTypeOf(java.lang.String path)
          Returns the data type of the context attribute identified by the given dot delimited path.
 void reset()
          Arbitrarily resets the context to its initial state.
 void reset(boolean clear)
          Conditionally resets the context to its initial state.
 void resetChangedByClient()
          Global reset of all changedByClient flags in all context node elements.
 

Method Detail

getName

public java.lang.String getName()
Returns the name of this context. The name of a context is the name of the controller to which it belongs, not the unqualified class name of the context.
Returns:
the name of this context

getRootNode

public IWDNode getRootNode()
Returns the root node of this context. Since the context root node is created at component creation time, and always has a cardinality of 1..1, it is guaranteed that the context root node will always exist, and that it will always contain exactly one element.
Returns:
the root node of this context

getRootNodeInfo

public IWDNodeInfo getRootNodeInfo()
Returns the node info of the root node of this context.
Returns:
the root node info of this context

getTypeOf

public ISimpleType getTypeOf(java.lang.String path)
Returns the data type of the context attribute identified by the given dot delimited path.
Parameters:
path - the path, which identifies the context attribute
Returns:
the data type of the context attribute
Throws:
ContextException - if the path does not identify an attribute or if the attribute's type is not an ISimpleType

getModifiableTypeOf

public ISimpleTypeModifiable getModifiableTypeOf(java.lang.String path)
Returns a modifiable data type of the context attribute identified by the given dot delimited path. Subsequent calls to this method for the same value of path are guaranteed to return the same instance.
Parameters:
path - the path, which identifies the context attribute
Returns:
the modifiable data type of the context attribute
Throws:
ContextException - if the path does not identify an attribute or if the attribute's type is not an ISimpleType

reset

public void reset()
Arbitrarily resets the context to its initial state. All nodes are invalidated, and all dynamically added nodes and attributes are destroyed from the metadata.

Warning: It is the responsibility of the application developer to ensure that all node and attribute mapping or binding dependencies are deactivated before this method is called.

Calling reset() when mapping or binding dependencies are still active will have unpredictable results and possibly lead to a fatal error in the Web Dynpro Framework for your application.

See Also:
IWDNode.invalidate()

reset

public void reset(boolean clear)
Conditionally resets the context to its initial state. By setting the clear parameter to false, data in node collections created at design time will be preserved. All dynamically added nodes and attributes are destroyed from the metadata.

Calling reset(true) is functionally equivalent to calling reset().

The same warning given for method reset() about mapped or bound nodes and attributes also applies to reset(boolean clear).

Parameters:
clear - Whether the data shall be cleared before cleaning the metadata.
See Also:
reset()

resetChangedByClient

public void resetChangedByClient()
Global reset of all changedByClient flags in all context node elements.

getController

public IWDController getController()
Returns the API of the controller this context belongs to.

Web Dynpro API Documentation

Copyright © 2004 SAP AG. Automatically generated Thu Mar 3 2005, 22:15