Package org.eclipse.birt.report.model.api.metadata

# Interface IPropertyDefn

All Superinterfaces:
  `org.eclipse.birt.report.model.metadata.IContainerDefn`

All Known Subinterfaces:
  `IElementPropertyDefn`

All Known Implementing Classes:
  `org.eclipse.birt.report.model.metadata.ElementPropertyDefn`, `org.eclipse.birt.report.model.metadata.PropertyDefn`, `UserPropertyDefn`

public interface IPropertyDefn extends org.eclipse.birt.report.model.metadata.IContainerDefn
Base Interface for both element property, extension model property and structure member definitions.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`COMMERCIAL_PROPERTY`
Type code for a property defined for commercial element implementation.
`static final int`
`EXTENSION_MODEL_PROPERTY`
Type code for a property defined by an extension implementation of ReportItemExtensionPoint.
`static final int`
`EXTENSION_PROPERTY`
Type code for a property defined in XML file with the ReportItemExtensionPoint.
`static final int`
`ODA_PROPERTY`
Type code for a property defined by a ODA extension.
`static final int`
`SYSTEM_PROPERTY`
Type code for a system property.
`static final int`
`USER_PROPERTY`
Type code for a user property.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`allowExpression()`
Checks whether the expression can be the value of this property.
`IChoiceSet`
`getAllowedChoices()`
Returns the allowed choices for this property.
`IChoiceSet`
`getAllowedUnits()`
Returns the allowed units for this property.
`IChoiceSet`
`getChoices()`
Gets the list of choices for the property.
`String`
`getContext()`
Return the context for a method or expression.
`Object`
`getDefault()`
Returns the default value for the property.
`String`
`getDisplayNameID()`
Returns the message id for the display name.
`IStructureDefn`
`getStructDefn()`
Returns the structure definition for this value.
`IElementDefn`
`getTargetElementType()`
Return the element type associated with this property.
`int`
`getTypeCode()`
Returns the property type.
`int`
`getValueType()`
Returns the type of this value.
`boolean`
`hasChoices()`
Checks if a property has a set of choices whatever choice is choice, extended choice or user defined choice.
`boolean`
`isEncryptable()`
Returns whether this property should be encrypted.
`boolean`
`isList()`
Indicates whether this property is a list.

### Methods inherited from interface org.eclipse.birt.report.model.metadata.IContainerDefn

`canContain, canContain, getAllowedElements, getAllowedElements, getDisplayName, getName, getNameConfig`

## Field Details

### SYSTEM_PROPERTY

static final int SYSTEM_PROPERTY
Type code for a system property.

See Also:
  - Constant Field Values

### USER_PROPERTY

static final int USER_PROPERTY
Type code for a user property.

See Also:
  - Constant Field Values

### EXTENSION_PROPERTY

static final int EXTENSION_PROPERTY
Type code for a property defined in XML file with the ReportItemExtensionPoint.

See Also:
  - Constant Field Values

### EXTENSION_MODEL_PROPERTY

static final int EXTENSION_MODEL_PROPERTY
Type code for a property defined by an extension implementation of ReportItemExtensionPoint.

See Also:
  - Constant Field Values

### ODA_PROPERTY

static final int ODA_PROPERTY
Type code for a property defined by a ODA extension.

See Also:
  - Constant Field Values

### COMMERCIAL_PROPERTY

static final int COMMERCIAL_PROPERTY
Type code for a property defined for commercial element implementation.

See Also:
  - Constant Field Values

## Method Details

### isList

boolean isList()
Indicates whether this property is a list. It is useful only when the property type is a structure type.

Returns:
  whether the property is a list or not.

### getTypeCode

int getTypeCode()
Returns the property type. See the list in `PropertyType`.

Returns:
  he property type code

### getDisplayNameID

String getDisplayNameID()
Returns the message id for the display name.

Returns:
  The display name message ID.

### getChoices

IChoiceSet getChoices()
Gets the list of choices for the property.

Returns:
  the list of choices

### hasChoices

boolean hasChoices()
Checks if a property has a set of choices whatever choice is choice, extended choice or user defined choice.

Returns:
  true if it has, otherwise false.

### getStructDefn

IStructureDefn getStructDefn()
Returns the structure definition for this value.

Returns:
  the structure definition, or null if this value is not a list of structures

### getDefault

Object getDefault()
Returns the default value for the property.

Returns:
  The default value.

### getTargetElementType

IElementDefn getTargetElementType()
Return the element type associated with this property.

Returns:
  the element type associated with the property

### getAllowedChoices

IChoiceSet getAllowedChoices()
Returns the allowed choices for this property. It contains allowed choices for a choice type.

If a property has not defined the restriction, then whole set will be returned.

Returns:
  Returns the allowed choices of this property.

### getAllowedUnits

IChoiceSet getAllowedUnits()
Returns the allowed units for this property. It contains an allowed units set for a dimension type. Only the dimension type supports allowed units feature.

If a property has not defined the restriction, then whole set will be returned.

Returns:
  Returns the allowed units of this property.

### isEncryptable

boolean isEncryptable()
Returns whether this property should be encrypted.

Returns:
  `true` if this property should be encrypted.

### getValueType

int getValueType()
Returns the type of this value. The return can be one of the following constants:

- SYSTEM_PROPERTY
- USER_PROPERTY
- STRUCT_PROPERTY
- EXTENSION_PROPERTY

Returns:
  the type of this definition

### getContext

String getContext()
Return the context for a method or expression. If the property type is not method/expression, the return value is `null`.

Returns:
  the expression or method context

### allowExpression

boolean allowExpression()
Checks whether the expression can be the value of this property.

Returns:
  `true` if the expression value is valid. Otherwise `false`.