ContentResolver<O> class final Types of Tags Lazy Scalar Resolvers

Resolves a Scalar's parsed content and requires the function to return null if mapping fails. This allows the parser to provide a (partial) kind. Avoid throwing within the mapping function.

NOTE: This resolver will be ignored if the tag belongs to a Mapping or Sequence

Inheritance

Constructors

ContentResolver(NodeTag resolvedTag, {required O? resolver(String content), required String toYamlSafe(O object), bool acceptNullAsValue = false})

Properties

acceptNullAsValue bool
Indicates if the null value after calling the resolver function should be treated as a value.
final
hashCode int
The hash code for this object.
no setteroverride
isGeneric bool
Whether this is tag was explicit or assigned by the parser automatically after resolving a node and its tag.
no setteroverride
prefix String
Actual prefix of the tag. This should not be confused with the tagHandle which describes a compact way of representing the prefix. For a GlobalTag or a TagShorthand resolved to a GlobalTag, this is the full prefix aliased by the tagHandle. For an unresolved TagShorthand, this defaults to its tagHandle.
no setteroverride
resolvedTag NodeTag
Underlying NodeTag
final
resolver → O? Function(String content)
Maps the scalar's content.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
suffix TagShorthand?
Represents the TagShorthand suffix resolved to GlobalTag prefix in a YAML source string. Defaults to null if the Tag is a VerbatimTag or a ContentResolver.
no setterinherited
tagHandle TagHandle
Prefix of the tag
no setteroverride
toYamlSafe String Function(O object)
Maps the O object back to a dumpable string.
final
verbatim String
Full representation of a tag. Any SpecificTag can be represented this way even if it is unresolved.
no setteroverride

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override