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.
Related Topics
PropertySet
ConfigurableEntity
AbstractPropertyDefinition
AbstractPropertyDefinition
Field Summary |
public static final int |
|
public static final int |
|
public static final int |
|
public static final int |
|
public static final int |
|
public static final int |
|
Method Summary |
public |
|
public |
|
public |
|
public int |
|
public boolean |
|
public boolean |
|
public void |
Field Detail |
public static final int BOOLEAN
public static final int DATETIME
public static final int FLOAT
public static final int INTEGER
public static final int TEXT
public static final int USER_DEFINED
Method Detail |
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.
public String
getDescription()
Get the description of this property
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.
public int getType()Get the datatype of the property
public boolean isMultiValued()Can this property support multiple values?
public boolean isRestricted()Is this property restricted to a certain list of values?
public void validate(Check to see if a value is valid for this property definition.Object
value)
throwsPropertyValidationException
PropertyValidationException