Class AutoWirerImpl<N extends Node>
java.lang.Object
net.officefloor.compile.impl.structure.AutoWirerImpl<N>
- All Implemented Interfaces:
AutoWirer<N>
AutoWirer implementation.- Author:
- Daniel Sagenschneider
-
Constructor Summary
ConstructorsConstructorDescriptionAutoWirerImpl(SourceContext context, CompilerIssues issues, AutoWireDirection direction) Instantiate. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAutoWireTarget(Function<OfficeNode, ? extends N> targetNodeFactory, AutoWire... targetAutoWires) Adds anAutoWiretarget for selection.voidaddAutoWireTarget(N targetNode, AutoWire... targetAutoWires) Adds anAutoWiretarget for selection.<S extends Node>
AutoWireLink<S,N>[] findAutoWireLinks(S sourceNode, AutoWire... sourceAutoWires) Selects the appropriateAutoWireLinkinstances, and does not flag issue if no matchingAutoWireLinkis found.<S extends Node>
AutoWireLink<S,N> getAutoWireLink(S sourceNode, AutoWire... sourceAutoWires) Selects the appropriateAutoWireLinkinstance.<S extends Node>
AutoWireLink<S,N>[] getAutoWireLinks(S sourceNode, AutoWire... sourceAutoWires) Selects the appropriateAutoWireLinkinstances.protected <S extends Node>
AutoWireLink<S,N>[] sourceAutoWireLinks(boolean isMustMatch, boolean isMultipleAllowed, S sourceNode, AutoWire... sourceAutoWires) Sources the auto-wire links.
-
Constructor Details
-
AutoWirerImpl
Instantiate.- Parameters:
context-SourceContext.issues-CompilerIssues.direction-AutoWireDirection.
-
-
Method Details
-
addAutoWireTarget
Description copied from interface:AutoWirerAdds anAutoWiretarget for selection. -
addAutoWireTarget
public void addAutoWireTarget(Function<OfficeNode, ? extends N> targetNodeFactory, AutoWire... targetAutoWires) Description copied from interface:AutoWirerAdds anAutoWiretarget for selection.- Specified by:
addAutoWireTargetin interfaceAutoWirer<N extends Node>- Parameters:
targetNodeFactory-Functionto create the targetNode. This enables dynamically adding the targetNodeonly if it is selected for linking. TheOfficeNodeis available to configure theManagingOfficeNodefor theManagedObjectSourceNode.targetAutoWires- TargetAutoWireinstances supported by theNode.
-
getAutoWireLink
public <S extends Node> AutoWireLink<S,N> getAutoWireLink(S sourceNode, AutoWire... sourceAutoWires) Description copied from interface:AutoWirerSelects the appropriateAutoWireLinkinstance.- Specified by:
getAutoWireLinkin interfaceAutoWirer<N extends Node>- Type Parameters:
S- SourceNodetype.- Parameters:
sourceNode- SourceNodeto link target.sourceAutoWires- SourceAutoWireinstances to match against targetAutoWireinstances.- Returns:
- Matching
AutoWireLinkinstance ornullif no link.
-
findAutoWireLinks
public <S extends Node> AutoWireLink<S,N>[] findAutoWireLinks(S sourceNode, AutoWire... sourceAutoWires) Description copied from interface:AutoWirerSelects the appropriateAutoWireLinkinstances, and does not flag issue if no matchingAutoWireLinkis found.- Specified by:
findAutoWireLinksin interfaceAutoWirer<N extends Node>- Type Parameters:
S- SourceNodetype.- Parameters:
sourceNode- SourceNodeto link target.sourceAutoWires- SourceAutoWireinstances to match against targetAutoWireinstances.- Returns:
- Matching
AutoWireLinkinstances.
-
getAutoWireLinks
public <S extends Node> AutoWireLink<S,N>[] getAutoWireLinks(S sourceNode, AutoWire... sourceAutoWires) Selects the appropriateAutoWireLinkinstances.- Specified by:
getAutoWireLinksin interfaceAutoWirer<N extends Node>- Type Parameters:
S- SourceNodetype.- Parameters:
sourceNode- SourceNodeto link target.sourceAutoWires- SourceAutoWireinstances to match against targetAutoWireinstances.- Returns:
- Matching
AutoWireLinkinstances.
-
sourceAutoWireLinks
protected <S extends Node> AutoWireLink<S,N>[] sourceAutoWireLinks(boolean isMustMatch, boolean isMultipleAllowed, S sourceNode, AutoWire... sourceAutoWires) Sources the auto-wire links.- Type Parameters:
S- Source node type.- Parameters:
isMustMatch- Whether a match is required.isMultipleAllowed- Whether multiple matches are allowed.sourceNode- Source node.sourceAutoWires- SourceAutoWireinstances.- Returns:
AutoWireLinkinstances.
-
createScopeAutoWirer
Description copied from interface:AutoWirerCreates an
AutoWirerfor a new scope that takes priority over existingAutoWiretargets.Targets are first looked for in the returned scoped
AutoWirer. If no matching target is found, then thisAutoWireis checked.- Specified by:
createScopeAutoWirerin interfaceAutoWirer<N extends Node>- Returns:
- Scoped
AutoWirer.
-