W3cubDocs

/Groovy 3.0

[Java] Interface NodeMetaDataHandler

@SuppressWarnings({"unchecked", "rawtypes"})
public interface NodeMetaDataHandler

An interface to mark a node being able to handle metadata.

Methods Summary

Methods
Type Params Return Type Name and description
public void copyNodeMetaData(NodeMetaDataHandler other)
Copies all node meta data from the other node to this one
public Map<?, ?> getMetaDataMap()
<T> public T getNodeMetaData(Object key)
Gets the node meta data.
<T> public T getNodeMetaData(Object key, Function<?, ? extends T> valFn)
Gets the node meta data.
public Map<?, ?> getNodeMetaData()
Returns an unmodifiable view of the current node metadata.
public Object putNodeMetaData(Object key, Object value)
Sets the node meta data but allows overwriting values.
public void removeNodeMetaData(Object key)
Removes a node meta data entry.
public void setMetaDataMap(Map<?, ?> metaDataMap)
public void setNodeMetaData(Object key, Object value)
Sets the node meta data.

Method Detail

public void copyNodeMetaData(NodeMetaDataHandler other)

Copies all node meta data from the other node to this one

Parameters:
other - the other node

public Map<?, ?> getMetaDataMap()

<T> public T getNodeMetaData(Object key)

Gets the node meta data.

Parameters:
key - the meta data key
Returns:
the node meta data value for this key

<T> public T getNodeMetaData(Object key, Function<?, ? extends T> valFn)

Gets the node meta data.

Parameters:
key - the meta data key
valFn - the meta data value supplier
Returns:
the node meta data value for this key

public Map<?, ?> getNodeMetaData()

Returns an unmodifiable view of the current node metadata.

Returns:
the node metadata. Always not null.

public Object putNodeMetaData(Object key, Object value)

Sets the node meta data but allows overwriting values.

throws:
GroovyBugError if key is null
Parameters:
key - the meta data key
value - the meta data value
Returns:
the old node meta data value for this key

public void removeNodeMetaData(Object key)

Removes a node meta data entry.

throws:
GroovyBugError if the key is null
Parameters:
key - the meta data key

public void setMetaDataMap(Map<?, ?> metaDataMap)

public void setNodeMetaData(Object key, Object value)

Sets the node meta data.

throws:
GroovyBugError if key is null or there is already meta data under that key
Parameters:
key - the meta data key
value - the meta data value

© 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/3.0.7/html/gapi/org/codehaus/groovy/ast/NodeMetaDataHandler.html