org.apache.cocoon.el.objectmodel
Interface ObjectModel

All Superinterfaces:
Map

public interface ObjectModel
extends Map

ObjectModel is a special Map that cannot be modified using standard Map methods, except put(Object, Object) method.


Nested Class Summary
 
Nested classes inherited from class java.util.Map
Map.Entry
 
Field Summary
static String CONTEXTBEAN
           
static String NAMESPACE
           
static String PARAMETERS_PATH
           
static String ROLE
           
 
Method Summary
 void cleanupLocalContext()
          Cleans up entries put to ObjectModel since last markLocalContext() call.
 void fillContext()
           Copies properties (both static and dynamic) of current context bean to the Object Model.
 MultiMap getAll()
           
 void markLocalContext()
          Marks new local context.
 Object put(Object key, Object value)
          Works exactly the same way as Map.put(Object, Object) but previous value associated to key is not lost in a case markLocalContext() was called before.
 void putAll(Map mapToCopy)
           
 void putAt(String path, Object value)
          Puts object at certain path.
 void setParent(ObjectModel parentObjectModel)
          Sets parent object model so newly created instance can inherit values from parent but cannot modify it.
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, remove, size, values
 

Field Detail

ROLE

public static final String ROLE

CONTEXTBEAN

public static final String CONTEXTBEAN
See Also:
Constant Field Values

NAMESPACE

public static final String NAMESPACE
See Also:
Constant Field Values

PARAMETERS_PATH

public static final String PARAMETERS_PATH
See Also:
Constant Field Values
Method Detail

getAll

public MultiMap getAll()
Returns:
a MultiMap that contains all stored values in all context in LIFO-compliant order. Returned MultiMap is Unmodifiable.

put

public Object put(Object key,
                  Object value)
Works exactly the same way as Map.put(Object, Object) but previous value associated to key is not lost in a case markLocalContext() was called before. The previous value is stored and can be recovered by calling markLocalContext().

Specified by:
put in interface Map

putAll

public void putAll(Map mapToCopy)
Specified by:
putAll in interface Map
See Also:
put(Object, Object)

markLocalContext

public void markLocalContext()
Marks new local context. Such mark is useful to do a clean up of entries.


cleanupLocalContext

public void cleanupLocalContext()
Cleans up entries put to ObjectModel since last markLocalContext() call.


putAt

public void putAt(String path,
                  Object value)
Puts object at certain path. Each segment of path is separated by "/" symbol. This method supports only traversing through objects implementing Map interface. If certain segment does not exist it will be created automatically.

Parameters:
path - where the value should be put at
value - that is going to be put

fillContext

public void fillContext()

Copies properties (both static and dynamic) of current context bean to the Object Model. The method is useful when you want, for example, to access properties of context bean in JEXL expression and omit contextBean. part.

See Also:
for description of static and dynamic properties

setParent

public void setParent(ObjectModel parentObjectModel)

Sets parent object model so newly created instance can inherit values from parent but cannot modify it.

Parameters:
parentObjectModel -


Copyright © 1999-2008 The Apache Software Foundation. All Rights Reserved.