### *** This class provides Binary Compatibility only, not Source Compatibility ***

Package com.sas.services.information

# Class FactoryAction

java.lang.Object
com.sas.services.information.FactoryAction

All Implemented Interfaces:
  `ConsumedResourceInterface`, `Serializable`, `Cloneable`, `Comparator<FactoryAction>`

@SASScope("ALL") @BinaryCompatibilityOnly public final class FactoryAction extends Object implements Cloneable, Comparator<FactoryAction>, ConsumedResourceInterface, Serializable
An Information Service factory's action (type, class name, and optionally method name) and optional filter. This class is intended for use by the com.sas.services.information package, and is likely not useful by external clients.

The syntax of the entry is as follows...

`ctor::<fully qualified java class name>` `service::<fully qualified java class name>::<method name>` `class::<fully qualified java class name>::<method name>`

Since:
  1.0
See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `TYPE_CLASS`
  Action type: class.
  `static final String`
  `TYPE_CONSTRUCTOR`
  Action type: constructor.
  `static final String`
  `TYPE_SERVICE`
  Action type: service.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FactoryAction()`
  Constructs a default instance.
  `FactoryAction(String action, String filter)`
  Constructs an instance for the specified action and filter.
  `FactoryAction(String uid, String action, String filter)`
  Constructs an instance for the specified action and filter.
  `FactoryAction(String actionType, String actionClassName, String actionMethodName, String filter)`
  Constructs a factory action based upon its constituent components: action type fully qualified java class name
  `FactoryAction(String uid, String actionType, String actionClassName, String actionMethodName, String filter)`
  Constructs a factory action based upon its constituent components: action type fully qualified java class name
  `FactoryAction(Element element)`
  Constructs a factory action by parsing a "Type" XML Element.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `clone()`
  Clones the resource.
  `int`
  `compare(FactoryAction o1, FactoryAction o2)`
  `boolean`
  `equals(Object otherAction)`
  Determines if the other factory action is equivalent to this factory action.
  `String`
  `getAction()`
  Gets an Information Service action string based upon the currently defined type, class, and method.
  `String`
  `getActionClassName()`
  Gets the action's class name.
  `String`
  `getActionMethodName()`
  Gets the action's method name.
  `String`
  `getActionType()`
  Gets the action's type: class constructor method
  `String`
  `getFilter()`
  `String`
  `getID()`
  `String`
  `getLocalizedResourceType()`
  Gets a localized value describing the resource's type.
  `String`
  `getLocalizedResourceTypeAndValue()`
  Gets a localized value describing the resource's type and value.
  `String`
  `getResourceID()`
  Gets the id that uniquely identifies the resource within a service's configuration.
  `String`
  `getResourceType()`
  Gets a value describing the resource's type.
  `int`
  `getResourceTypeCode()`
  Gets the code describing the resource's type.
  `String`
  `getResourceValue()`
  Gets the value for this factory action.
  `static String[][]`
  `getValidActionTypes()`
  Gets an array of string values representing valid factory action types and an accompanying localized description suitable for use in a choice user interface component.
  `int`
  `hashCode()`
  Gets a hash code based upon this object's attributes.
  `static boolean`
  `isMethodEnabled(String type)`
  Determines whether or not the action's method is enabled for the specified type of action.
  `boolean`
  `isRequired()`
  Determines if this resource is required by the service's configuration.
  `static boolean`
  `isValidType(String type)`
  Determines whether or not the specified Information Service factory type is valid.
  `void`
  `setAction(String action)`
  Sets the factory's action.
  `void`
  `setAction(String actionType, String actionClassName, String actionMethodName, String actionFilter)`
  Sets the action's class name.
  `void`
  `setActionClassName(String actionClassName)`
  Sets the factory action's class name.
  `void`
  `setActionMethodName(String actionMethodName)`
  Sets the factory action's method name.
  `void`
  `setActionType(String actionType)`
  `void`
  `setFilter(String filter)`
  Sets the factory action's filter.
  `void`
  `setFilter(String filter, boolean isValidating)`
  Sets the factory action's filter.
  `String`
  `toString()`
  Gets a string representation of this factory action.
  `void`
  `validate()`
  Validates the factory action.

  ### Methods inherited from class java.lang.Object

  `finalize, getClass, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface java.util.Comparator

  `reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong`

