Class LinkUtil
- java.lang.Object
-
- net.officefloor.compile.impl.util.LinkUtil
-
public class LinkUtil extends java.lang.ObjectUtility class to work with links.- Author:
- Daniel Sagenschneider
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends LinkFlowNode>
TfindFurtherestTarget(LinkFlowNode link, java.lang.Class<T> targetType, CompilerIssues issues)Finds the furtherest target link by the specified type.static <T extends LinkFlowNode>
TfindTarget(LinkFlowNode link, java.lang.Class<T> targetType, CompilerIssues issues)Finds the target link by the specified type.static <T extends Node>
TfindTarget(LinkPoolNode link, java.lang.Class<T> targetType, CompilerIssues issues)Finds the target by the specified type.static <T extends Node>
TfindTarget(LinkTeamNode link, java.lang.Class<T> targetType, CompilerIssues issues)Finds the target link by the specified type.static <T extends Node>
T[]findTargets(LinkStartAfterNode link, java.lang.Class<T> targetType, CompilerIssues issues)Finds the targets by the specified type.static <T extends Node>
T[]findTargets(LinkStartBeforeNode link, java.lang.Class<T> targetType, CompilerIssues issues)Finds the targets by the specified type.static booleanlinkAutoWireObjectNode(LinkObjectNode node, LinkObjectNode linkNode, OfficeNode office, AutoWirer<LinkObjectNode> autoWirer, CompileContext compileContext, CompilerIssues issues, java.util.function.Consumer<LinkObjectNode> loader)Links theAutoWireLinkObjectNode.static booleanlinkAutoWireStartAfter(java.lang.Object managedObjectSource, java.lang.String managedObjectType, CompilerIssues issues, Node node)Links theManagedObjectSourceNodeto start afterManagedObjectobject type.static booleanlinkAutoWireStartBefore(java.lang.Object managedObjectSource, java.lang.String managedObjectType, CompilerIssues issues, Node node)Links theManagedObjectSourceNodeto start beforeManagedObjectobject type.static booleanlinkExecutionStrategy(java.lang.Object linkSource, java.lang.Object linkTarget, CompilerIssues issues, Node node)Ensure both inputs are aLinkExecutionStrategyNodeand if so links them.static booleanlinkExecutionStrategyNode(LinkExecutionStrategyNode node, LinkExecutionStrategyNode linkNode, CompilerIssues issues, java.util.function.Consumer<LinkExecutionStrategyNode> loader)Links theLinkExecutionStrategyNode.static booleanlinkFlow(java.lang.Object linkSource, java.lang.Object linkTarget, CompilerIssues issues, Node node)Ensures both inputs are aLinkFlowNodeand if so links them.static booleanlinkFlowNode(LinkFlowNode node, LinkFlowNode linkNode, CompilerIssues issues, java.util.function.Consumer<LinkFlowNode> loader)Links theLinkFlowNode.static booleanlinkManagedObjectSourceInput(java.lang.Object managedObjectSource, java.lang.Object inputManagedObject, CompilerIssues issues, Node node)Links theManagedObjectSourceNodeto theInputManagedObjectNode.static booleanlinkObject(java.lang.Object linkSource, java.lang.Object linkTarget, CompilerIssues issues, Node node)Ensures both inputs are aLinkObjectNodeand if so links them.static booleanlinkObjectNode(LinkObjectNode node, LinkObjectNode linkNode, CompilerIssues issues, java.util.function.Consumer<LinkObjectNode> loader)Links theLinkObjectNode.static booleanlinkOffice(java.lang.Object linkSource, java.lang.Object linkTarget, CompilerIssues issues, Node node)Ensures both inputs are aLinkOfficeNodeand if so links them.static booleanlinkOfficeNode(LinkOfficeNode node, LinkOfficeNode linkNode, CompilerIssues issues, java.util.function.Consumer<LinkOfficeNode> loader)Links theLinkOfficeNode.static booleanlinkPool(java.lang.Object linkSource, java.lang.Object linkTarget, CompilerIssues issues, Node node)Ensures both inputs are aLinkPoolNodeand if so links them.static booleanlinkPoolNode(LinkPoolNode node, LinkPoolNode linkNode, CompilerIssues issues, java.util.function.Consumer<LinkPoolNode> loader)Links theLinkPoolNode.static booleanlinkStartAfter(java.lang.Object startLater, java.lang.Object startEarlier, CompilerIssues issues, Node node)Links theManagedObjectSourceNodeto start after anotherManagedObjectSourceNode.static booleanlinkStartBefore(java.lang.Object startEarlier, java.lang.Object startLater, CompilerIssues issues, Node node)Links theManagedObjectSourceNodeto start before anotherManagedObjectSourceNode.static booleanlinkTeam(java.lang.Object linkSource, java.lang.Object linkTarget, CompilerIssues issues, Node node)Ensures both inputs are aLinkTeamNodeand if so links them.static booleanlinkTeamNode(LinkTeamNode node, LinkTeamNode linkNode, CompilerIssues issues, java.util.function.Consumer<LinkTeamNode> loader)Links theLinkObjectNode.static voidloadAllObjectAutoWires(LinkObjectNode node, java.util.Set<AutoWire> allAutoWires, CompileContext compileContext, CompilerIssues issues)Loads theAutoWireinstances for theLinkObjectNodealong with its dependencyAutoWireinstances and subsequent (transitive) dependencyAutoWireinstances.static <T extends LinkObjectNode>
TretrieveFurtherestTarget(LinkObjectNode link, java.lang.Class<T> targetType, CompilerIssues issues)Finds the furtherest target link by the specified type.static <T extends Node>
TretrieveTarget(LinkExecutionStrategyNode link, java.lang.Class<T> targetType, CompilerIssues issues)Retrieves the target link by the specified type.static <T extends LinkFlowNode>
TretrieveTarget(LinkFlowNode link, java.lang.Class<T> targetType, CompilerIssues issues)Retrieves the target link by the specified type.static <T extends LinkObjectNode>
TretrieveTarget(LinkObjectNode link, java.lang.Class<T> targetType, CompilerIssues issues)Retrieves the target link by the specified type.static <T extends Node>
TretrieveTarget(LinkOfficeNode link, java.lang.Class<T> targetType, CompilerIssues issues)Retrieves the target link by the specified type.
-
-
-
Method Detail
-
linkFlow
public static boolean linkFlow(java.lang.Object linkSource, java.lang.Object linkTarget, CompilerIssues issues, Node node)Ensures both inputs are aLinkFlowNodeand if so links them.- Parameters:
linkSource- SourceLinkFlowNode.linkTarget- TargetLinkFlowNode.issues-CompilerIssues.node-Nodewishing to link theFlow.- Returns:
trueif linked.
-
linkObject
public static boolean linkObject(java.lang.Object linkSource, java.lang.Object linkTarget, CompilerIssues issues, Node node)Ensures both inputs are aLinkObjectNodeand if so links them.- Parameters:
linkSource- SourceLinkObjectNode.linkTarget- TargetLinkObjectNode.issues-CompilerIssues.node-Nodewishing to link theFlow.- Returns:
trueif linked.
-
linkTeam
public static boolean linkTeam(java.lang.Object linkSource, java.lang.Object linkTarget, CompilerIssues issues, Node node)Ensures both inputs are aLinkTeamNodeand if so links them.- Parameters:
linkSource- SourceLinkTeamNode.linkTarget- TargetLinkTeamNode.issues-CompilerIssues.node-Nodewishing to link theFlow.- Returns:
trueif linked.
-
linkExecutionStrategy
public static boolean linkExecutionStrategy(java.lang.Object linkSource, java.lang.Object linkTarget, CompilerIssues issues, Node node)Ensure both inputs are aLinkExecutionStrategyNodeand if so links them.- Parameters:
linkSource- SourceLinkExecutionStrategyNode.linkTarget- TargetLinkExecutionStrategyNode.issues-CompilerIssues.node-Nodewishing to link theExecutionStrategy.- Returns:
trueif linked.
-
linkOffice
public static boolean linkOffice(java.lang.Object linkSource, java.lang.Object linkTarget, CompilerIssues issues, Node node)Ensures both inputs are aLinkOfficeNodeand if so links them.- Parameters:
linkSource- SourceLinkOfficeNode.linkTarget- TargetLinkOfficeNode.issues-CompilerIssues.node-Nodewishing to link theFlow.- Returns:
trueif linked.
-
linkPool
public static boolean linkPool(java.lang.Object linkSource, java.lang.Object linkTarget, CompilerIssues issues, Node node)Ensures both inputs are aLinkPoolNodeand if so links them.- Parameters:
linkSource- SourceLinkPoolNode.linkTarget- TargetLinkPoolNode.issues-CompilerIssues.node-Nodewishing to link theManagedObjectPool.- Returns:
trueif linked.
-
linkManagedObjectSourceInput
public static boolean linkManagedObjectSourceInput(java.lang.Object managedObjectSource, java.lang.Object inputManagedObject, CompilerIssues issues, Node node)Links theManagedObjectSourceNodeto theInputManagedObjectNode.- Parameters:
managedObjectSource-ManagedObjectSourceNode.inputManagedObject-InputManagedObjectNode.issues-CompilerIssues.node-Nodewishing to link theFlow.- Returns:
trueif linked.
-
linkStartBefore
public static boolean linkStartBefore(java.lang.Object startEarlier, java.lang.Object startLater, CompilerIssues issues, Node node)Links theManagedObjectSourceNodeto start before anotherManagedObjectSourceNode.- Parameters:
startEarlier-ManagedObjectSourceNodeto start earlier.startLater-ManagedObjectSourceNodeto start later.issues-CompilerIssues.node-Nodewishing to link the start before.- Returns:
trueif linked.
-
linkAutoWireStartBefore
public static boolean linkAutoWireStartBefore(java.lang.Object managedObjectSource, java.lang.String managedObjectType, CompilerIssues issues, Node node)Links theManagedObjectSourceNodeto start beforeManagedObjectobject type.- Parameters:
managedObjectSource-ManagedObjectSourceNodeto start earlier.managedObjectType-ManagedObjectobject type to start later.issues-CompilerIssues.node-Nodewishing to link the start before.- Returns:
trueif linked.
-
linkStartAfter
public static boolean linkStartAfter(java.lang.Object startLater, java.lang.Object startEarlier, CompilerIssues issues, Node node)Links theManagedObjectSourceNodeto start after anotherManagedObjectSourceNode.- Parameters:
startLater-ManagedObjectSourceNodeto start later.startEarlier-ManagedObjectSourceNodeto start earlier.issues-CompilerIssues.node-Nodewishing to link the start before.- Returns:
trueif linked.
-
linkAutoWireStartAfter
public static boolean linkAutoWireStartAfter(java.lang.Object managedObjectSource, java.lang.String managedObjectType, CompilerIssues issues, Node node)Links theManagedObjectSourceNodeto start afterManagedObjectobject type.- Parameters:
managedObjectSource-ManagedObjectSourceNodeto start later.managedObjectType-ManagedObjectobject type to start earlier.issues-CompilerIssues.node-Nodewishing to link the start before.- Returns:
trueif linked.
-
findFurtherestTarget
public static <T extends LinkFlowNode> T findFurtherestTarget(LinkFlowNode link, java.lang.Class<T> targetType, CompilerIssues issues)
Finds the furtherest target link by the specified type.- Type Parameters:
T- Target type.- Parameters:
link- StartingLinkFlowNode.targetType- TargetLinkFlowNodetype to find.issues-CompilerIssues.- Returns:
- Furtherest target
LinkFlowNodeornullif no targets found.
-
retrieveFurtherestTarget
public static <T extends LinkObjectNode> T retrieveFurtherestTarget(LinkObjectNode link, java.lang.Class<T> targetType, CompilerIssues issues)
Finds the furtherest target link by the specified type.- Type Parameters:
T- Target type.- Parameters:
link- StartingLinkObjectNode.targetType- TargetLinkObjectNodetype to find.issues-CompilerIssues.- Returns:
- Furthurest target
LinkObjectNodeornullif no targets found.
-
findTarget
public static <T extends LinkFlowNode> T findTarget(LinkFlowNode link, java.lang.Class<T> targetType, CompilerIssues issues)
Finds the target link by the specified type.- Type Parameters:
T- Target type.- Parameters:
link- StartingLinkFlowNode.targetType- TargetLinkFlowNodetype to find.issues-CompilerIssues.- Returns:
- Target
LinkFlowNodeornullif target not found.
-
retrieveTarget
public static <T extends LinkFlowNode> T retrieveTarget(LinkFlowNode link, java.lang.Class<T> targetType, CompilerIssues issues)
Retrieves the target link by the specified type.- Type Parameters:
T- Target type.- Parameters:
link- StartingLinkFlowNode.targetType- TargetLinkFlowNodetype to retrieve.issues-CompilerIssues.- Returns:
- Target
LinkFlowNodeornullif issue obtaining which is reported to theCompilerIssues.
-
retrieveTarget
public static <T extends LinkObjectNode> T retrieveTarget(LinkObjectNode link, java.lang.Class<T> targetType, CompilerIssues issues)
Retrieves the target link by the specified type.- Type Parameters:
T- Target type.- Parameters:
link- StartingLinkObjectNode.targetType- TargetLinkObjectNodetype to retrieve.issues-CompilerIssues.- Returns:
- Target
LinkObjectNodeornullif issue obtaining which is reported to theCompilerIssues.
-
findTarget
public static <T extends Node> T findTarget(LinkTeamNode link, java.lang.Class<T> targetType, CompilerIssues issues)
Finds the target link by the specified type.- Type Parameters:
T- Target type.- Parameters:
link- StartingLinkTeamNode.targetType- TargetLinkTeamNodetype to retrieve.issues-CompilerIssues.- Returns:
- Target
LinkTeamNodeornullif not found.
-
retrieveTarget
public static <T extends Node> T retrieveTarget(LinkExecutionStrategyNode link, java.lang.Class<T> targetType, CompilerIssues issues)
Retrieves the target link by the specified type.- Type Parameters:
T- Target type.- Parameters:
link- StartingLinkExecutionStrategyNode.targetType- TargetLinkExecutionStrategyNodetype to retrieve.issues-CompilerIssues.- Returns:
- Target
LinkExecutionStrategyNodeornullif issue obtaining which is reported to theCompilerIssues.
-
retrieveTarget
public static <T extends Node> T retrieveTarget(LinkOfficeNode link, java.lang.Class<T> targetType, CompilerIssues issues)
Retrieves the target link by the specified type.- Type Parameters:
T- Target type.- Parameters:
link- StartingLinkOfficeNode.targetType- TargetLinkOfficeNodetype to retrieve.issues-CompilerIssues.- Returns:
- Target
LinkOfficeNodeornullif issue obtaining which is reported to theCompilerIssues.
-
findTarget
public static <T extends Node> T findTarget(LinkPoolNode link, java.lang.Class<T> targetType, CompilerIssues issues)
Finds the target by the specified type.- Type Parameters:
T- Target type.- Parameters:
link- StartingLinkPoolNode.targetType- TargetLinkPoolNodetype to retrieve.issues-CompilerIssues.- Returns:
- Target
LinkPoolNodeornullif target not found.
-
findTargets
public static <T extends Node> T[] findTargets(LinkStartBeforeNode link, java.lang.Class<T> targetType, CompilerIssues issues)
Finds the targets by the specified type.- Type Parameters:
T- Target type.- Parameters:
link- StartingLinkStartBeforeNode.targetType- TargetLinkStartBeforeNodetype to retrieve.issues-CompilerIssues.- Returns:
- Target
LinkStartBeforeNodetargets found.
-
findTargets
public static <T extends Node> T[] findTargets(LinkStartAfterNode link, java.lang.Class<T> targetType, CompilerIssues issues)
Finds the targets by the specified type.- Type Parameters:
T- Target type.- Parameters:
link- StartingLinkStartAfterNode.targetType- TargetLinkStartAfterNodetype to retrieve.issues-CompilerIssues.- Returns:
- Target
LinkStartAfterNodetargets found.
-
linkFlowNode
public static boolean linkFlowNode(LinkFlowNode node, LinkFlowNode linkNode, CompilerIssues issues, java.util.function.Consumer<LinkFlowNode> loader)
Links theLinkFlowNode.- Parameters:
node-LinkFlowNodeto have the link loaded.linkNode- LinkLinkFlowNodeto load.issues-CompilerIssues.loader-Consumerto load the link onto theLinkFlowNode.- Returns:
trueif successful, orfalsewith issue reported to theCompilerIssues.
-
linkObjectNode
public static boolean linkObjectNode(LinkObjectNode node, LinkObjectNode linkNode, CompilerIssues issues, java.util.function.Consumer<LinkObjectNode> loader)
Links theLinkObjectNode.- Parameters:
node-LinkObjectNodeto have the link loaded.linkNode- LinkLinkObjectNodeto load.issues-CompilerIssues.loader-Consumerto load the link onto theLinkObjectNode.- Returns:
trueif successful, orfalsewith issue reported to theCompilerIssues.
-
linkAutoWireObjectNode
public static boolean linkAutoWireObjectNode(LinkObjectNode node, LinkObjectNode linkNode, OfficeNode office, AutoWirer<LinkObjectNode> autoWirer, CompileContext compileContext, CompilerIssues issues, java.util.function.Consumer<LinkObjectNode> loader)
Links theAutoWireLinkObjectNode.- Parameters:
node-LinkObjectNodeto have the link loaded.linkNode- LinkLinkObjectNodeto load.office-OfficeNode.autoWirer-AutoWirerto enable dependencies to be auto-wired.compileContext-CompileContext.issues-CompilerIssues.loader-Consumerto load the link onto theLinkObjectNode.- Returns:
trueif successful, orfalsewith issue reported to theCompilerIssues.
-
loadAllObjectAutoWires
public static void loadAllObjectAutoWires(LinkObjectNode node, java.util.Set<AutoWire> allAutoWires, CompileContext compileContext, CompilerIssues issues)
Loads theAutoWireinstances for theLinkObjectNodealong with its dependencyAutoWireinstances and subsequent (transitive) dependencyAutoWireinstances.- Parameters:
node-LinkObjectNodeto load transitive dependencyAutoWireinstances.allAutoWires-Setto be loaded with all theAutoWireinstances.compileContext-CompileContextissues-CompilerIssues.
-
linkTeamNode
public static boolean linkTeamNode(LinkTeamNode node, LinkTeamNode linkNode, CompilerIssues issues, java.util.function.Consumer<LinkTeamNode> loader)
Links theLinkObjectNode.- Parameters:
node-LinkTeamNodeto have the link loaded.linkNode- LinkLinkTeamNodeto load.issues-CompilerIssues.loader-Consumerto load the link onto theLinkTeamNode.- Returns:
trueif successful, orfalsewith issue reported to theCompilerIssues.
-
linkExecutionStrategyNode
public static boolean linkExecutionStrategyNode(LinkExecutionStrategyNode node, LinkExecutionStrategyNode linkNode, CompilerIssues issues, java.util.function.Consumer<LinkExecutionStrategyNode> loader)
Links theLinkExecutionStrategyNode.- Parameters:
node-LinkExecutionStrategyNodeto have the link loaded.linkNode-LinkExecutionStrategyNodeto load.issues-CompilerIssues.loader-Consumerto load the link onto theLinkExecutionStrategyNode.- Returns:
trueif successful, orfalsewith issue reported to theCompilerIssues.
-
linkOfficeNode
public static boolean linkOfficeNode(LinkOfficeNode node, LinkOfficeNode linkNode, CompilerIssues issues, java.util.function.Consumer<LinkOfficeNode> loader)
Links theLinkOfficeNode.- Parameters:
node-LinkOfficeNodeto have the link loaded.linkNode- LinkLinkOfficeNodeto load.issues-CompilerIssues.loader-Consumerto load the link on theLinkOfficeNode.- Returns:
trueif successful, orfalsewith issue reported to theCompilerIssues.
-
linkPoolNode
public static boolean linkPoolNode(LinkPoolNode node, LinkPoolNode linkNode, CompilerIssues issues, java.util.function.Consumer<LinkPoolNode> loader)
Links theLinkPoolNode.- Parameters:
node-LinkPoolNodeto have the link loaded.linkNode- LinkLinkPoolNodeto load.issues-CompilerIssues.loader-Consumerto load the link on theLinkPoolNode.- Returns:
trueif successful, orfalsewith issue reported to theCompilerIssues.
-
-