*** 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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAction type: class.static final StringAction type: constructor.static final StringAction type: service. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs 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 nameFactoryAction(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 nameFactoryAction(Element element) Constructs a factory action by parsing a "Type" XML Element. -
Method Summary
Modifier and TypeMethodDescriptionObjectclone()Clones the resource.intcompare(FactoryAction o1, FactoryAction o2) booleanequals(Object otherAction) Determines if the other factory action is equivalent to this factory action.StringGets an Information Service action string based upon the currently defined type, class, and method.StringGets the action's class name.StringGets the action's method name.StringGets the action's type: class constructor methodStringStringgetID()StringGets a localized value describing the resource's type.StringGets a localized value describing the resource's type and value.StringGets the id that uniquely identifies the resource within a service's configuration.StringGets a value describing the resource's type.intGets the code describing the resource's type.StringGets the value for this factory action.static String[][]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.inthashCode()Gets a hash code based upon this object's attributes.static booleanisMethodEnabled(String type) Determines whether or not the action's method is enabled for the specified type of action.booleanDetermines if this resource is required by the service's configuration.static booleanisValidType(String type) Determines whether or not the specified Information Service factory type is valid.voidsetAction(String action) Sets the factory's action.voidsetAction(String actionType, String actionClassName, String actionMethodName, String actionFilter) Sets the action's class name.voidsetActionClassName(String actionClassName) Sets the factory action's class name.voidsetActionMethodName(String actionMethodName) Sets the factory action's method name.voidsetActionType(String actionType) voidsetFilter(String filter) Sets the factory action's filter.voidsetFilter(String filter, boolean isValidating) Sets the factory action's filter.StringtoString()Gets a string representation of this factory action.voidvalidate()Validates the factory action.Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
TYPE_CLASS
public static final String TYPE_CLASSAction type: class.- See Also:
-
TYPE_CONSTRUCTOR
public static final String TYPE_CONSTRUCTORAction type: constructor.- See Also:
-
TYPE_SERVICE
public static final String TYPE_SERVICEAction type: service.- See Also:
-
-
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- Actionfilter- Filter
-
FactoryAction
public FactoryAction(String uid, String action, String filter) Constructs an instance for the specified action and filter.- Parameters:
uid- Unique identifier ornullif an ID should be generated.action- Actionfilter- 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:ctorconstructorservice
actionClassName- Fully qualified Java class name.actionMethodName- Optional method name for use with an action type ofservice.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 ornullif an ID should be generated.actionType- Action's type. Valid action types are:ctorconstructorservice
actionClassName- Fully qualified Java class name.actionMethodName- Optional method name for use with an action type ofservice.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
Sets the factory action's filter. Use this method the filter needs to be validated.- Parameters:
filter-isValidating-trueif the filter should be validated orfalseif the caller knows the filter is valid.- Throws:
ServiceException- if an invalid filter is specified.- See Also:
-
getFilter
public String getFilter() -
compare
- Specified by:
comparein interfaceComparator<FactoryAction>
-
getActionType
public String getActionType()Gets the action's type:- class
- constructor
- method
- Returns:
- action's type or
nullif undefined.
-
getActionClassName
public String getActionClassName()Gets the action's class name.- Returns:
- action's fully qualified java class name or
nullif 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 IllegalArgumentExceptionValidates 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:
trueif the type is valid orfalseif 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:
trueif a method may be specified for the action type orfalseif 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:
equalsin interfaceComparator<FactoryAction>- Overrides:
equalsin classObject- Parameters:
otherAction- Another factory action to be compared for equivalency to this object.- Returns:
trueif 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:
hashCodein classObject- 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 CloneNotSupportedExceptionClones the resource.- Specified by:
clonein interfaceConsumedResourceInterface- Overrides:
clonein classObject- Returns:
- Clone of this resource.
- Throws:
CloneNotSupportedException
-
getResourceID
public String getResourceID()Description copied from interface:ConsumedResourceInterfaceGets the id that uniquely identifies the resource within a service's configuration.- Specified by:
getResourceIDin interfaceConsumedResourceInterface- 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>
- Specified by:
getResourceValuein interfaceConsumedResourceInterface- Returns:
- Service configuration resource's value.
-
getLocalizedResourceType
public String getLocalizedResourceType()Description copied from interface:ConsumedResourceInterfaceGets a localized value describing the resource's type.- Specified by:
getLocalizedResourceTypein interfaceConsumedResourceInterface- 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:ConsumedResourceInterfaceGets a localized value describing the resource's type and value.- Specified by:
getLocalizedResourceTypeAndValuein interfaceConsumedResourceInterface- 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:ConsumedResourceInterfaceGets a value describing the resource's type.- Specified by:
getResourceTypein interfaceConsumedResourceInterface- 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:ConsumedResourceInterfaceGets the code describing the resource's type.- Specified by:
getResourceTypeCodein interfaceConsumedResourceInterface- Returns:
- Resource's type code.
-
isRequired
public boolean isRequired()Description copied from interface:ConsumedResourceInterfaceDetermines if this resource is required by the service's configuration.- Specified by:
isRequiredin interfaceConsumedResourceInterface- Returns:
trueif 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:
toStringin classObject
-