org.objectweb.jorm.lib
Class JormPathHelper

java.lang.Object
  extended byorg.objectweb.jorm.lib.JormPathHelper

public class JormPathHelper
extends java.lang.Object

This class is a Helper for the Jorm user (Speedo, JOnAS, Medor, ...) which uses pathes. A Path is a string which designates a persistent object class. A path always begins with the name of a jorm persistent class. Some path examples: - '/org.toto.titi' represents the persistent class 'org.toto.titi' - '/org.toto.titi/f1' represents the persistent class referenced by the field 'f1' of the persistent class 'org.toto.titi'.

Author:
S.Chassande-Barrioz

Field Summary
static java.lang.String ELEMENT
           
static char SEP
           
 
Constructor Summary
JormPathHelper()
           
 
Method Summary
static java.lang.String getOriginClass(java.lang.String path)
           
static java.lang.String getPath(Class clazz)
          Retrieves the path of the class.
static java.lang.String getPath(ClassRef cr)
          Retrieves the path of the reference to a class.
static java.lang.String getPath(GenClassRef gcr, boolean element)
          Retrieves the path of a GenClass.
static java.lang.String getPath(java.lang.String fqclassname)
           
static java.lang.String getPath(java.lang.String sourceclassName, java.lang.String refFieldName, java.lang.String[] genClassNames)
           
static PClassMapping getPClassMapping(java.lang.String path, PMapper mapper)
          Retrieves the GenClassMapping instance corresponding to a path
static PNameCoder getPNameCoder(java.lang.String path, PMapper mapper)
          Retrieves the PNameCoder instance corresponding to a path
static java.lang.String replaceFieldOwner(java.lang.String path, java.lang.String newOwner)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEP

public static final char SEP
See Also:
Constant Field Values

ELEMENT

public static final java.lang.String ELEMENT
See Also:
Constant Field Values
Constructor Detail

JormPathHelper

public JormPathHelper()
Method Detail

getPath

public static java.lang.String getPath(GenClassRef gcr,
                                       boolean element)
Retrieves the path of a GenClass.

Parameters:
gcr - is the Jorm meta object repesenting the generic class.
element - indicates if the returned path must represent the element of the generic class or the generic class itself.

getPath

public static java.lang.String getPath(ClassRef cr)
Retrieves the path of the reference to a class. This reference can be hosted by a class or generic class.

Parameters:
cr - is the Jorm meta object representing the reference.

replaceFieldOwner

public static java.lang.String replaceFieldOwner(java.lang.String path,
                                                 java.lang.String newOwner)

getPath

public static java.lang.String getPath(Class clazz)
Retrieves the path of the class. This is the fully qualied class name of the class.

Parameters:
clazz - is the Jorm meta object representing the persistent class.

getPath

public static java.lang.String getPath(java.lang.String fqclassname)

getPath

public static java.lang.String getPath(java.lang.String sourceclassName,
                                       java.lang.String refFieldName,
                                       java.lang.String[] genClassNames)

getPNameCoder

public static PNameCoder getPNameCoder(java.lang.String path,
                                       PMapper mapper)
Retrieves the PNameCoder instance corresponding to a path

Parameters:
path - is th path to reach the PNameCoder.
mapper - is the PMapper to find the first class name.

getPClassMapping

public static PClassMapping getPClassMapping(java.lang.String path,
                                             PMapper mapper)
Retrieves the GenClassMapping instance corresponding to a path

Parameters:
path - is th path to reach the GenClassMapping (PClassMapping implementation).
mapper - is the PMapper to find the first class name.

getOriginClass

public static java.lang.String getOriginClass(java.lang.String path)