|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.actf.model.AbstractModel
public abstract class AbstractModel
provides basic services for any model instance. Note that the IRenderableModel interface must be implemented as well by clients that wish to validate structures via validation documents using the ACTF Engine.
IRenderableModel
Field Summary | |
---|---|
protected String |
baseType
|
protected IConfiguration |
configuration
|
protected INodeLocator |
locator
|
protected Properties |
nodeToTypeNameMap
|
protected IRuntimeContext |
runtimeContext
|
protected ITreeNodeWalker |
treeNodeWalker
|
Constructor Summary | |
---|---|
AbstractModel(String type)
create a new model |
Method Summary | |
---|---|
void |
addModelChangeListener(IModelChangeListener listener)
adds a listener to receive notifications when this model's structure or properties of its nodes are changed |
protected void |
fireModelChangeEvent(ModelChangeEvent mce)
fire a ModelChangeEvent notification for this model |
String |
getBaseType()
|
String |
getDefaultAliasPrefix()
returns the default alias prefix. |
String |
getName()
return the type of the model. |
String |
getNodeId(Object element)
default implementation returns the hexadecimal representation of System.identityHashCode of the given element. |
INodeLocator |
getNodeLocator()
retrieves a locator for finding and identifying nodes in the model. |
String |
getNodeName(Object element)
return the short name of this element. returns the qualified class name (i.e. without the package name) of the given element |
INodeWalker |
getNodeWalker()
retrieve the NodeWalker for traversing elements in this model |
int |
getOrder(Object head)
get the order of the graph-based model starting at the given head. |
String |
getTypeName(String nodeName)
returns the type name associated with this nodeName. returns the original class name from which this node name was derived or, if unsuccessful, tries to form the correct class based on the package names associated with this implementation |
void |
removeModelChangeListener(IModelChangeListener listener)
remove the given listener from the list of listeners to be notified when this model is updated |
protected void |
setFilters()
|
protected void |
setModelType(String type)
|
void |
setNodeID(Object comp,
String id)
set the id for a component in the model |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.actf.model.IModel |
---|
getPackageNames |
Field Detail |
---|
protected IConfiguration configuration
protected IRuntimeContext runtimeContext
protected INodeLocator locator
protected ITreeNodeWalker treeNodeWalker
protected String baseType
protected Properties nodeToTypeNameMap
Constructor Detail |
---|
public AbstractModel(String type)
type
- - type of modelMethod Detail |
---|
public String getName()
org.eclipse.actf.core.config.Configuration
.
getName
in interface IModel
IConfiguration
protected void setModelType(String type)
public void setNodeID(Object comp, String id)
setNodeID
in interface IModel
comp
- - component for which id is to be setid
- - id for componentpublic String getNodeId(Object element)
System.identityHashCode
of the given element.
getNodeId
in interface IModel
element
- - element for which id is desired
System.identityHashCode(Object)
public String getNodeName(Object element)
getNodeName
in interface IModel
element
- - element for which name is desired
null
if not availablepublic String getTypeName(String nodeName)
getNodeName
. The name returned identifies
the type that is represented by this node name in the graph.
If the specified nodeName was not obtained from getNodeName
, then
implementers should make a rough guess regarding the underlying type on the basis of the package names
associated with this model via getPackageNames
.
getTypeName
in interface IModel
nodeName
- - as returned by getNodeName
#getNodeName(Object)Object)
,
IModel.getPackageNames()
public String getDefaultAliasPrefix()
getDefaultAliasPrefix
in interface IModel
public INodeWalker getNodeWalker()
NodeWalker
for traversing elements in this model
getNodeWalker
in interface IModel
null
if
no walker is availablepublic INodeLocator getNodeLocator()
getNodeLocator
in interface IModel
public void addModelChangeListener(IModelChangeListener listener)
addModelChangeListener
in interface IModel
listener
- - listener to be notified of updates to the modelpublic void removeModelChangeListener(IModelChangeListener listener)
removeModelChangeListener
in interface IModel
listener
- - listener to be removedprotected void fireModelChangeEvent(ModelChangeEvent mce)
mce
- the ModelChangeEvent
The method triggered will vary
depending on the event type: NODE_INSERTED, NODE_REMOVED,
NODE_MODIFIEDprotected void setFilters()
public String getBaseType()
getBaseType
in interface IModel
public int getOrder(Object head)
IModel
getOrder
in interface IModel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |