Top Description Fields Constructors Methods
org.snakeyaml.engine.v2.serializer

public Class NumberAnchorGenerator

extends Object
implements AnchorGenerator
Class Inheritance
All Implemented Interfaces
org.snakeyaml.engine.v2.serializer.AnchorGenerator
Imports
java.text.NumberFormat, java.util.Locale, org.snakeyaml.engine.v2.common.Anchor, org.snakeyaml.engine.v2.nodes.Node

Simple generate of the format id + number

Field Summary

Modifier and TypeField and Description
private int

Constructor Summary

AccessConstructor and Description
public
NumberAnchorGenerator(int
- the number to start from
lastAnchorId
)

Create

Method Summary

Modifier and TypeMethod and Description
public Anchor

Returns:

unique anchor name or existing anchor name
nextAnchor
(Node
- the data to anchor
node
)

Implements org.snakeyaml.engine.v2.serializer.AnchorGenerator.nextAnchor.

Create the anchor name (increasing the number) or keep the one when it was already created in the node by the low level API

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

lastAnchorIdback to summary
private int lastAnchorId

Constructor Detail

NumberAnchorGeneratorback to summary
public NumberAnchorGenerator(int lastAnchorId)

Create

Parameters
lastAnchorId:int

- the number to start from

Method Detail

nextAnchorback to summary
public Anchor nextAnchor(Node node)

Implements org.snakeyaml.engine.v2.serializer.AnchorGenerator.nextAnchor.

Create the anchor name (increasing the number) or keep the one when it was already created in the node by the low level API

Parameters
node:Node

- the data to anchor

Returns:Anchor

unique anchor name or existing anchor name