- ## Field Details

  - ### TYPE_CLASS

    public static final String TYPE_CLASS
    Action type: class.
    See Also:
      - Constant Field Values

  - ### TYPE_CONSTRUCTOR

    public static final String TYPE_CONSTRUCTOR
    Action type: constructor.
    See Also:
      - Constant Field Values

  - ### TYPE_SERVICE

    public static final String TYPE_SERVICE
    Action type: service.
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### FactoryAction

    public FactoryAction()
    Constructs a default instance.

  - ### FactoryAction

    public FactoryAction(String action, String filter)
    Constructs an instance for the specified action and filter.
    Parameters:
      `action` - Action
      `filter` - Filter

  - ### FactoryAction

    public FactoryAction(String uid, String action, String filter)
    Constructs an instance for the specified action and filter.
    Parameters:
      `uid` - Unique identifier or `null` if an ID should be generated.
      `action` - Action
      `filter` - Filter

  - ### FactoryAction

    public FactoryAction(String actionType, String actionClassName, String actionMethodName, String filter)
    Constructs a factory action based upon its constituent components:
    - action type
    - fully qualified java class name
    Parameters:
      `actionType` - Action's type. Valid action types are:
      - `ctor`
      - `constructor`
      - `service`
      `actionClassName` - Fully qualified Java class name.
      `actionMethodName` - Optional method name for use with an action type of `service`.
      `filter` - A filter string used to select the correct action for an object.

  - ### FactoryAction

    public FactoryAction(Element element)
    Constructs a factory action by parsing a "Type" XML Element.
    Parameters:
      `element` - XML "Type" Element that represents an Information Service factory action.
    Throws:
      `IllegalArgumentException` - if an invalid parameter is specified.

  - ### FactoryAction

    public FactoryAction(String uid, String actionType, String actionClassName, String actionMethodName, String filter)
    Constructs a factory action based upon its constituent components:
    - action type
    - fully qualified java class name
    Parameters:
      `uid` - Unique identifier or `null` if an ID should be generated.
      `actionType` - Action's type. Valid action types are:
      - `ctor`
      - `constructor`
      - `service`
      `actionClassName` - Fully qualified Java class name.
      `actionMethodName` - Optional method name for use with an action type of `service`.
      `filter` - Optional filter.

