Designer 10.5 | Centrasite Eclipse UI Help | Concepts | Attributes | Computed Attributes | Defining a Computed Attribute | Implementation guidelines for Java-based computed attributes
 
Implementation guidelines for Java-based computed attributes
This section describes the Java interfaces and methods that you need to implement for a computed attribute.
Interfaces
Description
ComputedAttribute
This interface declares basic rendering methods for the user interface. It extends the ProfileAttribute interface.
boolean: isUsed(): returns true if this attribute is used by at least one instance of the corresponding asset type.
Collection: setValue(Collection);
ProfileAttribute
void: init(Collection<CentraSiteRegistryObject>, Locale)
Collection: getValue();
String: getAttributeKey();
AttributeDescriptor: getAttributeDescriptor();
AttributeDescriptor
This interface deals with the standard properties (isReadOnly(), is Required()...) for an attribute.
String: getDataType(): returns the data type of this attribute. This can be one of the supported standard types (xs:...), or one of the special types: File, RichText, Image (allows the specification of the image type).
Object: getDefaultValue(): returns the default value of this attribute.
String[]: getEnumValues():
int: getMaxLength(): returns the maximum length of this attribute.
String: getMaxOccurs(): returns whether the attribute can have multiple occurrences.
String: getMinOccurs(): returns whether the attribute is optional or required.
Object: getNativeAttribute(): returns the native attribute instance if the data type is not primitive, otherwise returns null.
int: getPrecision(): gets the precision for a number attribute.
String: getUnitLabel(): returns the slot's unit label.
boolean: hasDefaultValue(): returns whether this attribute has a default value.
boolean: isPrefix(): Returns true if the slot's unit label is a prefix, and false if it is a suffix.
boolean: isReadOnly(): returns whether this attribute is read-only.
boolean: isRequired(): returns whether this attribute is required.