BuilderGenerator class abstract

Defines methods for generating builders for representations of types for example:

class XmlTextBuilderGenerator extends BuilderGenerator {
  const XmlTextBuilderGenerator();

  @override
  String generateBuilder(String expression, {String builder = 'builder'}) => '$builder.text($expression);';
}

It is recommended to use a BuilderGenerator in combination with a SerializerGenerator for example:

// Builds an XML text with a serialized instance of an int type.
buffer.write(XmlTextBuilderGenerator().generateBuilder(IntSerializerGenerator().generateSerializer('element')));
Implementers

Constructors

BuilderGenerator()
Constructs a BuilderGenerator.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

generateBuilder(String expression, {String builder = 'builder'}) String
Generates code that builds a representation of the type from an expression as an XML attribute / XML element / XML text using a builder.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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