public Serializer(Serialization serialization, Emitable emitter, Resolver resolver, DumperOptions opts, @Nullable Tag rootTag) { this.serialization = serialization; this.emitter = EmitableWrapper.wrap(emitter); this.resolver = resolver; this.explicitStart = opts.isExplicitStart(); this.explicitEnd = opts.isExplicitEnd(); if (opts.getVersion() != null) { this.useVersion = opts.getVersion(); } this.useTags = opts.getTags(); this.serializedNodes = new HashSet<>(50); this.anchors = new HashMap<>(10); this.anchorGenerator = opts.getAnchorGenerator(); this.closed = null; this.explicitRoot = rootTag; }
public Serializer(Emitable emitter, Resolver resolver, DumperOptions opts, Tag rootTag) { this.emitter = emitter; this.resolver = resolver; this.explicitStart = opts.isExplicitStart(); this.explicitEnd = opts.isExplicitEnd(); if (opts.getVersion() != null) { this.useVersion = opts.getVersion(); } this.useTags = opts.getTags(); this.serializedNodes = new HashSet<Node>(); this.anchors = new HashMap<Node, String>(); this.anchorGenerator = opts.getAnchorGenerator(); this.closed = null; this.explicitRoot = rootTag; }
public Serializer(Serialization serialization, Emitable emitter, Resolver resolver, DumperOptions opts, @Nullable Tag rootTag) { this.serialization = serialization; this.emitter = EmitableWrapper.wrap(emitter); this.resolver = resolver; this.explicitStart = opts.isExplicitStart(); this.explicitEnd = opts.isExplicitEnd(); if (opts.getVersion() != null) { this.useVersion = opts.getVersion(); } this.useTags = opts.getTags(); this.serializedNodes = new HashSet<>(50); this.anchors = new HashMap<>(10); // compatibility if (! hasAnchorGenerator) { this.anchorGenerator = new NumberAnchorGenerator(); } else { Object anchorGenerator = opts.getAnchorGenerator(); this.anchorGenerator = ((org.yaml.snakeyaml.serializer.AnchorGenerator) anchorGenerator)::nextAnchor; } this.closed = null; this.explicitRoot = rootTag; }
static EmitableWrapper wrap(Emitable emitable) { if (emitable instanceof EmitableWrapper) { return (EmitableWrapper) emitable; } if (emitable instanceof Emitter) { return new EmitterWrapper((Emitter) emitable); } return new UnknownEmitableWrapper(emitable); }
public Serializer(Emitable emitter, Resolver resolver, DumperOptions opts, Tag rootTag) { this.emitter = emitter; this.resolver = resolver; this.explicitStart = opts.isExplicitStart(); this.explicitEnd = opts.isExplicitEnd(); if (opts.getVersion() != null) { this.useVersion = opts.getVersion(); } this.useTags = opts.getTags(); this.serializedNodes = new HashSet<Node>(); this.anchors = new HashMap<Node, String>(); this.lastAnchorId = 0; this.closed = null; this.explicitRoot = rootTag; }
public Serializer(final Emitable emitter, final Resolver resolver, final DumperOptions opts, final Tag rootTag) { this.emitter = emitter; this.resolver = resolver; this.explicitStart = opts.isExplicitStart(); this.explicitEnd = opts.isExplicitEnd(); if (opts.getVersion() != null) { this.useVersion = opts.getVersion(); } this.useTags = opts.getTags(); this.serializedNodes = new HashSet<Node>(); this.anchors = new HashMap<Node, String>(); this.lastAnchorId = 0; this.closed = null; this.explicitRoot = rootTag; }
UnknownEmitableWrapper(Emitable emitable) { this.emitable = emitable; }