- ## Method Details

  - ### getID

    public String getID()

  - ### getAction

    public String getAction()
    Gets an Information Service action string based upon the currently defined type, class, and method.
    Returns:
      Information Service action.

  - ### setAction

    public void setAction(String action)
    Sets the factory's action.
    Parameters:
      `action` - Factory's action.

  - ### setAction

    public void setAction(String actionType, String actionClassName, String actionMethodName, String actionFilter) throws IllegalArgumentException
    Sets the action's class name.
    Parameters:
      `actionType` - The type of action to take: "ctor", "constructor", "service".
      `actionClassName` - Action's fully qualified java class name.
      `actionMethodName` - If the action is "service", the service method name to invoke.
      `actionFilter` - A filter to test the object against to select the correct action.
    Throws:
      `IllegalArgumentException` - If the actionType is not valid.

  - ### setFilter

    public void setFilter(String filter)
    Sets the factory action's filter. Use this method if the filter is known to be valid.
    Parameters:
      `filter` - Factory action's filter.
    See Also:
      - `setFilter(String, boolean)`

  - ### setFilter

    public void setFilter(String filter, boolean isValidating) throws ServiceException
    Sets the factory action's filter. Use this method the filter needs to be validated.
    Parameters:
      `filter` -
      `isValidating` - `true` if the filter should be validated or `false` if the caller knows the filter is valid.
    Throws:
      `ServiceException` - if an invalid filter is specified.
    See Also:
      - `setFilter(String)`

  - ### getFilter

    public String getFilter()

  - ### compare

    public int compare(FactoryAction o1, FactoryAction o2)
    Specified by:
      `compare` in interface `Comparator<FactoryAction>`

  - ### getActionType

    public String getActionType()
    Gets the action's type:
    - class
    - constructor
    - method
    Returns:
      action's type or `null` if undefined.

  - ### getActionClassName

    public String getActionClassName()
    Gets the action's class name.
    Returns:
      action's fully qualified java class name or `null` if undefined.

  - ### setActionType

    public void setActionType(String actionType) throws IllegalArgumentException
    Throws:
      `IllegalArgumentException`

  - ### setActionClassName

    public void setActionClassName(String actionClassName)
    Sets the factory action's class name.
    Parameters:
      `actionClassName` - Fully qualified Java class name.
    Throws:
      `IllegalArgumentException` - if an invalid class is specified.

  - ### validate

    public void validate() throws IllegalArgumentException
    Validates the factory action.
    Throws:
      `IllegalArgumentException` - if the factory action is invalid.

  - ### setActionMethodName

    public void setActionMethodName(String actionMethodName) throws IllegalArgumentException
    Sets the factory action's method name. A method name is required for some action types including "service" and "class".
    Parameters:
      `actionMethodName` - Action's method name.
    Throws:
      `IllegalArgumentException` - if an invalid action method name is specified.

  - ### getActionMethodName

    public String getActionMethodName()
    Gets the action's method name.
    Returns:
      action's method name or an empty string if one is not defined.

  - ### isValidType

    public static boolean isValidType(String type)
    Determines whether or not the specified Information Service factory type is valid.
    Parameters:
      `type` - Type of Information Service factory action for which we'd like to determine if its valid or not.
    Returns:
      `true` if the type is valid or `false` if it isn't.

  - ### isMethodEnabled

    public static boolean isMethodEnabled(String type)
    Determines whether or not the action's method is enabled for the specified type of action.
    Parameters:
      `type` - Action's type
    Returns:
      `true` if a method may be specified for the action type or `false` if not.

  - ### equals

    public boolean equals(Object otherAction)
    Determines if the other factory action is equivalent to this factory action.

    - class name
    - method name
    - type
    - filter
    Specified by:
      `equals` in interface `Comparator<FactoryAction>`
    Overrides:
      `equals` in class `Object`
    Parameters:
      `otherAction` - Another factory action to be compared for equivalency to this object.
    Returns:
      `true` if the other factory action is equivalent.

  - ### hashCode

    public int hashCode()
    Gets a hash code based upon this object's attributes.
    - class name
    - method name
    - type
    - filter
    Overrides:
      `hashCode` in class `Object`
    Returns:
      Hash code.

  - ### getValidActionTypes

    public static String[][] getValidActionTypes()
    Gets an array of string values representing valid factory action types and an accompanying localized description suitable for use in a choice user interface component.
    Returns:
      Valid factory action types.

  - ### clone

    public Object clone() throws CloneNotSupportedException
    Clones the resource.
    Specified by:
      `clone` in interface `ConsumedResourceInterface`
    Overrides:
      `clone` in class `Object`
    Returns:
      Clone of this resource.
    Throws:
      `CloneNotSupportedException`

  - ### getResourceID

    public String getResourceID()
    Description copied from interface: `ConsumedResourceInterface`
    Gets the id that uniquely identifies the resource within a service's configuration.
    Specified by:
      `getResourceID` in interface `ConsumedResourceInterface`
    Returns:
      Resource's ID.

  - ### getResourceValue

    public String getResourceValue()
    Gets the value for this factory action.

    The syntax of the entry is:

    - `ctor::<fully qualified java class name>`
    - `service::<fully qualified java class name>::<method name>`
    - `class::<fully qualified java class name>::<method name>`
    If a filter is defined, it will suffix the preceding values.
    Specified by:
      `getResourceValue` in interface `ConsumedResourceInterface`
    Returns:
      Service configuration resource's value.

  - ### getLocalizedResourceType

    public String getLocalizedResourceType()
    Description copied from interface: `ConsumedResourceInterface`
    Gets a localized value describing the resource's type.
    Specified by:
      `getLocalizedResourceType` in interface `ConsumedResourceInterface`
    Returns:
      Resource's type. For example, a Logging Service configuration's resource types would be localized values for "Context", "Output", and "Renderer".

  - ### getLocalizedResourceTypeAndValue

    public String getLocalizedResourceTypeAndValue()
    Description copied from interface: `ConsumedResourceInterface`
    Gets a localized value describing the resource's type and value.
    Specified by:
      `getLocalizedResourceTypeAndValue` in interface `ConsumedResourceInterface`
    Returns:
      Resource's type. For example, a Logging Service configuration's resource types would be localized values for
      - "Context : com.sas.services"
      - "Output : A1"
      - "Renderer: com.sas.MyRenderer"

  - ### getResourceType

    public String getResourceType()
    Description copied from interface: `ConsumedResourceInterface`
    Gets a value describing the resource's type.
    Specified by:
      `getResourceType` in interface `ConsumedResourceInterface`
    Returns:
      Resource's type. For example, a Logging Service configuration's resource types would be "Context", "Output", and "Renderer".

  - ### getResourceTypeCode

    public int getResourceTypeCode()
    Description copied from interface: `ConsumedResourceInterface`
    Gets the code describing the resource's type.
    Specified by:
      `getResourceTypeCode` in interface `ConsumedResourceInterface`
    Returns:
      Resource's type code.

  - ### isRequired

    public boolean isRequired()
    Description copied from interface: `ConsumedResourceInterface`
    Determines if this resource is required by the service's configuration.
    Specified by:
      `isRequired` in interface `ConsumedResourceInterface`
    Returns:
      `true` if this resource is required by the service's configuration.

  - ### toString

    public String toString()
    Gets a string representation of this factory action. The following values are summarized.
    - id
    - type
    - class name
    - method name
    - filter
    Overrides:
      `toString` in class `Object`