Class WikiMacroBinding
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<String,Object>
-
- org.xwiki.rendering.macro.wikibridge.binding.WikiMacroBinding
-
public class WikiMacroBinding extends HashMap<String,Object> implements Bindings
Binding representation for the wikimacros.- Since:
- 11.6RC1, 11.3.2, 10.11.9
- Version:
- $Id: ab280787a97a6168669407e5e0d553316e8b2ebc $
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Constructor Summary
Constructors Constructor Description WikiMacroBinding(org.xwiki.rendering.macro.descriptor.MacroDescriptor descriptor, WikiMacroParameters parameters, String content, org.xwiki.rendering.transformation.MacroTransformationContext transformationContext)
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getContent()
org.xwiki.rendering.transformation.MacroTransformationContext
getContext()
org.xwiki.rendering.macro.descriptor.MacroDescriptor
getDescriptor()
WikiMacroParameters
getParameters()
Object
getResult()
void
replaceAll(WikiMacroBinding wikiMacroBinding)
Replace all the content of the current binding with the given binding.protected void
setContent(String content)
protected void
setContext(org.xwiki.rendering.transformation.MacroTransformationContext context)
protected void
setDescriptor(org.xwiki.rendering.macro.descriptor.MacroDescriptor descriptor)
protected void
setParameters(WikiMacroParameters parameters)
void
setResult(Object result)
Allows to set a result during the execution of the macro, which can be retrieved withgetResult()
.-
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsValue, entrySet, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, putIfAbsent, remove, replace, replace, replaceAll, size, values
-
-
-
-
Constructor Detail
-
WikiMacroBinding
public WikiMacroBinding(org.xwiki.rendering.macro.descriptor.MacroDescriptor descriptor, WikiMacroParameters parameters, String content, org.xwiki.rendering.transformation.MacroTransformationContext transformationContext)
Default constructor.- Parameters:
descriptor
- the macro descriptor to set for the binding.parameters
- the parameters to set for the binding.content
- the input macro content to set for the binding.transformationContext
- the transformation context used for that wikimacro, is null if the transformation is done asynchronously.
-
-
Method Detail
-
getParameters
public WikiMacroParameters getParameters()
- Returns:
- the parameters of the wikimacro.
-
setParameters
protected void setParameters(WikiMacroParameters parameters)
-
getContent
public String getContent()
- Returns:
- the input content of the wikimacro.
-
setContent
protected void setContent(String content)
-
getDescriptor
public org.xwiki.rendering.macro.descriptor.MacroDescriptor getDescriptor()
- Returns:
- the macro descriptor of the wikimacro.
-
setDescriptor
protected void setDescriptor(org.xwiki.rendering.macro.descriptor.MacroDescriptor descriptor)
-
getResult
public Object getResult()
- Returns:
- the result of the wikimacro.
-
setResult
public void setResult(Object result)
Allows to set a result during the execution of the macro, which can be retrieved withgetResult()
.- Parameters:
result
- the result to set.
-
getContext
public org.xwiki.rendering.transformation.MacroTransformationContext getContext()
- Returns:
- the transformation context used for this macro, or null in case of asynchronous transformation.
-
setContext
protected void setContext(org.xwiki.rendering.transformation.MacroTransformationContext context)
-
replaceAll
public void replaceAll(WikiMacroBinding wikiMacroBinding)
Replace all the content of the current binding with the given binding.- Parameters:
wikiMacroBinding
- the macro binding values to use as replacement.- Since:
- 11.6.1, 11.7RC1
-
-