raccoon.tibco.tibrv.api
Interface IRepoGenerator


public interface IRepoGenerator

The EAI Repository generator.

This class offers services to generate or parse the most commonly used EAI Repository strings

Since:
Raccoon v0.5, refactored in Raccoon v0.7. Moved in Raccoon v1.0
Version:
$Id:$
Author:
Cedric ROUVRAIS

Method Summary
 java.lang.String convertClassNameToRepoObject(java.lang.String pClassName)
          Converts the fully qualified name of a class into AE Object name.
 java.lang.String convertPackageToRepoPath(java.lang.String pJavaPackage)
          Converts the package name of the java class to the pre-defined EAI/Repository path.
 java.lang.String convertRepoPathToPackage(java.lang.String pRepoPath)
          Given a TIB/Repository path, extracts the java package.
 java.lang.String extractSequenceName(java.lang.Class pBeanType, java.lang.Class pCollectionType)
          Generates the sequence name for a collection class.
 java.lang.String extractSequenceName(IBeanDescriptor pBeanProperty)
          Given any bean property that is a collection, generates a unique sequence name for the EAI Repository.
 java.lang.String getOffset()
          The relative offset to add to the Sequence/Class directory.
 int getPackageOffset()
          The package offset used in this implementation.
 java.lang.String getRootClassDirectory()
          The folder in which the definitions of EAI Objects are stored in the EAI/Repository.
 java.lang.String getRootSequenceDirectory()
          The folder in which the definitions of sequences are stored in the EAI/Repository.
 void setOffset(java.lang.String pOffset)
          Defines the relative offset to add to the Sequence/Class directory.
 void setPackageOffset(int pPackageOffset)
          The package offset used in this implementation.
 

Method Detail

extractSequenceName

java.lang.String extractSequenceName(IBeanDescriptor pBeanProperty)
                                     throws RaccoonException
Given any bean property that is a collection, generates a unique sequence name for the EAI Repository.

A sample result like:
   VectorOf_raccoon_tools_generator_tibRepo_junit_TestPerson
Would mean that this collection is an instance of Vector containing N elements of type raccoon.tools.generator.tibRepo.junit.TestPerson.

Parameters:
pBeanProperty - the bean property for which a sequence name is desired
Returns:
CollectionType + "Of_" + fully qualified name where '_' replaces '.'.
Throws:
RaccoonException - if the sequence name couldn't be generated for any reason (component not initialised for example)

convertPackageToRepoPath

java.lang.String convertPackageToRepoPath(java.lang.String pJavaPackage)
                                          throws RaccoonException
Converts the package name of the java class to the pre-defined EAI/Repository path.

Parameters:
pJavaPackage - the package name of the java class (without the class name)
Returns:
the location within the EAI/Repository of the java class definition
Throws:
RaccoonException - if the package name is an invalid java package.

convertClassNameToRepoObject

java.lang.String convertClassNameToRepoObject(java.lang.String pClassName)
                                              throws RaccoonException
Converts the fully qualified name of a class into AE Object name.

This method replaces '.' with '_'.

Parameters:
pClassName - the name of the class, including the package
Returns:
the repo string corresponding to the EAI Object.
Throws:
RaccoonException - if the class name is invalid.

getRootClassDirectory

java.lang.String getRootClassDirectory()
                                       throws RaccoonException
The folder in which the definitions of EAI Objects are stored in the EAI/Repository.

Returns:
the relative URL of the EAI Object directory
Throws:
RaccoonException - never thrown in this implementation.

getRootSequenceDirectory

java.lang.String getRootSequenceDirectory()
                                          throws RaccoonException
The folder in which the definitions of sequences are stored in the EAI/Repository.

Returns:
the relative URL of the sequence directory
Throws:
RaccoonException - never thrown in this implementation.

getOffset

java.lang.String getOffset()
The relative offset to add to the Sequence/Class directory.

This values is useful when a EAI/Repository has several object definitions from various horizons. For example we have:

Returns:
the offset to add to all generated elements with respect to the Sequence/Class directory

setOffset

void setOffset(java.lang.String pOffset)
Defines the relative offset to add to the Sequence/Class directory.

This values is useful when a EAI/Repository has several object definitions from various horizons. For example we have:

Parameters:
pOffset - the offset to add to all generated elements with respect to the Sequence/Class directory

getPackageOffset

int getPackageOffset()
The package offset used in this implementation.

The package offset is the number of packages to ignore when generating TIB/Repository strings. For example a class named com.octo.theproject.beans.Person should result in com/octo/theProject/beans/Person, however with a package offset of 2 the result will be theproject.beans.Person.

The reason for using this value is to avoid an unnecessary amount of folders within a project.

The default is keep all packages, ie 0

Returns:
the package offset used.

setPackageOffset

void setPackageOffset(int pPackageOffset)
The package offset used in this implementation.

The package offset is the number of packages to ignore when generating TIB/Repository strings. For example a class named com.octo.theproject.beans.Person should result in com/octo/theProject/beans/Person, however with a package offset of 2 the result will be theproject.beans.Person.

The reason for using this value is to avoid an unnecessary amount of folders within a project.

Parameters:
pPackageOffset - the package offset to be used.

convertRepoPathToPackage

java.lang.String convertRepoPathToPackage(java.lang.String pRepoPath)
                                          throws RaccoonException
Given a TIB/Repository path, extracts the java package.

Parameters:
pRepoPath - the TIB/Repository path
Returns:
the associated java package.
Throws:
RaccoonException - not thrown for now.

extractSequenceName

java.lang.String extractSequenceName(java.lang.Class pBeanType,
                                     java.lang.Class pCollectionType)
                                     throws RaccoonException
Generates the sequence name for a collection class.

Parameters:
pBeanType - the collection class (ArrayList, Vector, ...)
pCollectionType - the type of the elements contained within the collection
Returns:
the string representing this collection.
Throws:
RaccoonException - if the generation fails due to an invalid class instance.


Copyright null null. All Rights Reserved.