|
COSMOS ${releaseVersion} resource-modeling Project Internal API Specification |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.cosmos.rm.repository.internal.SMLRepositoryUtil
public class SMLRepositoryUtil
Consists of common utility methods
| Constructor Summary | |
|---|---|
SMLRepositoryUtil()
|
|
| Method Summary | |
|---|---|
static void |
appendSMLIFIdentityInformation(java.lang.StringBuffer buffer,
org.eclipse.cosmos.rm.repository.provisional.resource.ISMLIFIdentity identity)
Create the starting tags to a new SML-IF file, including the identity information, and append them to the string buffer. |
static java.lang.String |
extractReference(org.w3c.dom.Node root)
Extracts the text node representing the SML document reference from the root node passed in. |
static java.lang.String |
firstSegment(java.lang.String path,
int index)
Returns the index-th segment of path starting from the beginning. |
static java.lang.String |
getAlternativeId(org.eclipse.cosmos.rm.repository.provisional.core.ISMLRepository repository,
java.lang.String id)
A document can have two alternative IDs: one relative to the context root directory or an absolute path from the the context directory. |
static java.lang.String |
getDocumentName(org.eclipse.cosmos.rm.repository.provisional.resource.ISMLDocument document)
Returns the document's id relative to the context root directory |
static java.lang.String |
getDocumentPath(org.eclipse.cosmos.rm.repository.provisional.resource.ISMLDocument document)
Returns the full document's id (i.e. an absolute path) |
static boolean |
isNullOrEmpty(java.lang.String string)
Returns a flag indicating if the passed in string is null or an empty string |
static java.lang.String |
retrieveAlias(org.eclipse.cosmos.rm.repository.provisional.resource.ISMLDocument document,
java.util.Map aliases)
Retrieves the first alias of the document passed in. |
static ISMLResourceFacet[] |
retrieveFacets(ISMLResourceInstance document,
org.w3c.dom.Node root,
org.eclipse.cosmos.rm.repository.provisional.core.ISMLRepository repository)
Retrieves and returns the facets of 'root'. |
static ISMLResourceProperty[] |
retrieveProperties(org.eclipse.cosmos.rm.repository.provisional.core.ISMLRepository repository,
ISMLResourceInstance document,
org.w3c.dom.Node root)
Retrieves and returns the properties of 'root'. |
static ISMLResourceInstance[] |
retrieveResources(org.w3c.dom.Node root,
org.eclipse.cosmos.rm.repository.provisional.core.ISMLRepository repository)
Retrieves and returns the resources of 'root'. |
static java.lang.String |
retrieveRootAttribute(org.w3c.dom.Node node,
java.lang.String uri,
java.lang.String localName)
Retrieve the value of the attribute with the name space and local name passed in |
static java.lang.String[] |
tokenizeQualifiedName(java.lang.String name)
Tokenizes the qualified name passed in into two tokens: the prefix and the local name. |
static java.lang.String[] |
toStringArray(java.util.Collection map)
Converts the map into an String array. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SMLRepositoryUtil()
| Method Detail |
|---|
public static java.lang.String extractReference(org.w3c.dom.Node root)
root - The root node
public static ISMLResourceFacet[] retrieveFacets(ISMLResourceInstance document,
org.w3c.dom.Node root,
org.eclipse.cosmos.rm.repository.provisional.core.ISMLRepository repository)
document - The resource instanceroot - The root noderepository - The repository
public static ISMLResourceProperty[] retrieveProperties(org.eclipse.cosmos.rm.repository.provisional.core.ISMLRepository repository,
ISMLResourceInstance document,
org.w3c.dom.Node root)
repository - The repositorydocument - The parent documentroot - The root node that will be used as the context
public static ISMLResourceInstance[] retrieveResources(org.w3c.dom.Node root,
org.eclipse.cosmos.rm.repository.provisional.core.ISMLRepository repository)
root - The root node that will be used as the contextrepository - The repository
public static java.lang.String retrieveRootAttribute(org.w3c.dom.Node node,
java.lang.String uri,
java.lang.String localName)
node - The context nodeuri - The name space URIlocalName - The local name
public static java.lang.String firstSegment(java.lang.String path,
int index)
path - The pathindex - The index of the segment
public static boolean isNullOrEmpty(java.lang.String string)
string - The string to be checked
public static void appendSMLIFIdentityInformation(java.lang.StringBuffer buffer,
org.eclipse.cosmos.rm.repository.provisional.resource.ISMLIFIdentity identity)
buffer - The string buffer to append the data toidentity - The SML-IF identity
public static java.lang.String getAlternativeId(org.eclipse.cosmos.rm.repository.provisional.core.ISMLRepository repository,
java.lang.String id)
repository - The repositoryid - The id of the document
public static java.lang.String getDocumentName(org.eclipse.cosmos.rm.repository.provisional.resource.ISMLDocument document)
document - The document
public static java.lang.String getDocumentPath(org.eclipse.cosmos.rm.repository.provisional.resource.ISMLDocument document)
document - The document
public static java.lang.String[] tokenizeQualifiedName(java.lang.String name)
name - The qualified name (expected to be in the format
public static java.lang.String retrieveAlias(org.eclipse.cosmos.rm.repository.provisional.resource.ISMLDocument document,
java.util.Map aliases)
document - The documentaliases - Document aliases indexed by document id
public static java.lang.String[] toStringArray(java.util.Collection map)
List of String
map - The map to be converted
|
COSMOS ${releaseVersion} resource-modeling Project Internal API Specification |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||