Package ro.sync.ecss.extensions.api
Class ArgumentDescriptor
- java.lang.Object
-
- ro.sync.ecss.extensions.api.ArgumentDescriptor
-
@API(type=EXTENDABLE, src=PUBLIC) public class ArgumentDescriptor extends java.lang.Object
Descriptor class for an author operation argument.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String[]
allowedValues
The array containing the allowed values for the arguments with type TYPE_CONSTANTS_LIST.protected java.lang.String
defaultValue
The default value of the argument.protected java.lang.String
description
The string argument description.protected java.lang.String
name
The argument name.protected int
type
The argument type, can be one of:TYPE_STRING
,TYPE_FRAGMENT
,TYPE_SCRIPT
,TYPE_XPATH_EXPRESSION
,TYPE_CONSTANT_LIST
,static int
TYPE_CONSTANT_LIST
List of constant strings argument type.static int
TYPE_FRAGMENT
XML fragment argument type.static int
TYPE_JAVA_OBJECT
An argument of this type is a Java object represented as a Map.static int
TYPE_SCRIPT
Script type (XSLT or XQuery).static int
TYPE_STRING
String argument type.static int
TYPE_XPATH_EXPRESSION
Xpath expression argument type.
-
Constructor Summary
Constructors Constructor Description ArgumentDescriptor(java.lang.String name, int type, java.lang.String description)
Constructor of the argument descriptor class.ArgumentDescriptor(java.lang.String name, int type, java.lang.String description, java.lang.String defaultValue)
Constructor of the argument descriptor class.ArgumentDescriptor(java.lang.String name, int type, java.lang.String description, java.lang.String[] allowedValues, java.lang.String defaultValue)
Constructor of the argument descriptor class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.String
decodeType(int type)
Returns aString
description of the given argument type.java.lang.String[]
getAllowedValues()
java.lang.String
getDefaultValue()
java.lang.String
getDescription()
java.lang.String
getName()
int
getType()
java.lang.String
toString()
-
-
-
Field Detail
-
TYPE_STRING
public static final int TYPE_STRING
String argument type. The value is0
.- See Also:
- Constant Field Values
-
TYPE_FRAGMENT
public static final int TYPE_FRAGMENT
XML fragment argument type. It is represented as aString
The value is1
.- See Also:
- Constant Field Values
-
TYPE_XPATH_EXPRESSION
public static final int TYPE_XPATH_EXPRESSION
Xpath expression argument type. It is represented as aString
The value is2
.- See Also:
- Constant Field Values
-
TYPE_CONSTANT_LIST
public static final int TYPE_CONSTANT_LIST
List of constant strings argument type. The value is3
.- See Also:
- Constant Field Values
-
TYPE_SCRIPT
public static final int TYPE_SCRIPT
Script type (XSLT or XQuery). It is represented as aString
The value is4
.- See Also:
- Constant Field Values
-
TYPE_JAVA_OBJECT
public static final int TYPE_JAVA_OBJECT
An argument of this type is a Java object represented as a Map. This Map is interpreted by the operation that receives it.- See Also:
- Constant Field Values
-
name
protected java.lang.String name
The argument name.
-
type
protected int type
The argument type, can be one of:TYPE_STRING
,TYPE_FRAGMENT
,TYPE_SCRIPT
,TYPE_XPATH_EXPRESSION
,TYPE_CONSTANT_LIST
,
-
description
protected java.lang.String description
The string argument description.
-
allowedValues
protected java.lang.String[] allowedValues
The array containing the allowed values for the arguments with type TYPE_CONSTANTS_LIST.
-
defaultValue
protected java.lang.String defaultValue
The default value of the argument.
-
-
Constructor Detail
-
ArgumentDescriptor
public ArgumentDescriptor(java.lang.String name, int type, java.lang.String description)
Constructor of the argument descriptor class.- Parameters:
name
- The name of the argument.type
- The type of the argument, one of:TYPE_STRING
,TYPE_FRAGMENT
,TYPE_SCRIPT
,TYPE_XPATH_EXPRESSION
,TYPE_CONSTANT_LIST
,description
- The description of the argument.
-
ArgumentDescriptor
public ArgumentDescriptor(java.lang.String name, int type, java.lang.String description, java.lang.String defaultValue)
Constructor of the argument descriptor class.- Parameters:
name
- The name of the argument.type
- The type of the argument, one of:TYPE_STRING
,TYPE_FRAGMENT
,TYPE_SCRIPT
,TYPE_XPATH_EXPRESSION
,TYPE_CONSTANT_LIST
,description
- The description of the argument.defaultValue
- The default value of the argument.
-
ArgumentDescriptor
public ArgumentDescriptor(java.lang.String name, int type, java.lang.String description, java.lang.String[] allowedValues, java.lang.String defaultValue)
Constructor of the argument descriptor class.- Parameters:
name
- The name of the argument.type
- The type of the argument, one of:TYPE_STRING
,TYPE_FRAGMENT
,TYPE_SCRIPT
,TYPE_XPATH_EXPRESSION
,TYPE_CONSTANT_LIST
,description
- The description of the argument.allowedValues
- The allowed values for the defined argument.defaultValue
- The default value of the argument.
-
-
Method Detail
-
getName
public java.lang.String getName()
- Returns:
- The name of the argument.
-
getType
public int getType()
- Returns:
- The type of the argument, one of:
TYPE_STRING
,TYPE_FRAGMENT
,TYPE_SCRIPT
,TYPE_XPATH_EXPRESSION
,TYPE_CONSTANT_LIST
,
-
getDescription
public java.lang.String getDescription()
- Returns:
- The description of the argument.
-
decodeType
public static java.lang.String decodeType(int type)
Returns aString
description of the given argument type.- Parameters:
type
- The argument type, one of:TYPE_STRING
,TYPE_FRAGMENT
,TYPE_SCRIPT
,TYPE_XPATH_EXPRESSION
,TYPE_CONSTANT_LIST
,- Returns:
- The type description, or
null
if the type is not valid.
-
getAllowedValues
public java.lang.String[] getAllowedValues()
- Returns:
- The array with allowed values.
Is used for
TYPE_CONSTANTS_LIST
arguments.
-
getDefaultValue
public java.lang.String getDefaultValue()
- Returns:
- The default value of the argument.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- See Also:
Object.toString()
-
-