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

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

java.lang.Object
  extended by org.eclipse.cosmos.rm.repository.internal.resource.SMLFileDocument
      extended by org.eclipse.cosmos.rm.repository.internal.resource.SMLFileInstanceDocument
          extended by org.eclipse.cosmos.rm.repository.internal.application.impl.SMLFileResourceInstance
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable, ISMLResourceBase, ISMLResourceInstance, org.eclipse.cosmos.rm.repository.provisional.resource.ISMLDocument, org.eclipse.cosmos.rm.repository.provisional.resource.ISMLInstanceDocument

public class SMLFileResourceInstance
extends SMLFileInstanceDocument
implements ISMLResourceInstance

The implementation of an SML document representing a resource

See Also:
Serialized Form

Constructor Summary
SMLFileResourceInstance(org.eclipse.cosmos.rm.repository.provisional.core.ISMLRepository repository, org.eclipse.cosmos.rm.repository.provisional.resource.ISMLDocument delegate)
          Constructor
SMLFileResourceInstance(org.eclipse.cosmos.rm.repository.provisional.core.ISMLRepository repository, java.lang.String reference)
          The constructor
 
Method Summary
 org.w3c.dom.Document getDOMDocument()
           
 org.eclipse.cosmos.rm.repository.provisional.resource.ISMLMetadata getMetadata()
          Returns the meta-data associated with this document
 org.eclipse.cosmos.rm.repository.provisional.core.ISMLRepository getRepository()
           
 boolean isReference()
          Indicates whether this item is a reference or not
 ISMLResourceInstance resolveReference()
          If this object happens to represent a reference to a resource (i.e. isReference() returns true), then this method will have it resolved to the actual resource.
 java.lang.String retrieveDescription()
          Retrieves and returns the description of this item
 java.lang.String retrieveDisplayName()
          Retrieves and returns the display name of this item
 ISMLResourceFacet[] retrieveFacets()
          Retrieves and returns the set of root level facets that are included as part of this resource
 java.lang.String retrieveName()
          Retrieves and returns the name of this item
 java.lang.String retrieveRootAttribute(java.lang.String uri, java.lang.String localName)
          Retrieves and returns the root node's attribute value with the URI and local name passed in.
 
Methods inherited from class org.eclipse.cosmos.rm.repository.internal.resource.SMLFileInstanceDocument
compareTo, retrieveDefinition, retrieveReferences, toString
 
Methods inherited from class org.eclipse.cosmos.rm.repository.internal.resource.SMLFileDocument
equals, getLastModifiedDate, retrieveDocumentFragment, setMetadata
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.cosmos.rm.repository.provisional.resource.ISMLInstanceDocument
retrieveDefinition, retrieveReferences
 
Methods inherited from interface org.eclipse.cosmos.rm.repository.provisional.resource.ISMLDocument
retrieveDocumentFragment
 

Constructor Detail

SMLFileResourceInstance

public SMLFileResourceInstance(org.eclipse.cosmos.rm.repository.provisional.core.ISMLRepository repository,
                               java.lang.String reference)
The constructor

Parameters:
repository - The repository
reference - A flag indicating whether this resource is a reference

SMLFileResourceInstance

public SMLFileResourceInstance(org.eclipse.cosmos.rm.repository.provisional.core.ISMLRepository repository,
                               org.eclipse.cosmos.rm.repository.provisional.resource.ISMLDocument delegate)
Constructor

Parameters:
repository - The repository
delegate - The delegate
Method Detail

resolveReference

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

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

retrieveFacets

public ISMLResourceFacet[] retrieveFacets()
                                   throws org.eclipse.cosmos.rm.repository.provisional.exception.RepositoryOperationException
Description copied from interface: ISMLResourceInstance
Retrieves and returns the set of root level facets that are included as part of this resource

Specified by:
retrieveFacets in interface ISMLResourceInstance
Returns:
Root level facets of this resource
Throws:
org.eclipse.cosmos.rm.repository.provisional.exception.RepositoryOperationException
See Also:
ISMLResourceInstance.retrieveFacets()

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()

retrieveName

public java.lang.String retrieveName()
Description copied from interface: ISMLResourceBase
Retrieves and returns the name of this item

Specified by:
retrieveName in interface ISMLResourceBase
Returns:
The name of this item
See Also:
ISMLResourceBase.retrieveName()

retrieveDisplayName

public java.lang.String retrieveDisplayName()
Description copied from interface: ISMLResourceBase
Retrieves and returns the display name of this item

Specified by:
retrieveDisplayName in interface ISMLResourceBase
Returns:
The display name of this item
See Also:
ISMLResourceBase.retrieveDisplayName()

retrieveDescription

public java.lang.String retrieveDescription()
Description copied from interface: ISMLResourceBase
Retrieves and returns the description of this item

Specified by:
retrieveDescription in interface ISMLResourceBase
Returns:
The description of this item
See Also:
ISMLResourceBase.retrieveDescription()

getDOMDocument

public org.w3c.dom.Document getDOMDocument()
                                    throws org.eclipse.cosmos.rm.repository.provisional.exception.RepositoryOperationException
Overrides:
getDOMDocument in class SMLFileDocument
Returns:
the domDocument
Throws:
org.eclipse.cosmos.rm.repository.provisional.exception.RepositoryOperationException
See Also:
SMLFileDocument.getDOMDocument()

getRepository

public org.eclipse.cosmos.rm.repository.provisional.core.ISMLRepository getRepository()
Overrides:
getRepository in class SMLFileDocument
Returns:
the repository
See Also:
SMLFileDocument.getRepository()

retrieveRootAttribute

public java.lang.String retrieveRootAttribute(java.lang.String uri,
                                              java.lang.String localName)
                                       throws org.eclipse.cosmos.rm.repository.provisional.exception.RepositoryOperationException
Description copied from class: SMLFileDocument
Retrieves and returns the root node's attribute value with the URI and local name passed in.

Overrides:
retrieveRootAttribute in class SMLFileDocument
Parameters:
uri - The URI of the attribute
localName - The local name
Returns:
The attribute value
Throws:
org.eclipse.cosmos.rm.repository.provisional.exception.RepositoryOperationException - In case of an error
See Also:
SMLFileDocument.retrieveRootAttribute(java.lang.String, java.lang.String)

getMetadata

public org.eclipse.cosmos.rm.repository.provisional.resource.ISMLMetadata getMetadata()
Description copied from interface: org.eclipse.cosmos.rm.repository.provisional.resource.ISMLDocument
Returns the meta-data associated with this document

Specified by:
getMetadata in interface org.eclipse.cosmos.rm.repository.provisional.resource.ISMLDocument
Overrides:
getMetadata in class SMLFileDocument
Returns:
The meta-data of this document
See Also:
SMLFileDocument.getMetadata()

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