Interface ICustomFieldsProvider
- All Known Subinterfaces:
ICustomFieldsService
public interface ICustomFieldsProvider
Custom fields provider.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The Prefix that is given to the id and name of a custom field whose id conflicts with the id of a built-in field. -
Method Summary
Modifier and TypeMethodDescriptiongetAllCustomFields
(String prototypeName, IContextId contextId) getControlField
(String prototypeName) Returns the name of the field that controls the set of custom fields defined for the object of the given prototype.getCustomField
(String featureId, String prototypeName, IContextId contextId) Deprecated.getCustomField
(String featureId, String prototypeName, IContextId contextId, Object controlValue) getDefinedCustomFields
(String prototypeName, IContextId contextId, Object controlValue) getListCustomField
(String featureId, String prototypeName, IContextId contextId) Deprecated.usegetListCustomField(String, String, IContextId, Object)
Similar togetCustomField(String, String, IContextId)
, but ensures that the resulting feature has theIListType
, otherwise an exception is thrown.getListCustomField
(String featureId, String prototypeName, IContextId contextId, Object controlValue) Similar togetCustomField(String, String, IContextId)
, but ensures, that the resulting feature has theIListType
, otherwise an exception is thrown.boolean
isCustomFieldDefined
(String featureId, String prototypeName, IContextId contextId) Deprecated.useisCustomFieldDefined(String, String, IContextId, Object)
Returns true, if a feature with such a name is, even conditionally, defined for the given prototype in the given context.boolean
isCustomFieldDefined
(String featureId, String prototypeName, IContextId contextId, Object controlValue) Returns true if a feature with such a name is, even conditionally, defined for the given prototype in the given context.
-
Field Details
-
CONFLICT_PREFIX
The Prefix that is given to the id and name of a custom field whose id conflicts with the id of a built-in field.- Since:
- 3.2.3
- See Also:
-
-
Method Details
-
getAllCustomFields
@NotNull List<ICustomField> getAllCustomFields(@NotNull String prototypeName, @NotNull IContextId contextId) - Parameters:
prototypeName
- The prototype of the object e.g. "WorkItem" (notnull
).contextId
- For example of a project.- Returns:
- A list of
ICustomField
, that returns all of the custom features defined for the given prototype in the given context. This even includes the features conditionally defined based on the value of some other feature.
-
getDefinedCustomFields
@NotNull List<ICustomField> getDefinedCustomFields(@NotNull String prototypeName, @NotNull IContextId contextId, @Nullable Object controlValue) - Parameters:
prototypeName
- The prototype of the object e.g. "WorkItem" (notnull
).contextId
- For example of a project.controlValue
- The control field value (for example "requirement" or "task" for Work Items that have "type" as the control field), can be either String or IEnumOption ornull
if there is no control field.- Returns:
- A list of
ICustomField
, that returns all the custom features defined for the given prototype in the given context with the given control value. - Since:
- 3.3.0
-
getControlField
Returns the name of the field that controls the set of custom fields defined for the object of the given prototype.- Parameters:
prototypeName
- The prototype of the object, for example, "WorkItem" (notnull
).- Returns:
- The control field id or
null
if there is none defined. - Since:
- 3.1.2
-
isCustomFieldDefined
@Deprecated boolean isCustomFieldDefined(@NotNull String featureId, @NotNull String prototypeName, @NotNull IContextId contextId) Deprecated.useisCustomFieldDefined(String, String, IContextId, Object)
Returns true, if a feature with such a name is, even conditionally, defined for the given prototype in the given context.- Returns:
true
if the field is defined
-
isCustomFieldDefined
boolean isCustomFieldDefined(@NotNull String featureId, @NotNull String prototypeName, @NotNull IContextId contextId, @Nullable Object controlValue) Returns true if a feature with such a name is, even conditionally, defined for the given prototype in the given context.- Parameters:
featureId
- The custom field id e.g. "targetRelease", "risk" (notnull
)controlValue
- The control field value (for example "requirement" or "task" for Work Items that have "type" as the control field), can be either String or IEnumOption ornull
if there is no control field.prototypeName
- The prototype of the object, for example, "WorkItem" (notnull
)contextId
- For example of a project.- Returns:
true
if the field is defined.- Since:
- 3.1.2
- See Also:
-
getCustomField
@Deprecated @NotNull ICustomField getCustomField(@NotNull String featureId, @NotNull String prototypeName, @NotNull IContextId contextId) Deprecated.- Returns:
- Returns the given custom feature for the given prototype and
context, or a fake
String
feature definition if the feature is not defined. (The fake String definition should be used for processing unknown custom fields).
-
getCustomField
@NotNull ICustomField getCustomField(@NotNull String featureId, @NotNull String prototypeName, @NotNull IContextId contextId, @Nullable Object controlValue) - Parameters:
featureId
- The custom field id, for example, "targetRelease", "risk" (notnull
)prototypeName
- The prototype of the object, for example, "WorkItem" (notnull
)contextId
- For example of a project.controlValue
- The control field value (for example "requirement" or "task" for Work Items that have "type" as the control field,) can be either String or IEnumOption) ornull
if there is no control field.- Returns:
- Returns the given custom feature for the given prototype and context, or a fake
String
feature definition, if the feature is not defined. (The fake String definition should be used for processing unknown custom fields.) - Since:
- 3.1.2
- See Also:
-
getListCustomField
@Deprecated @NotNull ICustomField getListCustomField(@NotNull String featureId, @NotNull String prototypeName, @NotNull IContextId contextId) Deprecated.usegetListCustomField(String, String, IContextId, Object)
Similar togetCustomField(String, String, IContextId)
, but ensures that the resulting feature has theIListType
, otherwise an exception is thrown. If no such custom feature is defined, then a fake list ofString
feature is returned.- Returns:
- the
ICustomField
for the specified parameters
-
getListCustomField
@NotNull ICustomField getListCustomField(@NotNull String featureId, @NotNull String prototypeName, @NotNull IContextId contextId, @Nullable Object controlValue) Similar togetCustomField(String, String, IContextId)
, but ensures, that the resulting feature has theIListType
, otherwise an exception is thrown. If no such custom feature is defined, then a fake list ofString
feature is returned.- Parameters:
featureId
- The custom field id e.g. "targetRelease", "risk" (notnull
)prototypeName
- The prototype of the object, for example, "WorkItem" (notnull
)contextId
- For example of a project.controlValue
- The control field value (for example "requirement" or "task" for Work Items that have "type" as the control field), can be either String or IEnumOption) ornull
if there is no control field.- Returns:
- the
ICustomField
for the specified parameters. - Since:
- 3.1.2
- See Also:
-
getCustomField(String, String, IContextId, Object)