Interface IPrototype
- All Superinterfaces:
IAdaptable
,IChangeListener
,IHasCustomValues
,IHasValues
,IPObject
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Used as key name when referenceing structures nested into the lists.static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
canKeyBeCached
(String key) The annotations are meant to provide additional information about the prototype.getAnnotationValue
(String key) Use this method if you expect the annotation to only have a single value.Deprecated.getKeyType
(String key) This method also handles composed keys to create a single destination for logic implementation.getLabel()
getName()
boolean
boolean
isKeyDefined
(String key) boolean
isKeyNonInherited
(String key) boolean
isKeyReadOnly
(String key) The implementation ofIPObject
should ensure, that read-only keys can be set.boolean
isKeyRequired
(String key) boolean
isPrimaryKey
(String key) boolean
Methods inherited from interface com.polarion.platform.persistence.model.IAdaptable
adapt
Methods inherited from interface com.polarion.platform.persistence.model.IChangeListener
markChanged
Methods inherited from interface com.polarion.platform.persistence.model.IHasCustomValues
getCustomField, getCustomFieldPrototype, getCustomFieldsList, setCustomField
Methods inherited from interface com.polarion.platform.persistence.model.IPObject
can, copyTo, createStructureForKey, forget, getContextId, getDataRevision, getDataSvc, getEnumerationOptionForField, getEnumerationTypeForField, getFieldLabel, getFieldType, getIncompatibleCustomField, getIncompatibleCustomFieldPrototype, getIncompatibleCustomFieldsList, getLastRevision, getLocalId, getObjectId, getPrototype, getRevision, getUri, getValue, isModified, isPersisted, isReadOnly, isResolved, isUnresolvable, resolve, save, setEnumerationValue, setValue, update
-
Field Details
-
PROTO
- See Also:
-
COLLECTION_KEY
Used as key name when referenceing structures nested into the lists. E.g. if we have key of type collection, which contains structures, then we reference it like:- myList - reference to the collection
- myList.
COLLECTION_KEY
- reference to item in the collection - myList.
COLLECTION_KEY
.key - reference to key inside structure in the list
- See Also:
-
KEY_NAME
- See Also:
-
KEY_SUPERTYPES
- See Also:
-
KEY_INSTANCE_READONLY
- See Also:
-
KEY_VERSIONED
- Since:
- 3.6.0
- See Also:
-
KEY_ALLOWS_CUSTOM_FIELDS
- See Also:
-
KEY_KEYS
- See Also:
-
KEY_KEY_NAME
- See Also:
-
KEY_KEY_READONLY
- See Also:
-
KEY_KEY_REQUIRED
- See Also:
-
KEY_KEY_TYPE
- See Also:
-
KEY_KEY_NOT_CACHED
- Since:
- 3.5.2
- See Also:
-
KEY_ANNOTATIONS
- See Also:
-
KEY_ANNOTATION_NAME
- See Also:
-
KEY_ANNOTATION_VALUES
- See Also:
-
TYPE_SUPERTYPES_LIST
- See Also:
-
TYPE_KEYS_LIST
- See Also:
-
TYPE_ANNOTATIONS_LIST
- See Also:
-
TYPE_ANNOTATIONS_VALUES_LIST
- See Also:
-
TYPE_KEY_STRUCT
- See Also:
-
TYPE_ANNOTATION_STRUCT
- See Also:
-
-
Method Details
-
getName
String getName()- Returns:
- The prototype name.
-
getLabel
- Returns:
- The prototype (localized) label.
- Since:
- 3.8.1
-
getSupertypes
Collection getSupertypes()- Returns:
- List of
IPrototype
s which are direct supertypes of this one.
-
isEachInstanceReadOnly
boolean isEachInstanceReadOnly()- Returns:
True
if the whole prototype (each instance of it) is read only.
-
allowsCustomFields
boolean allowsCustomFields()- Returns:
True
, if instances of this type can have custom fields,false
otherwise. The ability to have custom fields is inheritable.
-
getKeyNames
Collection getKeyNames()- Returns:
- Collection of
String
names of keys defined by the prototype. This includes the keys defined on supertypes. Never returnsnull
.
-
getNonInheritedKeyNames
Collection getNonInheritedKeyNames()- Returns:
- Collection of
String
names of keys defined by this prototype. This excludes the keys defined on supertypes. Never returnsnull
.
-
isKeyNonInherited
- Returns:
True
If the given key exists in this prototype and is NOT inherited from the supertype.
-
getPrototypeDefiningKey
- Parameters:
key
-- Returns:
- Returns the prototype that the given key is originally
defined in. In other words, it returns a prototype where
isKeyNonInherited(key)
returnstrue
. - See Also:
-
getKeyType
This method also handles composed keys to create a single destination for logic implementation. (Composed keys lead to lists or structures, likekey.struct_key.LIST
)- Parameters:
key
-- Returns:
- The key type, or
null
if the key is not defined by this or any other supertype.
-
isKeyDefined
- Returns:
True
If the given key exists in this prototype (or a supertype). OtherwiseFalse
.
-
isKeyRequired
- Parameters:
key
-- Returns:
True
If the given key exists in this prototype (or some of the supertypes) AND is marked as required.False
otherwise.
-
isKeyReadOnly
The implementation ofIPObject
should ensure, that read-only keys can be set.- Parameters:
key
-- Returns:
True
IfIPObject.isReadOnly()
returnstrue
, or the given key exists in this prototype. (or some of the supertypes) AND is marked as read-only.False
otherwise.
-
getPrimaryKey
String getPrimaryKey() -
isPrimaryKey
-
canKeyBeCached
- Since:
- 3.5.2
-
isVersioned
boolean isVersioned()- Returns:
- whether instances of this prototype can be versioned
- Since:
- 3.6.0
-
getAnotationKeys
Deprecated.usegetAnnotationKeys()
with the same behavior- Returns:
- Collection of
String
s
-
getAnnotationKeys
Collection getAnnotationKeys()The annotations are meant to provide additional information about the prototype. They can be used, for example, to register renderers.- Returns:
- Collection of
String
s - Since:
- 3.1.2
-
getAnnotationValues
- Returns:
- the Collection of
@link Object
s or an empty Collection for unknown keys. It never returnsnull
-
getAnnotationValue
Use this method if you expect the annotation to only have a single value.If there are multiple values, then an error is logged and the first value is returned.
- Returns:
- The annotation value or
null
none are found.
-
getAnnotationKeys()
with the same behavior