class EJB3MetafacadeUtils extends Object
Constructor and Description |
---|
EJB3MetafacadeUtils() |
Modifier and Type | Method and Description |
---|---|
(package private) static boolean |
allowSyntheticCreateMethod(ClassifierFacade classifier)
Returns true/false based on whether or not synthetic or auto generated create methods should be allowed.
|
(package private) static String |
buildAnnotationMultivalueParameter(String name,
Collection<String> values)
Builds a multi valued parameter string
|
(package private) static String |
buildAnnotationMultivalueParameter(String name,
Collection<String> values,
boolean areStrings)
Builds a multi valued parameter string
|
(package private) static String |
buildAnnotationMultivalueParameter(String name,
Collection<String> values,
boolean areStrings,
String suffix)
Builds a multi option string
Builds a multi valued parameter string
|
(package private) static String |
buildAnnotationParameters(Collection<String> parameters)
Builds an annotation parameter line
|
(package private) static String |
convertTransactionType(String transType)
Convert the transaction type from lower casing to upper casing.
|
(package private) static List<AttributeFacade> |
getAllInstanceAttributes(ClassifierFacade classifier)
Gets all instance attributes including those instance attributes belonging to the
classifier and any inherited ones. |
(package private) static Collection<AttributeFacade> |
getConstants(ClassifierFacade classifier,
boolean follow)
Gets all constants for the specified
classifier . |
(package private) static Collection<OperationFacade> |
getCreateMethods(ClassifierFacade classifier,
boolean follow)
Gets all create methods for the given
classifier . |
(package private) static Collection<AttributeFacade> |
getEnvironmentEntries(ClassifierFacade classifier,
boolean follow)
Gets all environment entries for the specified
classifier . |
(package private) static String |
getFullyQualifiedName(String packageName,
String name,
String suffix)
Creates a fully qualified name from the given
packageName ,
name , and suffix . |
(package private) static String |
getHomeInterfaceName(ClassifierFacade classifier)
Gets the interface name for the passed in
classifier . |
(package private) static List<AttributeFacade> |
getInheritedInstanceAttributes(ClassifierFacade classifier)
Gets all the inherited instance attributes, excluding the instance attributes directory from this
classifier . |
(package private) static String |
getSeamComponentName(ClassifierFacade classifier)
Returns the Seam component name.
|
(package private) static String |
getSeamComponentScopeType(ClassifierFacade classifier,
boolean stateless)
Gets the Seam component scope type for Entity and Session beans.
|
static String |
getSqlNameFromTaggedValue(String prefix,
EJB3AssociationFacade element,
String name,
Short nameMaxLength,
String suffix,
Object separator,
Object shortenSqlNameMethod)
Gets the SQL name.
|
(package private) static String |
getTransactionType(ClassifierFacade classifier,
String defaultTransactionType)
Returns the transaction type for the specified
classifier . |
(package private) static String |
getViewType(ClassifierFacade classifier,
String defaultViewType)
Gets the view type for the passed in
classifier . |
(package private) static boolean |
isSeamComponent(ClassifierFacade classifier)
Returns true if the Seam stereotype is modeled on the class.
|
EJB3MetafacadeUtils()
static Collection<OperationFacade> getCreateMethods(ClassifierFacade classifier, boolean follow)
classifier
.classifier
- The classifier from which to retries the create methodsfollow
- if true, all super type create methods are also retrievedstatic String getHomeInterfaceName(ClassifierFacade classifier)
classifier
. Returns 'LocalHome' if the mode element has
the entity stereotype, returns 'Home' otherwise.classifier
- static String getViewType(ClassifierFacade classifier, String defaultViewType)
classifier
. If no
view type can be retrieved from the classifier
, then the
defaultViewType
is returned.
If session ejb pojo then checks the ejb tagged value and if there is
no value defined, returns 'remote'.classifier
- The classifier to lookup the view type tagged valuedefaultViewType
- The default view type if one is not foundstatic List<AttributeFacade> getInheritedInstanceAttributes(ClassifierFacade classifier)
classifier
.classifier
- the ClassifierFacade from which to retrieve the inherited attributes.static List<AttributeFacade> getAllInstanceAttributes(ClassifierFacade classifier)
classifier
and any inherited ones.classifier
- the ClassifierFacade from which to retrieve the instance attributes.static Collection<AttributeFacade> getEnvironmentEntries(ClassifierFacade classifier, boolean follow)
classifier
. If follow
is true, then a
search up the inheritance hierarchy will be performed and all super type environment entries will also be
retrieved.classifier
- the classifier from which to retrieve the env-entriesfollow
- true/false on whether or not to 'follow' the inheritance hierarchy when retrieving the
env-entries.static String getTransactionType(ClassifierFacade classifier, String defaultTransactionType)
classifier
.classifier
- the classifier from which to retrieve the transaction type.defaultTransactionType
- the default transaction type if no tagged value is specified.static String convertTransactionType(String transType)
transType
- static Collection<AttributeFacade> getConstants(ClassifierFacade classifier, boolean follow)
classifier
.
If follow
is true, then a search up
the inheritance hierarchy will be performed and all super
type constants will also be retrieved.classifier
- the classifier from which to retrieve the constantsfollow
- true/false on whether or not to 'follow' the inheritance hierarchy when retrieving the
constants.static boolean allowSyntheticCreateMethod(ClassifierFacade classifier)
classifier
- The entity or session bean.static String getFullyQualifiedName(String packageName, String name, String suffix)
packageName
,
name
, and suffix
.packageName
- the name of the model element package.name
- the name of the model element.suffix
- the suffix to append.static boolean isSeamComponent(ClassifierFacade classifier)
classifier
- The classifier to lookup if the stereotype is modeledstatic String getSeamComponentScopeType(ClassifierFacade classifier, boolean stateless)
classifier
- The classifier to lookup the scope type tagged valuestateless
- Whether the classifier is a stateless session beanstatic String getSeamComponentName(ClassifierFacade classifier)
classifier
- The classifier to get the tagged value or the name from.static String buildAnnotationParameters(Collection<String> parameters)
parameters
- The parametersstatic String buildAnnotationMultivalueParameter(String name, Collection<String> values)
name
- The name of the parametervalues
- The values for the parametersstatic String buildAnnotationMultivalueParameter(String name, Collection<String> values, boolean areStrings)
name
- The name of the parametervalues
- The values for the parametersareStrings
- If the values are strings then surround with " signstatic String buildAnnotationMultivalueParameter(String name, Collection<String> values, boolean areStrings, String suffix)
name
- The name of the parametervalues
- The values for the parametersareStrings
- If the values are strings then surround with " signsuffix
- Any suffix to add to the valuespublic static String getSqlNameFromTaggedValue(String prefix, EJB3AssociationFacade element, String name, Short nameMaxLength, String suffix, Object separator, Object shortenSqlNameMethod)
name
,
then it uses the element name by default and just returns that.prefix
- the optional prefix to add to the sql name (i.e. table name
prefix, etc.).element
- from which to retrieve the SQL name.name
- the name of the tagged value.nameMaxLength
- if this is not null, then the name returned will be
trimmed to this length (if it happens to be longer).suffix
- the optional suffix to add to the sql name (i.e. foreign
key suffix, etc.)separator
- character used to separate wordsshortenSqlNameMethod
- The method used to shorten the name, i.e. removeVowelsCopyright © 2006–2014 AndroMDA.org. All rights reserved.