GetterGenerator class abstract
Defines methods for generating getters for representations of types for example:
class XmlTextGetterGenerator extends GetterGenerator {
const XmlTextGetterGenerator();
@override
String generateGetter(String expression) => '$expression.getText()';
}
It is recommended to use a GetterGenerator in combination with a SerializerGenerator for example:
// Deserializes an instance of an int type from the text of an XML element.
buffer.write('final value = ${IntSerializerGenerator().generateDeserializer(XmlTextGetterGenerator().generateGetter('element'))};');
Constructors
- GetterGenerator()
-
Constructs a GetterGenerator.
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
-
generateGetter(
String expression) → String -
Generates code that gets a representation of the type from an
expression
representing anXmlElement
. -
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