EGF Engine
Release 0.1.0

org.eclipse.egf.common.helper
Class PatternHelper

java.lang.Object
  extended by org.eclipse.egf.common.helper.PatternHelper

public class PatternHelper
extends Object

Helper for pattern handling.


Constructor Summary
PatternHelper()
           
 
Method Summary
static Couple<String,String> deresolveId(String fullId_p)
          Get parent library id and local pattern/library id from given full id.
static String generatePatternUID()
          Create a new pattern unique id.
static String getFullId(String parentLibraryFullId_p, String localId_p)
          Get library/pattern full id from parent library full id and pattern/library id local to this library.
static String getRootLibraryId(String fullId_p)
          Get root library id from given full id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PatternHelper

public PatternHelper()
Method Detail

getFullId

public static String getFullId(String parentLibraryFullId_p,
                               String localId_p)
Get library/pattern full id from parent library full id and pattern/library id local to this library.

Parameters:
parentLibraryFullId_p - The parent library full id.
For instance root/library1/libraryEmf/subLibrary1, or null if none.
patternLocalId_p - The pattern or library id local to the parent full id.
For instance patternClass, or library2/library3.
Returns:
null if local id is null, local id if parent library full id is null.
For instance root/library1/libraryEmf/subLibrary1/patternClass, or root/library1/libraryEmf/subLibrary1/library2/library3.

generatePatternUID

public static String generatePatternUID()
Create a new pattern unique id.

Returns:

deresolveId

public static Couple<String,String> deresolveId(String fullId_p)
Get parent library id and local pattern/library id from given full id.

Parameters:
fullId_p - a pattern or library full id.
For instance root/library1/libraryEmf/subLibrary1 or root/library1/libraryEmf/subLibrary1/patternClass.
Returns:
null if given id is null.
For instance Couple(root/library1/libraryEmf, subLibrary1) or Couple(root/library1/libraryEmf/subLibrary1, patternClass).

getRootLibraryId

public static String getRootLibraryId(String fullId_p)
Get root library id from given full id.

Parameters:
fullId_p - a pattern or library full id.
For instance root/library1/libraryEmf/subLibrary1 or root/library1/libraryEmf/subLibrary1/patternClass.
Returns:
null if given id is null.
For instance root in case of given entry root/library1/libraryEmf/subLibrary1 or root/library1/libraryEmf/subLibrary1/patternClass.

EGF Engine
Release 0.1.0

Copyright (c) Thales Corporate Services S.A.S, 2009.

This page is made available under license. For full details see the LEGAL in the documentation book that contains this page.