java.lang.Object
org.praxislive.core.Value
org.praxislive.core.types.PMap.MapBasedValue
org.praxislive.core.ArgumentInfo
Info object used to define the valid input and output arguments of a Control.
As well as giving the type of the argument, an ArgumentInfo can have an optional set of properties. This might be used for defining the "minimum" and "maximum" values of a PNumber argument, for example.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.praxislive.core.Value
Value.Type<T extends Value> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringMap key for optional flag that an empty value will be accepted even when the type has no empty representation.static final StringMap key for optional list of allowed values.static final StringMap key for optional flag that an empty value will be treated as a default.static final StringMap key for optional mime type of the value.static final StringMap key to mark an argument as optional.static final StringMap key for optional list of suggested values.static final StringMap key for optional text template.static final StringMap key for Value type name.static final StringMap key to mark an argument as varargs.static final StringValue type name. -
Method Summary
Modifier and TypeMethodDescriptionThe value type name of the argument.static Optional<ArgumentInfo> Coerce the provided Value into an ArgumentInfo if possible.static ArgumentInfoCreate an ArgumentInfo from the Value class and optional PMap of additional properties.static ArgumentInfoCreate an ArgumentInfo from the Value class and optional PMap of additional properties.static ArgumentInfoParse the provided String into an ArgumentInfo if possible.Access the map of properties.Methods inherited from class org.praxislive.core.types.PMap.MapBasedValue
dataMap, equals, equivalent, hashCode, toString
-
Field Details
-
TYPE_NAME
Value type name.- See Also:
-
KEY_TYPE
Map key for Value type name. The map value should be the String fromValue.Type.name().- See Also:
-
KEY_ALLOWED_VALUES
Map key for optional list of allowed values.- See Also:
-
KEY_SUGGESTED_VALUES
Map key for optional list of suggested values. A user interface may show these as values to select, but must also allow other values to be entered.- See Also:
-
KEY_ALLOW_EMPTY
Map key for optional flag that an empty value will be accepted even when the type has no empty representation.- See Also:
-
KEY_EMPTY_IS_DEFAULT
Map key for optional flag that an empty value will be treated as a default.- See Also:
-
KEY_TEMPLATE
Map key for optional text template. A user interface might show the template when the value is otherwise empty.- See Also:
-
KEY_MIME_TYPE
Map key for optional mime type of the value.- See Also:
-
KEY_OPTIONAL
Map key to mark an argument as optional. The value may be omitted in input arguments or not returned in outputs arguments.- See Also:
-
KEY_VARARGS
Map key to mark an argument as varargs. The input or output arguments may include any number of matching values.- See Also:
-
-
Method Details
-
argumentType
The value type name of the argument. SeeValue.Type.name().- Returns:
- value type name
-
properties
Access the map of properties. The map includes the value type, as well as any custom or optional properties.This method is equivalent to calling
PMap.MapBasedValue.dataMap().- Returns:
- property map
-
of
Create an ArgumentInfo from the Value class and optional PMap of additional properties.- Parameters:
argClass-- Returns:
- ArgumentInfo
-
of
Create an ArgumentInfo from the Value class and optional PMap of additional properties.- Parameters:
argClass-properties-- Returns:
- ArgumentInfo
-
from
Coerce the provided Value into an ArgumentInfo if possible.- Parameters:
arg- value of unknown type- Returns:
- argument info or empty optional
-
parse
Parse the provided String into an ArgumentInfo if possible.- Parameters:
string- text to parse- Returns:
- argument info
- Throws:
ValueFormatException- if parsing fails
-