Class AutoWirerImpl<N extends Node>
- java.lang.Object
-
- net.officefloor.compile.impl.structure.AutoWirerImpl<N>
-
-
Constructor Summary
Constructors Constructor Description AutoWirerImpl(SourceContext context, CompilerIssues issues, AutoWireDirection direction)
Instantiate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAutoWireTarget(java.util.function.Function<OfficeNode,? extends N> targetNodeFactory, AutoWire... targetAutoWires)
Adds anAutoWire
target for selection.void
addAutoWireTarget(N targetNode, AutoWire... targetAutoWires)
Adds anAutoWire
target for selection.AutoWirer<N>
createScopeAutoWirer()
<S extends Node>
AutoWireLink<S,N>[]findAutoWireLinks(S sourceNode, AutoWire... sourceAutoWires)
Selects the appropriateAutoWireLink
instances, and does not flag issue if no matchingAutoWireLink
is found.<S extends Node>
AutoWireLink<S,N>[]getAutoWireLinks(S sourceNode, AutoWire... sourceAutoWires)
Selects the appropriateAutoWireLink
instances.
-
-
-
Constructor Detail
-
AutoWirerImpl
public AutoWirerImpl(SourceContext context, CompilerIssues issues, AutoWireDirection direction)
Instantiate.- Parameters:
context
-SourceContext
.issues
-CompilerIssues
.direction
-AutoWireDirection
.
-
-
Method Detail
-
addAutoWireTarget
public void addAutoWireTarget(N targetNode, AutoWire... targetAutoWires)
Description copied from interface:AutoWirer
Adds anAutoWire
target for selection.
-
addAutoWireTarget
public void addAutoWireTarget(java.util.function.Function<OfficeNode,? extends N> targetNodeFactory, AutoWire... targetAutoWires)
Description copied from interface:AutoWirer
Adds anAutoWire
target for selection.- Specified by:
addAutoWireTarget
in interfaceAutoWirer<N extends Node>
- Parameters:
targetNodeFactory
-Function
to create the targetNode
. This enables dynamically adding the targetNode
only if it is selected for linking. TheOfficeNode
is available to configure theManagingOfficeNode
for theManagedObjectSourceNode
.targetAutoWires
- TargetAutoWire
instances supported by theNode
.
-
findAutoWireLinks
public <S extends Node> AutoWireLink<S,N>[] findAutoWireLinks(S sourceNode, AutoWire... sourceAutoWires)
Description copied from interface:AutoWirer
Selects the appropriateAutoWireLink
instances, and does not flag issue if no matchingAutoWireLink
is found.- Specified by:
findAutoWireLinks
in interfaceAutoWirer<N extends Node>
- Type Parameters:
S
- SourceNode
type.- Parameters:
sourceNode
- SourceNode
to link target.sourceAutoWires
- SourceAutoWire
instances to match against targetAutoWire
instances.- Returns:
- Matching
AutoWireLink
instances.
-
getAutoWireLinks
public <S extends Node> AutoWireLink<S,N>[] getAutoWireLinks(S sourceNode, AutoWire... sourceAutoWires)
Description copied from interface:AutoWirer
Selects the appropriateAutoWireLink
instances.- Specified by:
getAutoWireLinks
in interfaceAutoWirer<N extends Node>
- Type Parameters:
S
- SourceNode
type.- Parameters:
sourceNode
- SourceNode
to link target.sourceAutoWires
- SourceAutoWire
instances to match against targetAutoWire
instances.- Returns:
- Matching
AutoWireLink
instances.
-
createScopeAutoWirer
public AutoWirer<N> createScopeAutoWirer()
Description copied from interface:AutoWirer
Creates an
AutoWirer
for a new scope that takes priority over existingAutoWire
targets.Targets are first looked for in the returned scoped
AutoWirer
. If no matching target is found, then thisAutoWire
is checked.- Specified by:
createScopeAutoWirer
in interfaceAutoWirer<N extends Node>
- Returns:
- Scoped
AutoWirer
.
-
-