# com.bea.content
PropertyDefinition Class

public class PropertyDefinition
extends `ContentEntity`

PropertyDefinition defines the shape of a Property. It describes the Property type (binary, boolean, string, double, calendar, long), whether it is required, whether it is editable, the default value and restricted values, if applicable.

A PropertyDefinition may contain a PropertyChoice array. This is a list of values that may be selected for a Property's values.

Rules for a PropertyDefinition are as follows.

- If the PropertyDefinition contains a reference, it may not be multi-valued, or binary.
- If the PropertyDefinition is binary, it may not be multi-valued or restricted and may only have one PropertyChoice.
- If the PropertyDefinition is boolean, it may not be multi-valued.
- If the PropertyDefinition is restricted then the Property's value(s) must be contained in the PropertyChoice list. For example: consider a PropertyDefinition named "color". It has PropertyChoices "blue", "green", and "red". If the PropertyDefinition is restricted then the value of a Property defined by this PropertyDefinition may not have a value that isn't "green", "red", or "blue".

  Hierarchy
    `Object`
    `ContentEntity`
    `PropertyDefinition`
  All Implemented Interfaces
    `Serializable`

  ## Field Summary

  Fields from com.bea.content`.`ContentEntity``
  ``id``

  ## Constructor Summary

  PropertyDefinition(`ID` id, `String` name, `String` reference, int type, boolean isReadOnly, boolean isRestricted, boolean isMandatory, boolean isMultiValued, boolean isPrimary, `String` description) Constructs PropertyDefinition without PropertyChoices.
  PropertyDefinition(`PropertyChoice` propertyChoices, `ID` id, `String` name, `String` reference, int type, boolean isReadOnly, boolean isRestricted, boolean isMandatory, boolean isMultiValued, boolean isPrimary, `String` description) Constructs the PropertyDefinition with all attributes.

  ## Method Summary

  `public `String`` | `getDescription`() Gets the description.
  `public `String`` | `getName`() Returns the name of this PropertyDefinition.
  `public `PropertyChoice`[]` | `getPropertyChoices`() Returns the array of PropertyChoices.
  `public `String`` | `getReference`() Returns a means by which all Properties for this PropertyDefinition may be referenced.In the BEA Repository, this is the column name for an explicit property.
  `public int` | `getType`() Gets the defined data type.
  `public boolean` | `isMandatory`() Returns true if a value for the Property is required.
  `public void` | `isMandatory`(boolean isMandatory) Set to true if a value for the Property is required, or false otherwise.
  `public boolean` | `isMultiValued`() Returns true if the Property can have multiple values.
  `public void` | `isMultiValued`(boolean isMultiValued) Set to true if the Property can have multiple values, false otherwise.
  `public boolean` | `isPrimary`() Returns true if this PropertyDefinition represents the primary PropertyDefinition for its ObjectClass.
  `public void` | `isPrimary`(boolean isPrimary) Set to true if this PropertyDefinition represents the primary PropertyDefinition for its ObjectClass.
  `public boolean` | `isReadOnly`() Returns true if a value for the Property can be edited.
  `public void` | `isReadOnly`(boolean isReadOnly) Set to true if a value for the Property can be edited, or false otherwise.
  `public boolean` | `isRestricted`() Returns true if a value for the Property is restricted to the available choices.
  `public void` | `isRestricted`(boolean isRestricted) Set to true if a value for the Property is restricted to the available choices, or false otherwise.
  `public void` | `setDescription`(`String` description) Sets the description.
  `public void` | `setName`(`String` name) Sets the name of this PropertyDefinition.
  `public void` | `setPropertyChoices`(`PropertyChoice`[] propertyChoices) Sets the array of PropertyChoices.
  `public void` | `setReference`(`String` reference) Sets a means by which all Properties for this PropertyDefinition may be referenced.
  `public void` | `setType`(int type) Sets the defined data type.
  `public `String`` | `toString`() Returns the PropertyDefinition attributs as a String.

  Methods from `com.bea.content.`ContentEntity``
  ``getId`, `setId`,`

  Methods from class `java.lang.`Object``
  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ## Constructor Detail

  ### PropertyDefinition

      public PropertyDefinition(ID id,
                                String name,
                                String reference,
                                int type,
                                boolean isReadOnly,
                                boolean isRestricted,
                                boolean isMandatory,
                                boolean isMultiValued,
                                boolean isPrimary,
                                String description)

    Constructs PropertyDefinition without PropertyChoices.

  ### PropertyDefinition

      public PropertyDefinition(PropertyChoice[] propertyChoices,
                                ID id,
                                String name,
                                String reference,
                                int type,
                                boolean isReadOnly,
                                boolean isRestricted,
                                boolean isMandatory,
                                boolean isMultiValued,
                                boolean isPrimary,
                                String description)

    Constructs the PropertyDefinition with all attributes.

  ## Method Detail

  ### getDescription() Method

      public String getDescription()

  Gets the description.

  ### getName() Method

      public String getName()

  Returns the name of this PropertyDefinition.

  ### getPropertyChoices() Method

      public PropertyChoice[] getPropertyChoices()

  Returns the array of PropertyChoices.

  ### getReference() Method

      public String getReference()

  Returns a means by which all Properties for this PropertyDefinition may be referenced.In the BEA Repository, this is the column name for an explicit property. Null if no such reference exists.

  ### getType() Method

      public int getType()

  Gets the defined data type.

  ### isMandatory() Method

      public boolean isMandatory()

  Returns true if a value for the Property is required.

  ### isMandatory(boolean) Method

      public void isMandatory(boolean isMandatory)

  Set to true if a value for the Property is required, or false otherwise.

  ### isMultiValued() Method

      public boolean isMultiValued()

  Returns true if the Property can have multiple values.

  ### isMultiValued(boolean) Method

      public void isMultiValued(boolean isMultiValued)

  Set to true if the Property can have multiple values, false otherwise.

  ### isPrimary() Method

      public boolean isPrimary()

  Returns true if this PropertyDefinition represents the primary PropertyDefinition for its ObjectClass. There may only be one primary PropertyDefinition per ObjectClass. The ObjectClass holds the true relationship to the primary PropertyDefinition. This is an indicator to describe that relationship.

  ### isPrimary(boolean) Method

      public void isPrimary(boolean isPrimary)

  Set to true if this PropertyDefinition represents the primary PropertyDefinition for its ObjectClass. There may only be one primary PropertyDefinition per ObjectClass. The ObjectClass holds the true relationship to the primary PropertyDefinition. This is an indicator to describe that relationship.

  ### isReadOnly() Method

      public boolean isReadOnly()

  Returns true if a value for the Property can be edited.

  ### isReadOnly(boolean) Method

      public void isReadOnly(boolean isReadOnly)

  Set to true if a value for the Property can be edited, or false otherwise.

  ### isRestricted() Method

      public boolean isRestricted()

  Returns true if a value for the Property is restricted to the available choices.

  ### isRestricted(boolean) Method

      public void isRestricted(boolean isRestricted)

  Set to true if a value for the Property is restricted to the available choices, or false otherwise.

  ### setDescription(String) Method

      public void setDescription(String description)

  Sets the description.

  ### setName(String) Method

      public void setName(String name)

  Sets the name of this PropertyDefinition.

  ### setPropertyChoices(PropertyChoice[]) Method

      public void setPropertyChoices(PropertyChoice[] propertyChoices)

  Sets the array of PropertyChoices.

  ### setReference(String) Method

      public void setReference(String reference)

  Sets a means by which all Properties for this PropertyDefinition may be referenced. In the BEA Repository, this is the column name for an explicit property.

  ### setType(int) Method

      public void setType(int type)

  Sets the defined data type.

  ### toString() Method

      public String toString()

  Returns the PropertyDefinition attributs as a String.

  Overrides
    `ContentEntity.toString()`