|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IAttribute
As defined at (TODO (Doc): add reference), This interface represents an attribute of an Entity.
An attribute is a typed set of values.
When the attribute's model dictates that it is single-valued isSingleValued()
then this object may be cast to an ISingleValuedAttribute
This extends IHasAttributes so that metadata about the attribute may be presented as
attributes on this attribute.
| Method Summary | |
|---|---|
IEntity |
addComplexValue(String entityID)
Add a reference to the entity with passed entityId. |
IEntity |
addComplexValue(URI type)
Creates a new complex value for this attribute. |
ISimpleValue |
addSimpleValue(URI dataType,
Object data)
Creates a new simple value for this attribute. |
IValue |
addValue(IValue copyFrom)
Creates a new value for this attribute by copying the passed IValue
If passed value is not blank entity (has not null entityId), a reference to
this entity is created. |
IValue |
addValue(URI dataType)
Creates a new value for this attribute. |
IAttributeModel |
getModel()
Returns a model of this type of attribute as it defined in the context's schema. |
URI |
getType()
Returns the attribute type of this attribute as a URI. |
Iterator |
getValues()
Returns all values for this attribute. |
Iterator |
getValues(IExtension[] extensions)
Returns all values for this attribute. |
boolean |
isSingleValued()
Convenience method which returns true when the model for this attribute dictates that only a single value may exist. |
void |
remove()
Removes all values of this attribute. |
| Methods inherited from interface org.eclipse.higgins.idas.api.IHasAttributes |
|---|
addAttribute, addAttribute, addAttributeValue, getAttribute, getAttributes, getSingleValuedAttribute, removeAttribute, removeAttributeValue, removeAttributeValue |
| Method Detail |
|---|
URI getType()
throws IdASException
URI.From this URI, a consumer should be able to derive some kind of human-readable identifier (such as "age", "title", "employeeNumber", etc.).
This attribute type is used to distinguish this attribute from other attributes within a collection of attributes.
Note that IModel.getType() will return the same URI that this method returns.
IdASException
Iterator getValues()
throws IdASException
IValues
IdASException
Iterator getValues(IExtension[] extensions)
throws IdASException
extensions - may be null. One or more extensions valid for this operation.
IValues
IdASException
IValue addValue(URI dataType)
throws IdASException,
InvalidTypeException
addSimpleValue(URI, Object)
or addComplexValue(URI)
This call is typically followed by a call to IValue.isSimple()
on the returned IValue.
When found to be an ISimpleValue, ITypedValue.setData(Object) is typically
called on the returned IValue (cast as an ISimpleValue).
When found to be an IEntity, one typically calls
IHasAttributes.addAttribute(URI) on the returned IValue
(cast as an IEntity or IHasAttributes).
Note: This operation is only applied to any backing data store after
IContext.applyUpdates() is called.
dataType - The URI specifying the data type of Value being created
{@link - IdASException}
{@link - InvalidTypeException} when the type is invalid
IdASException
InvalidTypeException
IValue addValue(IValue copyFrom)
throws IdASException
IValue
If passed value is not blank entity (has not null entityId), a reference to
this entity is created.
Note: This operation is only applied to any backing data store after
IContext.applyUpdates() is called.
copyFrom - The IValue from which data is copied to create the
returned IValue
{@link - IdASException}
IdASException
ISimpleValue addSimpleValue(URI dataType,
Object data)
throws IdASException,
InvalidTypeException
IContext.applyUpdates() is called.
dataType - The URI specifying the type of Value being createddata - The data of the attribute value
{@link - IdASException}
{@link - InvalidTypeException} when the type is invalid
IdASException
InvalidTypeException
IEntity addComplexValue(URI type)
throws IdASException,
InvalidTypeException
IHasAttributes.addAttribute(java.net.URI) on the returned IEntity.
Note: This operation is only applied to any backing data store after
IContext.applyUpdates() is called.
type - The URI specifying the type of complex value being created
{@link - IdASException}
{@link - InvalidTypeException} when the type is invalid
IdASException
InvalidTypeException
IEntity addComplexValue(String entityID)
throws IdASException,
InvalidTypeException
IAttribute#addValue(IValue
entityID -
IdASException
InvalidTypeException
void remove()
throws IdASException
IContext.applyUpdates() is called.
{@link - IdASException}
IdASException
IAttributeModel getModel()
throws IdASException
IdASException
boolean isSingleValued()
throws IdASException
(myAttribute.getModel().getMaxCardinality() == 1)
ISingleValuedAttribute
IdASException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||