org.eclipse.xtend.util.stdlib
Class ElementPropertiesExtensions

java.lang.Object
  extended by org.eclipse.xtend.util.stdlib.AbstractStatefulExtensions<java.util.Map<java.lang.String,java.lang.Object>>
      extended by org.eclipse.xtend.util.stdlib.ElementPropertiesExtensions
All Implemented Interfaces:
IExecutionContextAware

public class ElementPropertiesExtensions
extends AbstractStatefulExtensions<java.util.Map<java.lang.String,java.lang.Object>>

Java helper class for Stdlib extension org::eclipse::xtend::util::stdlib::elementprops.

Author:
Karsten Thoms - Bug#310361

Field Summary
 
Fields inherited from class org.eclipse.xtend.util.stdlib.AbstractStatefulExtensions
exeCtx
 
Constructor Summary
ElementPropertiesExtensions()
           
 
Method Summary
protected  java.util.Map<java.lang.String,java.lang.Object> getDefault(java.lang.Object o)
           
 java.lang.Object getProperty(java.lang.Object element, java.lang.String name)
           
static void setLegacyMode(boolean enable)
          Deprecated. This feature is only for backward compatibility and will be removed in future versions
 void setProperty(java.lang.Object element, java.lang.String name, java.lang.Object value)
           
 
Methods inherited from class org.eclipse.xtend.util.stdlib.AbstractStatefulExtensions
get, getKey, getVars, newMap, set, setExecutionContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementPropertiesExtensions

public ElementPropertiesExtensions()
Method Detail

setLegacyMode

@Deprecated
public static void setLegacyMode(boolean enable)
Deprecated. This feature is only for backward compatibility and will be removed in future versions

As reported with Bug#310361 this extension was causing memory leaks due to holding the properties in a static map. This was refactored by deriving from AbstractStatefulExtensions, which stores properties in the ExecutionContext. But since there are known Xpand generators that rely on the static nature of these properties, which needs to be preserved over workflow executions, the old implementation is preserved. By setting legacy mode, the properties will again be stored in a static map. Unsetting legacy mode will remove the static map and thus free memory again.


getDefault

protected java.util.Map<java.lang.String,java.lang.Object> getDefault(java.lang.Object o)
Overrides:
getDefault in class AbstractStatefulExtensions<java.util.Map<java.lang.String,java.lang.Object>>

setProperty

public void setProperty(java.lang.Object element,
                        java.lang.String name,
                        java.lang.Object value)

getProperty

public java.lang.Object getProperty(java.lang.Object element,
                                    java.lang.String name)