COSMOS ${releaseVersion} resource-modeling Project
Internal API Specification

org.eclipse.cosmos.rm.repository.internal.application.impl
Class SMLResourceProperty

java.lang.Object
  extended by org.eclipse.cosmos.rm.repository.internal.resource.SMLDocumentFragment
      extended by org.eclipse.cosmos.rm.repository.internal.application.impl.AbstractSMLFragment
          extended by org.eclipse.cosmos.rm.repository.internal.application.impl.SMLResourceProperty
All Implemented Interfaces:
ISMLResourceBase, ISMLResourceProperty, org.eclipse.cosmos.rm.repository.provisional.resource.ISMLDocumentFragment

public class SMLResourceProperty
extends AbstractSMLFragment
implements ISMLResourceProperty

An implementation of a resource property. A property is usually strongly-typed and the client is expected to be aware of how to interpret a property belonging to a facet. #load(Node) should be used to instantiate an instance of this class.


Method Summary
protected  org.w3c.dom.Node getRootNode()
          Returns the node that will be used as the context.
 boolean isReference()
          Indicates whether this item is a reference or not
static ISMLResourceProperty load(org.eclipse.cosmos.rm.repository.provisional.core.ISMLRepository repository, org.w3c.dom.Node root)
          Instantiate an instance of this class based on the DOM node passed in.
 ISMLResourceProperty resolveReference()
          If this object happens to represent a reference to a property (i.e. isReference() returns true), then this method will have it resolved to the actual property.
 java.lang.String[] retrieveAttributes()
          Retrieves and returns the attributes of this property
 ISMLResourceProperty[] retrieveChildren()
          Retrieves the children of this property if it has any An empty array is returned if this property does not have any children.
 java.lang.String retrievePropertyName()
          Returns the property name of this object
 java.lang.String retrieveValue(java.lang.String attribute)
          Retrieves the value of the attribute with the name that is passed in.
 
Methods inherited from class org.eclipse.cosmos.rm.repository.internal.application.impl.AbstractSMLFragment
retrieveDescription, retrieveDisplayName, retrieveName
 
Methods inherited from class org.eclipse.cosmos.rm.repository.internal.resource.SMLDocumentFragment
getNodeList, getParentDocument, setNodeList, setParentDocument
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.cosmos.rm.repository.provisional.resource.ISMLDocumentFragment
getNodeList, getParentDocument
 
Methods inherited from interface org.eclipse.cosmos.rm.repository.internal.application.ISMLResourceBase
retrieveDescription, retrieveDisplayName, retrieveName
 

Method Detail

load

public static ISMLResourceProperty load(org.eclipse.cosmos.rm.repository.provisional.core.ISMLRepository repository,
                                        org.w3c.dom.Node root)
Instantiate an instance of this class based on the DOM node passed in.

Parameters:
node - The property node
Returns:
An instance of this class if node represents a property node; null otherwise

resolveReference

public ISMLResourceProperty resolveReference()
Description copied from interface: ISMLResourceProperty
If this object happens to represent a reference to a property (i.e. isReference() returns true), then this method will have it resolved to the actual property. If isReference() happens to return false, then the return value of this method is this object.

Specified by:
resolveReference in interface ISMLResourceProperty
Returns:
An object representing the resolved property that this reference points to
See Also:
ISMLResourceProperty.resolveReference()

isReference

public boolean isReference()
Description copied from interface: ISMLResourceBase
Indicates whether this item is a reference or not

Specified by:
isReference in interface ISMLResourceBase
Returns:
true if this item is a reference; false otherwise
See Also:
ISMLResourceBase.isReference()

getRootNode

protected org.w3c.dom.Node getRootNode()
Description copied from class: AbstractSMLFragment
Returns the node that will be used as the context.

Specified by:
getRootNode in class AbstractSMLFragment
Returns:
The root node
See Also:
AbstractSMLFragment.getRootNode()

retrieveAttributes

public java.lang.String[] retrieveAttributes()
Description copied from interface: ISMLResourceProperty
Retrieves and returns the attributes of this property

Specified by:
retrieveAttributes in interface ISMLResourceProperty
Returns:
The attributes of this property
See Also:
ISMLResourceProperty.retrieveAttributes()

retrieveChildren

public ISMLResourceProperty[] retrieveChildren()
Description copied from interface: ISMLResourceProperty
Retrieves the children of this property if it has any An empty array is returned if this property does not have any children.

Specified by:
retrieveChildren in interface ISMLResourceProperty
Returns:
The children of this property
See Also:
ISMLResourceProperty.retrieveChildren()

retrievePropertyName

public java.lang.String retrievePropertyName()
Description copied from interface: ISMLResourceProperty
Returns the property name of this object

Specified by:
retrievePropertyName in interface ISMLResourceProperty
Returns:
the property name
See Also:
ISMLResourceProperty.retrievePropertyName()

retrieveValue

public java.lang.String retrieveValue(java.lang.String attribute)
Description copied from interface: ISMLResourceProperty
Retrieves the value of the attribute with the name that is passed in.

Specified by:
retrieveValue in interface ISMLResourceProperty
Parameters:
attribute - The attribute name
Returns:
The value if of the attribute if it exists; null othewise
See Also:
ISMLResourceProperty.retrieveValue(java.lang.String)

COSMOS ${releaseVersion} resource-modeling Project
Internal API Specification