SocketContribution class final

Code or a value for a socket.

Each way of creating one takes a socket of one kind, so a contribution cannot target a socket that does not take it:

See SocketRef for who may contribute to which sockets.

Order

The pipeline renders the contributions of a socket, and runs every PostGenStep, in an order given by edges between all modules of the app and the templates of its roles:

  1. A module comes after the modules it depends on.
  2. If a module requires a role, or has it in Contribution.when, it comes after the role's providers and the role's template.
  3. A role's template comes after the role's providers, and after the providers and templates of the roles its role requires or has in its Contribution.when.

Two contributors with edges both ways ignore both edges, unless one depends on the other, which then comes after it. A contributor comes after every contributor it reaches through the edges, also through modules that do not contribute to the socket: a module that requires a role comes after the modules the role's provider depends on. Otherwise contributors are ordered by id. A cycle of edges is an error. Phases, such as the start-up phases of the app entry, are separate sockets.

Inheritance

Constructors

SocketContribution.arg(SocketRef<ArgsSocket> socket, String argName, Fragment fragment, {Set<Role<Object>> when = const {}})
Sets the argument argName of an ArgsSocket to the expression fragment, or adds it to a list argument.
const
SocketContribution.code(SocketRef<CodeSocket> socket, Fragment fragment, {Set<Role<Object>> when = const {}})
Adds fragment to a CodeSocket.
const
SocketContribution.item(SocketRef<FactoryListSocket> socket, Fragment fragment, {Set<Role<Object>> when = const {}})
Adds the function expression fragment, such as a factory, to a FactoryListSocket.
const
SocketContribution.wrap(SocketRef<WrapperSocket> socket, Fragment fragment, {Set<Role<Object>> when = const {}})
Adds the wrapper fragment, created with Fragment.wrap, to a WrapperSocket.
const

Properties

argName → String?
The argument name, for an ArgsSocket.
final
entryKey → String?
The key, for a KeyedSocket.
final
entryValue → Object?
The value, for a KeyedSocket or ValueSocket.
final
fragment → Fragment?
The code, for sockets that take fragments.
final
hashCode → int
The hash code for this object.
no setterinherited
origin → ContributionOrigin?
Who contributed it.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
socket → SocketRef<SocketKind>
The socket the contribution is for.
final
when → Set<Role<Object>>
Roles that must all be present for the contribution to apply.
finalinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
withOrigin(ContributionOrigin origin) → SocketContribution
Returns a copy of this contribution contributed by origin.

Operators

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