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

# Interface IElementDefn

All Superinterfaces:
  `IObjectDefn`

public interface IElementDefn extends IObjectDefn
Interface for a report element definition. This interface defines some methods to get "meta-data" about an element.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`allowsUserProperties()`
Determines if this element allows user properties.
`boolean`
`canContain(int slot, IElementDefn type)`
Reports whether the given slot can contain elements of the given type.
`boolean`
`canExtend()`
Returns whether elements of this class can be extended.
`List<IElementPropertyDefn>`
`getContents()`
Returns the property definitions for this element that can hold other elements.
`List<IElementPropertyDefn>`
`getExpressions()`
Returns the expression property definition list of this element definition and parent definition.
`List<String>`
`getGroupNames()`
Returns a list of the localized property group names defined by this element and its parents.
`List<IElementPropertyDefn>`
`getLocalExpressions()`
Returns the expression property definition list of this element definition.
`List<IElementPropertyDefn>`
`getLocalMethods()`
Returns the method definition list of this element definition.
`List<IElementPropertyDefn>`
`getLocalProperties()`
Returns properties definitions as a list.
`List<IElementPropertyDefn>`
`getMethods()`
Returns the method definition list of this element definition and parent definition.
`int`
`getNameOption()`
Gets the name option that says how the element type handles names.
`List<IElementPropertyDefn>`
`getProperties()`
Returns the properties defined on this element.
`IElementPropertyDefn`
`getProperty(String propName)`
Gets a property definition given a property name.
`ISlotDefn`
`getSlot(int slotID)`
Returns the meta-data definition for a slot given its numeric slot identifier.
`int`
`getSlotCount()`
Returns the number of slots in this container.
`boolean`
`hasSlot(int slotID)`
Returns whether this element has the requested slot given the numeric identifier of the slot.
`boolean`
`hasStyle()`
Indicates if this element has a style.
`boolean`
`isContainer()`
Determines if this element acts as a container.
`boolean`
`isExtendedElement()`
Justifies whether this definition is extension element.
`boolean`
`isKindOf(IElementDefn type)`
Determines if the given element type is a kind of this type.
`boolean`
`isPropertyReadOnly(String propName)`
Checks whether the property value is read-only in the property sheet.
`boolean`
`isPropertyVisible(String propName)`
Checks whether the property is visible to the property sheet.

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

`findProperty, getDisplayName, getDisplayNameKey, getName, getPropertyIterator, propertiesIterator`

## Method Details

### hasStyle

boolean hasStyle()
Indicates if this element has a style.

Returns:
  Returns whether the element has a style.

### getProperties

List<IElementPropertyDefn> getProperties()
Returns the properties defined on this element. Each object in the list is instance of `IElementPropertyDefn`.

Returns:
  list of properties defined in this element and and all its parent elements.

### getLocalProperties

List<IElementPropertyDefn> getLocalProperties()
Returns properties definitions as a list. Each object in the list is instance of `IElementPropertyDefn`.

Returns:
  list of locally-defined properties.

### getProperty

IElementPropertyDefn getProperty(String propName)
Gets a property definition given a property name.

Parameters:
  `propName` - The name of the property to get.
Returns:
  The property with that name, or null if the property cannot be found.

### getMethods

List<IElementPropertyDefn> getMethods()
Returns the method definition list of this element definition and parent definition. Each object in the list is instance of `IElementPropertyDefn`.

Returns:
  the method definition list.

### getLocalMethods

List<IElementPropertyDefn> getLocalMethods()
Returns the method definition list of this element definition. Each object in the list is instance of `IElementPropertyDefn`.

Returns:
  the method definition list.

### getExpressions

List<IElementPropertyDefn> getExpressions()
Returns the expression property definition list of this element definition and parent definition. Each object in the list is instance of `IElementPropertyDefn`.

Returns:
  the expression property definition list.

### getLocalExpressions

List<IElementPropertyDefn> getLocalExpressions()
Returns the expression property definition list of this element definition. Each object in the list is instance of `IElementPropertyDefn`.

Returns:
  the expression property definition list.

### getGroupNames

List<String> getGroupNames()
Returns a list of the localized property group names defined by this element and its parents.

The UI uses property groups to organize properties within the generic property sheet.

Returns:
  The list of group names. If there is no groups defined on the element, the list will has no content.

### allowsUserProperties

boolean allowsUserProperties()
Determines if this element allows user properties.

Returns:
  Returns true if the element supports user-defined properties, false if not.

### isContainer

boolean isContainer()
Determines if this element acts as a container.

Returns:
  True if this element is a container, false otherwise.

### getSlotCount

int getSlotCount()
Returns the number of slots in this container.

Returns:
  The number of slots. Returns 0 if this element is not a container.

### hasSlot

boolean hasSlot(int slotID)
Returns whether this element has the requested slot given the numeric identifier of the slot.

Parameters:
  `slotID` - The slotID to check.
Returns:
  True if the slotID exists, false otherwise.

### getSlot

ISlotDefn getSlot(int slotID)
Returns the meta-data definition for a slot given its numeric slot identifier.

Parameters:
  `slotID` - The slot identifier.
Returns:
  The slot information. Returns null if this element is not a container, or if the ID is not valid for this container.

### getContents

List<IElementPropertyDefn> getContents()
Returns the property definitions for this element that can hold other elements. Each one in the list is instance of `IPropertyDefn`.

Returns:
  the list of the property definition that can hold other elements

### canContain

boolean canContain(int slot, IElementDefn type)
Reports whether the given slot can contain elements of the given type.

Parameters:
  `slot` - The slot to check.
  `type` - The element type to check.
Returns:
  True if the slot can contain that element type, false if the element is not a container, if the slot does not exist, or if the slot can't contain that type of element.

### canExtend

boolean canExtend()
Returns whether elements of this class can be extended.

Returns:
  True if the element can be extended, false if not.

### getNameOption

int getNameOption()
Gets the name option that says how the element type handles names. One of the following defined in `MetaDataConstants`:

- `MetaDataConstants.NO_NAME`-- The element cannot have a name. (Probably not used.)
- `MetaDataConstants.OPTIONAL_NAME`-- The element can optionally have a name, but a name is not required.
- `MetaDataConstants.REQUIRED_NAME`-- The element must have a name.

Returns:
  the name option

### isPropertyVisible

boolean isPropertyVisible(String propName)
Checks whether the property is visible to the property sheet.

Parameters:
  `propName` - the property name
Returns:
  `true` if the element definition has the property definition and it is visible, `false` otherwise.

### isPropertyReadOnly

boolean isPropertyReadOnly(String propName)
Checks whether the property value is read-only in the property sheet.

Parameters:
  `propName` - the property name
Returns:
  `true` if the element definition has the property definition and it is readonly, `false` otherwise.

### isKindOf

boolean isKindOf(IElementDefn type)
Determines if the given element type is a kind of this type. It is if either the given type is the same as this one, or if the given type derives from this type.

Parameters:
  `type` - The element type to check.
Returns:
  True if it is a kind of this element, false otherwise.

### isExtendedElement

boolean isExtendedElement()
Justifies whether this definition is extension element.

Returns:
  true if it is extension element