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

org.eclipse.cosmos.rm.repository.internal.resource
Class SMLFileDocument

java.lang.Object
  extended by org.eclipse.cosmos.rm.repository.internal.resource.SMLFileDocument
All Implemented Interfaces:
org.eclipse.cosmos.rm.repository.provisional.resource.ISMLDocument
Direct Known Subclasses:
SMLFileDefinitionDocument, SMLFileInstanceDocument

public abstract class SMLFileDocument
extends java.lang.Object
implements org.eclipse.cosmos.rm.repository.provisional.resource.ISMLDocument

The file system implementation of an SML document.


Constructor Summary
SMLFileDocument(org.eclipse.cosmos.rm.repository.provisional.core.ISMLRepository repository)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 org.w3c.dom.Document getDOMDocument()
           
protected  long getLastModifiedDate()
           
 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()
           
 org.eclipse.cosmos.rm.repository.provisional.resource.ISMLDocumentFragment retrieveDocumentFragment(javax.xml.namespace.NamespaceContext namespaceContext, org.w3c.dom.Node contextNode, java.lang.String xpathExpression)
          Retrieves and returns a document fragment based on the context node and the XPath expression that is passed in.
 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.
 void setMetadata(org.eclipse.cosmos.rm.repository.provisional.resource.ISMLMetadata metadata)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SMLFileDocument

public SMLFileDocument(org.eclipse.cosmos.rm.repository.provisional.core.ISMLRepository repository)
Method Detail

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
Returns:
The meta-data of this document
See Also:
ISMLDocument.getMetadata()

setMetadata

public void setMetadata(org.eclipse.cosmos.rm.repository.provisional.resource.ISMLMetadata metadata)

retrieveDocumentFragment

public org.eclipse.cosmos.rm.repository.provisional.resource.ISMLDocumentFragment retrieveDocumentFragment(javax.xml.namespace.NamespaceContext namespaceContext,
                                                                                                           org.w3c.dom.Node contextNode,
                                                                                                           java.lang.String xpathExpression)
                                                                                                    throws org.eclipse.cosmos.rm.repository.provisional.exception.RepositoryOperationException
Description copied from interface: org.eclipse.cosmos.rm.repository.provisional.resource.ISMLDocument
Retrieves and returns a document fragment based on the context node and the XPath expression that is passed in. The contextNode should be set to null if the XPath should be applied using the root node as the context.

Specified by:
retrieveDocumentFragment in interface org.eclipse.cosmos.rm.repository.provisional.resource.ISMLDocument
Parameters:
namespaceContext - The namespace context used when evaluating the xpath expression
contextNode - The context node for the XPath expression
xpathExpression - The XPath expression
Returns:
The SML fragment resulting from the XPath query
Throws:
org.eclipse.cosmos.rm.repository.provisional.exception.RepositoryOperationException - In case of an error
See Also:
org.eclipse.cosmos.rm.repository.provisional.resource.ISMLDocument#retrieveDocumentFragment(org.w3c.dom.Node, java.lang.String)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

getRepository

public org.eclipse.cosmos.rm.repository.provisional.core.ISMLRepository getRepository()
Returns:
the repository

getLastModifiedDate

protected long getLastModifiedDate()
Returns:
the lastModifiedDate

getDOMDocument

public org.w3c.dom.Document getDOMDocument()
                                    throws org.eclipse.cosmos.rm.repository.provisional.exception.RepositoryOperationException
Returns:
the domDocument
Throws:
org.eclipse.cosmos.rm.repository.provisional.exception.RepositoryOperationException

retrieveRootAttribute

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

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

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