Class HookTree


  • public class HookTree
    extends java.lang.Object
    • Method Detail

      • getHookNames

        public static java.lang.Object[] getHookNames​(java.lang.String mode)
        Returns Internal Hook names for a Connector mode. The returned Objects are either Strings, or new Object arrays with Strings or Object arrays. An empty array means no hooks are used in this mode, null means that the mode was unknown.
        Parameters:
        mode - A connector mode
        Returns:
        The hook names for the given mode, or null for an unknown mode.
      • getArrayName

        public static java.lang.String getArrayName​(java.lang.Object element)
        Return the name of an Object[] used for constructing a HookTree.
        Parameters:
        element - really an Object[]
        Returns:
        a String suitable for showing the user.
      • getHookLabel

        public static java.lang.String getHookLabel​(HookConfig hc)
        Return a user friendly label for the given HookConfig.
        Parameters:
        hc -
        Returns:
        a String
      • getHookLabel

        public static java.lang.String getHookLabel​(java.lang.String hookName)
        Return a user friendly label for the given hook name.
        Parameters:
        hookName - - The internal name of the hook.
        Returns:
        The translated String, or the internal name if nothing found.
      • getHookTree

        public static HookTree getHookTree​(ConnectorConfig cc)
        Return a new HookTree for a ConnectorConfig
        Parameters:
        cc - The ConnectorConfig
        Returns:
        a HookTree
      • getHookTree

        public static HookTree getHookTree​(ConnectorConfig cc,
                                           HookTree.Phase phase)
        Return a new HookTree for a ConnectorConfig in a given Phase. Associates the ConnectorConfig with the root of the Tree.
        Parameters:
        cc - The ConnectorConfig
        phase - The Phase
        Returns:
        a HookTree, null if nothing defined for this Phase and mode.
      • getHookTree

        public static HookTree getHookTree​(AssemblyLineConfig alc)
        Return a new HookTree for an AssemblyLineConfig
        Parameters:
        alc - The AssemblyLineConfig
        Returns:
        a HookTree
      • getHookTree

        public static HookTree getHookTree​(HooksConfig hc)
        Return a new HookTree for a HooksConfig. Tries to guess if this is an AssemblyLine or Connector.
        Parameters:
        hc - The HooksConfig
        Returns:
        a HookTree
      • getHookConfig

        public HookConfig getHookConfig​(boolean create)
        Return the HookConfig using the name of this HookTree.
        Parameters:
        create - - If true, create a HookConfig if it does not exist
        Returns:
        The HookConfig, or null if not found and create is false.
      • getHooksConfig

        public HooksConfig getHooksConfig()
        Return the HooksConfig used by this HookTree.
        Returns:
        The HooksConfig.
      • isEnabled

        public boolean isEnabled()
        Returns true if the HookConfig with this name is enabled.
        Returns:
        true if the HookConfig with this name is enabled.
      • setEnabled

        public void setEnabled​(boolean enabled)
        Set the HookConfig with this name to enabled. Creates the HookConfig if needed.
        Parameters:
        enabled -
      • hasChildren

        public boolean hasChildren()
        Returns true is this HookTree has children
        Returns:
        true is this HookTree has children
      • getChildrenArray

        public java.lang.Object[] getChildrenArray()
        Gets the children of this HookTree.
        Returns:
        an array of HookTree, empty if no children
      • getName

        public java.lang.String getName()
        Returns the name of the hook matching this HookTree. If there are no children, this will typically be an internal Hook Name, or input_attribute_map/output_attribute_map. If this HookTree has children, the name will be a user friendly String.
        Returns:
        The name of the hook matching this HookTree
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getConfig

        public ConnectorConfig getConfig()
        Returns the Associated ConnectorConfig
        Returns:
        the Associated ConnectorConfig
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object