Interface IPrototype
- All Superinterfaces:
IAdaptable,IChangeListener,IHasCustomValues,IHasValues,IPObject
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringUsed as key name when referenceing structures nested into the lists.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleancanKeyBeCached(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()booleanbooleanisKeyDefined(String key) booleanisKeyNonInherited(String key) booleanisKeyReadOnly(String key) The implementation ofIPObjectshould ensure, that read-only keys can be set.booleanisKeyRequired(String key) booleanisPrimaryKey(String key) booleanMethods inherited from interface com.polarion.platform.persistence.model.IAdaptable
adaptMethods inherited from interface com.polarion.platform.persistence.model.IChangeListener
markChangedMethods inherited from interface com.polarion.platform.persistence.model.IHasCustomValues
getCustomField, getCustomFieldPrototype, getCustomFieldsList, setCustomFieldMethods 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
IPrototypes which are direct supertypes of this one.
-
isEachInstanceReadOnly
boolean isEachInstanceReadOnly()- Returns:
Trueif the whole prototype (each instance of it) is read only.
-
allowsCustomFields
boolean allowsCustomFields()- Returns:
True, if instances of this type can have custom fields,falseotherwise. The ability to have custom fields is inheritable.
-
getKeyNames
Collection getKeyNames()- Returns:
- Collection of
Stringnames of keys defined by the prototype. This includes the keys defined on supertypes. Never returnsnull.
-
getNonInheritedKeyNames
Collection getNonInheritedKeyNames()- Returns:
- Collection of
Stringnames of keys defined by this prototype. This excludes the keys defined on supertypes. Never returnsnull.
-
isKeyNonInherited
- Returns:
TrueIf 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
nullif the key is not defined by this or any other supertype.
-
isKeyDefined
- Returns:
TrueIf the given key exists in this prototype (or a supertype). OtherwiseFalse.
-
isKeyRequired
- Parameters:
key-- Returns:
TrueIf the given key exists in this prototype (or some of the supertypes) AND is marked as required.Falseotherwise.
-
isKeyReadOnly
The implementation ofIPObjectshould ensure, that read-only keys can be set.- Parameters:
key-- Returns:
TrueIfIPObject.isReadOnly()returnstrue, or the given key exists in this prototype. (or some of the supertypes) AND is marked as read-only.Falseotherwise.
-
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
Strings
-
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
Strings - Since:
- 3.1.2
-
getAnnotationValues
- Returns:
- the Collection of
@link Objects 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
nullnone are found.
-
getAnnotationKeys()with the same behavior