Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2004 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.p13n.property
Interface PropertyDefinition

All Known Implementing Classes:
  AbstractPropertyDefinition

public interface PropertyDefinition

Public interface for a property definition. A property definition is meta-data about a property that might be set on a Configurable Entity. It contains information such as the property's datatype, a default value, whether it is restricted to a set of allowable values, and whether it supports multiple values.

The property type constants here are imported from `com.beasys.commerce.util.TypesHelper`, and are duplicated here for convenience, and in case TypesHelper is not included in future releases.

You can use the no-arg constructor for the internal class com.bea.p13n.property.internal.PropertyDefinitionImpl when creating a PropertyDefinition. PropertyDefinitionImpl extends com.bea.p13n.property.AbstractPropertyDefinition. For example:

PropertyDefinitionImpl myPropSetDefImpl = new PropertyDefinitionImpl();
myPropSetDefImpl.setDescription(pdDesc);
myPropSetDefImpl.setMultiValued(pdMV);
myPropSetDefImpl.setRestricted(pdRest);
myPropSetDefImpl.setType(pdType);
myPropSetDefImpl.setDefaultValue(pdDefVal);
myPropSetDefImpl.setRestrictedValues(pdRestVals);

The setType() will use constants described below under the Field Summary Section.

See Also:
  `PropertySet`, `ConfigurableEntity`, `AbstractPropertyDefinition`

Field Summary
`static int` | `BOOLEAN` The constant for a boolean type (0).
`static int` | `DATETIME` The constant for a datetime java.sql.Timestamp type (4).
`static int` | `FLOAT` The constant for the floating-point numeric type (2).
`static int` | `INTEGER` The constant for a numeric type (1).
`static int` | `TEXT` The constant for a text type (3).
`static int` | `USER_DEFINED` The constant for a user defined type (5).

Method Summary
`Object` | `getDefaultValue()` Get the default value for this property.
`String` | `getDescription()` Get the description of this property
`Collection` | `getRestrictedValues()` Get the allowable values, if this property is restricted.
`int` | `getType()` Get the datatype of the property
`boolean` | `isMultiValued()` Can this property support multiple values?
`boolean` | `isRestricted()` Is this property restricted to a certain list of values?
`void` | `validate(Object value)` Check to see if a value is valid for this property definition.

Field Detail

### BOOLEAN

    public static final int BOOLEAN

  The constant for a boolean type (0).

  See Also:
    Constant Field Values

### DATETIME

    public static final int DATETIME

  The constant for a datetime java.sql.Timestamp type (4).

  See Also:
    Constant Field Values

### FLOAT

    public static final int FLOAT

  The constant for the floating-point numeric type (2).

  See Also:
    Constant Field Values

### INTEGER

    public static final int INTEGER

  The constant for a numeric type (1).

  See Also:
    Constant Field Values

### TEXT

    public static final int TEXT

  The constant for a text type (3).

  See Also:
    Constant Field Values

### USER_DEFINED

    public static final int USER_DEFINED

  The constant for a user defined type (5).

  See Also:
    Constant Field Values

Method Detail

### getDefaultValue

    public Object getDefaultValue()

  Get the default value for this property. If it is multivalued, this might be a collection of values. Note: this returns a clone of the default value; if it is a collection, and the property values are mutable objects, care must be taken not to modify them.

  Returns:
    the default value, or null if there is none

### getDescription

    public String getDescription()

  Get the description of this property

### getRestrictedValues

    public Collection getRestrictedValues()

  Get the allowable values, if this property is restricted. Note: this does a shallow clone to prevent the collection from being modified, but if any property values are mutable, care must be taken not to modify them.

  Returns:
    a Collection of allowable values, or null if there are none

### getType

    public int getType()

  Get the datatype of the property

### isMultiValued

    public boolean isMultiValued()

  Can this property support multiple values?

### isRestricted

    public boolean isRestricted()

  Is this property restricted to a certain list of values?

### validate

    public void validate(Object value)
                  throws PropertyValidationException

  Check to see if a value is valid for this property definition.

  Throws:
    `PropertyValidationException` - if the value is not valid.

Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2004 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 BEA Systems, Inc. All Rights Reserved