|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Attribute
Contains information defining an attribute.
An Attribute is used to hold a value (ie aggregation), similar to the way a Map.Entry holds values in a java.util.Map. Attribute is responsible for holding onto the following three things:
If this Attribute is contained in another data structure you may use the provided Descriptor. This descriptor will provided any additional information (such as name and multiplicity) needed.
The use of Attribute in our feature model is similar to the use of a "field" in a Java Object. A field also brings together a field name, value and type.Differences from ISO 19107: We do not use TypeName directly, the functionality is served by our AttributeType class which provides additional functionality. AttributeType provides a Name, the java class for our value, and any additional restrictions.
Validation is provided by way of constraints implemented using Filter.
Method Summary | |
---|---|
AttributeDescriptor |
getDescriptor()
Indicates the AttirbuteDescriptor for this content. |
String |
getID()
Unique, immutable identification for domain object being modeled. |
AttributeType |
getType()
Indicate the AttributeType, if we have a descriptor it will be in agreement. |
Object |
getValue()
Access to the content of this Attribute. |
boolean |
nillable()
Determines if the attribute is allowed to have a null value. |
Object |
operation(Name name,
List<Object> parameters)
Call operation on this Attribute. |
void |
setValue(Object newValue)
Set content to newValue |
Methods inherited from interface Property |
---|
descriptor, name |
Method Detail |
---|
AttributeDescriptor getDescriptor()
The attribute descriptor formally captures the name and multiplicity information for this attribute. If this attribute is not contained in a container, then the descriptor will be null.
getDescriptor
in interface Property
boolean nillable()
null
value.
For those attributes which are contained within a complex type (ie. getDescriptor() != null), this method defers to the descriptor
AttributeDescriptor.isNillable()
AttributeType getType()
getType
in interface Property
String getID()
Object getValue()
A subclass may define a more specific method to access this value, in order to improve readability or make allowances for Java 1.4 use.
Object operation(Name name, List<Object> parameters)
this
Attribute.
name
- Name of operation to be calledparameters
- Parameters for the operation
null
void setValue(Object newValue)
newValue
- Object of the class indicated by getType().getBinding()
IllegalArgumentException
- If newValue does not match getType().getBinding()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |