org.eclipse.higgins.idas.spi
Class BasicAttribute
java.lang.Object
org.eclipse.higgins.idas.spi.BasicAttribute
- All Implemented Interfaces:
- org.eclipse.higgins.idas.api.IAttribute, IAttributeContainer, IAttributeValueContainer, org.eclipse.higgins.idas.api.IHasAttributes
- Direct Known Subclasses:
- BasicSingleValuedAttribute
- public class BasicAttribute
- extends Object
- implements org.eclipse.higgins.idas.api.IAttribute, IAttributeValueContainer, IAttributeContainer
Implements IAttribute using BasicAttribute
and BasicAttributeSet
Constructor Summary |
BasicAttribute(org.eclipse.higgins.idas.api.IAttribute copyFrom,
IAttributeContainer container,
org.eclipse.higgins.idas.api.IContext context)
Note that the container's updateNotification is not called while
the values in copyFrom are being copied. |
BasicAttribute(URI attrID,
org.eclipse.higgins.idas.api.IAttributeValue value,
IAttributeContainer container,
org.eclipse.higgins.idas.api.IContext context)
|
BasicAttribute(URI attrID,
Iterator values,
IAttributeContainer container,
org.eclipse.higgins.idas.api.IContext context)
Note that the container's updateNotification is not called while
the IValues in values are being added. |
BasicAttribute(URI attrID,
Object data,
IAttributeContainer container,
org.eclipse.higgins.idas.api.IContext context)
|
BasicAttribute
public BasicAttribute(org.eclipse.higgins.idas.api.IAttribute copyFrom,
IAttributeContainer container,
org.eclipse.higgins.idas.api.IContext context)
throws org.eclipse.higgins.idas.api.IdASException
- Note that the container's updateNotification is not called while
the values in copyFrom are being copied.
- Parameters:
copyFrom
- IAttribute from which to copy data fromcontainer
- May be null. IAttributeContainer to send update notifications to.context
- May be null. IContext instance from which a model may be obtained if needed.
- Throws:
org.eclipse.higgins.idas.api.IdASException
BasicAttribute
public BasicAttribute(URI attrID,
org.eclipse.higgins.idas.api.IAttributeValue value,
IAttributeContainer container,
org.eclipse.higgins.idas.api.IContext context)
throws org.eclipse.higgins.idas.api.IdASException
- Parameters:
attrID
- the URI of the attribute's typevalue
- an IAttributeValue (either simple or complex) to store with the attributecontainer
- May be null. IAttributeContainer to send update notifications to.context
- May be null. IContext instance from which a model may be obtained if needed.
- Throws:
org.eclipse.higgins.idas.api.IdASException
BasicAttribute
public BasicAttribute(URI attrID,
Object data,
IAttributeContainer container,
org.eclipse.higgins.idas.api.IContext context)
throws org.eclipse.higgins.idas.api.IdASException
- Parameters:
attrID
- the URI of the attribute's typedata
- an Object to be used as a value for attribute.
The Object is the data from which an ISimpleAttrValue
will be created. We do this by looking at the model for the attribute (specified in attrID)
and associating that with the type of data object that is expected.
If the value passed is of the wrong type, the constructor will fail.
Note that this assumes the data will be used to construct a simple
value, not a complex value. If one wishes to construct a BasicAttribute with a
complex value, then #BasicAttribute(URI, IAttributeValue, IAttributeContainer)
is called.container
- for purposes of notification of updates, the container of this attribute.
May be null when there is no containing objectcontext
- May be null. IContext instance from which a model may be obtained if needed.
- Throws:
org.eclipse.higgins.idas.api.IdASException
BasicAttribute
public BasicAttribute(URI attrID,
Iterator values,
IAttributeContainer container,
org.eclipse.higgins.idas.api.IContext context)
throws org.eclipse.higgins.idas.api.IdASException
- Note that the container's updateNotification is not called while
the IValues in values are being added.
- Parameters:
attrID
- values
- Contains IAttributeValue
scontainer
- May be null. IAttributeContainer to send update notifications to.context
- May be null. IContext instance from which a model may be obtained if needed.
- Throws:
org.eclipse.higgins.idas.api.IdASException
getAttrID
public URI getAttrID()
throws org.eclipse.higgins.idas.api.IdASException
- Specified by:
getAttrID
in interface org.eclipse.higgins.idas.api.IAttribute
- Throws:
org.eclipse.higgins.idas.api.IdASException
getValues
public Iterator getValues()
throws org.eclipse.higgins.idas.api.IdASException
- Specified by:
getValues
in interface org.eclipse.higgins.idas.api.IAttribute
- Throws:
org.eclipse.higgins.idas.api.IdASException
getModel
public org.eclipse.higgins.idas.api.model.IAttributeModel getModel()
throws org.eclipse.higgins.idas.api.IdASException
- Specified by:
getModel
in interface org.eclipse.higgins.idas.api.IAttribute
- Throws:
org.eclipse.higgins.idas.api.IdASException
addComplexValue
public org.eclipse.higgins.idas.api.IComplexAttrValue addComplexValue(URI type)
throws org.eclipse.higgins.idas.api.IdASException,
org.eclipse.higgins.idas.api.InvalidTypeException
- Specified by:
addComplexValue
in interface org.eclipse.higgins.idas.api.IAttribute
- Throws:
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.InvalidTypeException
addSimpleValue
public org.eclipse.higgins.idas.api.ISimpleAttrValue addSimpleValue(URI type,
Object data)
throws org.eclipse.higgins.idas.api.IdASException,
org.eclipse.higgins.idas.api.InvalidTypeException
- Specified by:
addSimpleValue
in interface org.eclipse.higgins.idas.api.IAttribute
- Throws:
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.InvalidTypeException
addValue
public org.eclipse.higgins.idas.api.IAttributeValue addValue(URI type)
throws org.eclipse.higgins.idas.api.IdASException,
org.eclipse.higgins.idas.api.InvalidTypeException
- Specified by:
addValue
in interface org.eclipse.higgins.idas.api.IAttribute
- Throws:
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.InvalidTypeException
addValue
public org.eclipse.higgins.idas.api.IAttributeValue addValue(org.eclipse.higgins.idas.api.IAttributeValue copyFrom)
throws org.eclipse.higgins.idas.api.IdASException
- Specified by:
addValue
in interface org.eclipse.higgins.idas.api.IAttribute
- Throws:
org.eclipse.higgins.idas.api.IdASException
remove
public void remove()
throws org.eclipse.higgins.idas.api.IdASException
- Specified by:
remove
in interface org.eclipse.higgins.idas.api.IAttribute
- Throws:
org.eclipse.higgins.idas.api.IdASException
isSingleValued
public boolean isSingleValued()
- Specified by:
isSingleValued
in interface org.eclipse.higgins.idas.api.IAttribute
updateNotification
public void updateNotification(AttributeValueNotification attrValueNotif)
throws org.eclipse.higgins.idas.api.IdASException
- Specified by:
updateNotification
in interface IAttributeValueContainer
- Parameters:
attrValueNotif
-
- Throws:
org.eclipse.higgins.idas.api.IdASException
setContainer
public void setContainer(IAttributeContainer container)
getContainer
public IAttributeContainer getContainer()
equals
public boolean equals(org.eclipse.higgins.idas.api.IAttribute attr)
throws org.eclipse.higgins.idas.api.IdASException
- Specified by:
equals
in interface org.eclipse.higgins.idas.api.IAttribute
- Throws:
org.eclipse.higgins.idas.api.IdASException
addAttribute
public org.eclipse.higgins.idas.api.IAttribute addAttribute(URI attrID)
throws org.eclipse.higgins.idas.api.IdASException,
org.eclipse.higgins.idas.api.InvalidTypeException
- Specified by:
addAttribute
in interface org.eclipse.higgins.idas.api.IHasAttributes
- Throws:
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.InvalidTypeException
addAttribute
public org.eclipse.higgins.idas.api.IAttribute addAttribute(org.eclipse.higgins.idas.api.IAttribute copyFrom)
throws org.eclipse.higgins.idas.api.IdASException
- Specified by:
addAttribute
in interface org.eclipse.higgins.idas.api.IHasAttributes
- Throws:
org.eclipse.higgins.idas.api.IdASException
equals
public boolean equals(org.eclipse.higgins.idas.api.IHasAttributes attributes)
throws org.eclipse.higgins.idas.api.IdASException
- Specified by:
equals
in interface org.eclipse.higgins.idas.api.IHasAttributes
- Throws:
org.eclipse.higgins.idas.api.IdASException
getAttribute
public org.eclipse.higgins.idas.api.IAttribute getAttribute(URI attrID)
throws org.eclipse.higgins.idas.api.IdASException
- Specified by:
getAttribute
in interface org.eclipse.higgins.idas.api.IHasAttributes
- Throws:
org.eclipse.higgins.idas.api.IdASException
getAttributes
public Iterator getAttributes()
throws org.eclipse.higgins.idas.api.IdASException
- Specified by:
getAttributes
in interface org.eclipse.higgins.idas.api.IHasAttributes
- Throws:
org.eclipse.higgins.idas.api.IdASException
getSingleValuedAttribute
public org.eclipse.higgins.idas.api.ISingleValuedAttribute getSingleValuedAttribute(URI attrID)
throws org.eclipse.higgins.idas.api.IdASException,
org.eclipse.higgins.idas.api.NotSingleValuedAttributeException
- Specified by:
getSingleValuedAttribute
in interface org.eclipse.higgins.idas.api.IHasAttributes
- Throws:
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.NotSingleValuedAttributeException
removeAttribute
public void removeAttribute(URI attrID)
throws org.eclipse.higgins.idas.api.IdASException
- Specified by:
removeAttribute
in interface org.eclipse.higgins.idas.api.IHasAttributes
- Throws:
org.eclipse.higgins.idas.api.IdASException
removeAttributeValue
public void removeAttributeValue(URI attrID,
Object value)
throws org.eclipse.higgins.idas.api.IdASException
- Specified by:
removeAttributeValue
in interface org.eclipse.higgins.idas.api.IHasAttributes
- Throws:
org.eclipse.higgins.idas.api.IdASException
removeAttributeValue
public void removeAttributeValue(org.eclipse.higgins.idas.api.IAttribute attr)
throws org.eclipse.higgins.idas.api.IdASException
- Specified by:
removeAttributeValue
in interface org.eclipse.higgins.idas.api.IHasAttributes
- Throws:
org.eclipse.higgins.idas.api.IdASException
updateNotification
public void updateNotification(AttributeNotification attrNotif)
throws org.eclipse.higgins.idas.api.IdASException
- Specified by:
updateNotification
in interface IAttributeContainer
- Parameters:
attrNotif
-
- Throws:
org.eclipse.higgins.idas.api.IdASException
getValues
public Iterator getValues(org.eclipse.higgins.idas.api.IExtension[] extensions)
throws org.eclipse.higgins.idas.api.IdASException
- Specified by:
getValues
in interface org.eclipse.higgins.idas.api.IAttribute
- Throws:
org.eclipse.higgins.idas.api.IdASException