|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.eugene.GeneratorUtil
org.nuiton.eugene.java.JavaGeneratorUtil
org.nuiton.topia.generator.TopiaGeneratorUtil
public class TopiaGeneratorUtil
Classe regroupant divers méthodes utiles pour la génération des entités
Created: 13 déc. 2005
| Nested Class Summary | |
|---|---|
static class |
TopiaGeneratorUtil.TopiaModelPropertiesProvider
The Eugene provider of tag values and stereotypes. |
| Field Summary | |
|---|---|
static String |
DEFAULT_PACKAGE
Le package par défaut si aucun n'est spécifié |
static String |
DEPENDENCIES_DAO
dependency to add extra operations for entity dao. |
static Comparator<org.nuiton.eugene.models.object.ObjectModelClass> |
OBJECT_MODEL_CLASS_COMPARATOR
|
static String |
PERSISTENCE_TYPE_DEFAULT
Type de persistence par défaut (si aucun précisé) |
static String |
PERSISTENCE_TYPE_HIBERNATE
Type de persistence Hibernate |
static String |
PERSISTENCE_TYPE_LDAP
Type de persistence LDAP |
static String |
PROPERTY_DEFAULT_PACKAGE
Propriété des générateurs indiquant le package par défaut |
| Fields inherited from class org.nuiton.eugene.java.JavaGeneratorUtil |
|---|
DEPENDENCIES_CONSTANTS, OPERATION_GETTER_BOOLEAN_PREFIX, OPERATION_GETTER_DEFAULT_PREFIX |
| Constructor Summary | |
|---|---|
TopiaGeneratorUtil()
|
|
| Method Summary | ||
|---|---|---|
protected static List<String> |
cleanImports(String packageName,
Set<String> fqns)
Clean a set of fqns, transform it into a List and sort it. |
|
static boolean |
generateToString(org.nuiton.eugene.models.object.ObjectModelClass clazz,
org.nuiton.eugene.models.object.ObjectModel model)
Test if we need to generate toString method for the given class. |
|
static String |
getAccessTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Obtain the value of the TopiaTagValues.TAG_ACCESS
tag value on the given attribute. |
|
static String |
getAnnotationTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Obtain the value of the TopiaTagValues.TAG_ANNOTATION
tag value on the given attribute. |
|
static List<org.nuiton.eugene.models.object.ObjectModelClass> |
getClassesByStereotype(String stereotype,
org.nuiton.eugene.models.object.ObjectModel model,
boolean sort)
Obtain the list of classes for a given stereotype with the possibility to sort the result. |
|
static String |
getCopyright(org.nuiton.eugene.models.Model model)
Deprecated. since 2.5 never use anywhere |
|
static Class<?> |
getDAOImplementation(org.nuiton.eugene.models.object.ObjectModel model)
Obtain the class to use as abstract dao. |
|
static String |
getDaoImplementationTagValue(org.nuiton.eugene.models.object.ObjectModel model)
Obtain the value of the TopiaTagValues.TAG_DAO_IMPLEMENTATION
tag value on the given model. |
|
static org.nuiton.eugene.models.object.ObjectModelInterface |
getDAOInterface(org.nuiton.eugene.models.object.ObjectModelClass clazz,
org.nuiton.eugene.models.object.ObjectModel model)
Renvoie l'interface DAO associée à la classe passée en paramètre |
|
static String |
getDbName(org.nuiton.eugene.models.object.ObjectModelElement element)
Renvoie le nom BD de l'élement passé en paramètre. |
|
static String |
getDBName(org.nuiton.eugene.models.object.ObjectModelElement element)
Deprecated. since 2.5, prefer use the method getDbName(ObjectModelElement) |
|
static String |
getDbNameTagValue(org.nuiton.eugene.models.object.ObjectModelElement element)
Obtain the value of the TopiaTagValues.TAG_DB_NAME
tag value on the given classifier. |
|
static String |
getDbSchemaNameTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute,
org.nuiton.eugene.models.object.ObjectModel model)
Obtain the value of the TopiaTagValues.TAG_SCHEMA_NAME
tag value on the given attribute. |
|
static String |
getDbSchemaNameTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier,
org.nuiton.eugene.models.object.ObjectModel model)
Obtain the value of the TopiaTagValues.TAG_SCHEMA_NAME
tag value on the given classifier. |
|
static String |
getDefaultPackage(org.nuiton.eugene.AbstractGenerator<?> generator)
Renvoie le package par défaut pour le générateur donné |
|
static String |
getDoCommitTagValue(org.nuiton.eugene.models.object.ObjectModelOperation operation,
org.nuiton.eugene.models.object.ObjectModel model)
Obtain the value of the TopiaTagValues.TAG_DO_COMMIT
tag value on the given operation. |
|
static String |
getDOType(org.nuiton.eugene.models.object.ObjectModelElement elem,
org.nuiton.eugene.models.object.ObjectModel model)
|
|
static String |
getDOType(String type,
org.nuiton.eugene.models.object.ObjectModel model)
|
|
static
|
getElementsWithStereotype(Collection<Type> elements,
String... stereotypes)
|
|
static List<org.nuiton.eugene.models.object.ObjectModelClass> |
getEntityClasses(org.nuiton.eugene.models.object.ObjectModel model,
boolean sort)
Obtain the list of entities classes with the possibility to sort the result. |
|
static String |
getErrorArgsTagValue(org.nuiton.eugene.models.object.ObjectModelOperation operation)
Obtain the value of the TopiaTagValues.TAG_ERROR_ARGS
tag value on the given operation. |
|
static String |
getExceptionClassTagValue(org.nuiton.eugene.models.object.ObjectModel model)
Obtain the value of the TopiaTagValues.TAG_EXCEPTION_CLASS
tag value on the given interface. |
|
static String |
getFetchTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Obtain the value of the TopiaTagValues.TAG_FETCH
tag value on the given attribute. |
|
static String |
getGenerateOperatorForDAOHelperTagValue(org.nuiton.eugene.models.object.ObjectModel model)
|
|
static String |
getGenerateStandaloneEnumForDAOHelperTagValue(org.nuiton.eugene.models.object.ObjectModel model)
Obtain the value of the TopiaTagValues.TAG_GENERATE_STANDALONE_ENUM_FOR_DAO_HELPER
tag value on the given model. |
|
static String |
getI18nPrefix(org.nuiton.eugene.models.object.ObjectModelElement element,
org.nuiton.eugene.models.object.ObjectModel model)
Deprecated. since 2.5, prefer use the JavaGeneratorUtil.getI18nPrefixTagValue(ObjectModelElement, ObjectModel) |
|
protected static void |
getImports(org.nuiton.eugene.models.object.ObjectModelClass aClass,
Set<String> fqns)
Obtain the list of fqn of object involed in the given class. |
|
static List<String> |
getImports(org.nuiton.eugene.models.object.ObjectModelClass aClass,
String... incomingFqns)
Obtain the list of fqn of object involed in the given class. |
|
protected static void |
getImports(org.nuiton.eugene.models.object.ObjectModelInterface anInterface,
Set<String> fqns)
Obtain the list of fqn of object involed in the given interface. |
|
static List<String> |
getImports(org.nuiton.eugene.models.object.ObjectModelInterface anInterface,
String... incomingFqns)
Obtain the list of fqn of object involed in the given interface. |
|
protected static void |
getImports(org.nuiton.eugene.models.object.ObjectModelOperation operation,
Set<String> fqns)
Obtain the fqn's list of all involed type in a givne operation. |
|
static String |
getInverseTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Obtain the value of the TopiaTagValues.TAG_INVERSE
tag value on the given attribute. |
|
static String |
getLazyTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Obtain the value of the TopiaTagValues.TAG_LAZY
tag value on the given attribute. |
|
static String |
getLengthTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Obtain the value of the TopiaTagValues.TAG_LENGTH
tag value on the given attribute. |
|
static String |
getManyToManyTableName(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
Renvoie le nom unique de table pour une relation ManyToMany en fonction de l'attribut attr
Plusieurs cas de figure:
|
|
static List<org.nuiton.eugene.models.object.ObjectModelAttribute> |
getNaturalIdAttributes(org.nuiton.eugene.models.object.ObjectModelClass clazz)
Cherche et renvoie la liste des attributs constituant la clef metier d'une classe. |
|
static String |
getNaturalIdMutableTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
Obtain the value of the TopiaTagValues.TAG_NATURAL_ID_MUTABLE
tag value on the given classifier. |
|
static String |
getNaturalIdTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Obtain the value of the TopiaTagValues.TAG_NATURAL_ID
tag value on the given attribute. |
|
static String |
getNMultiplicityHibernateType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
Renvoie le type d'interface à utiliser en fonction de l'attribut |
|
static String |
getNMultiplicityInterfaceType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
Renvoie le type d'interface à utiliser en fonction de l'attribut |
|
static String |
getNMultiplicityObjectType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
Renvoie le type d'objet (instance) à utiliser en fonction de l'attribut |
|
static String |
getNoLogInServiceTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier,
org.nuiton.eugene.models.object.ObjectModel model)
Obtain the value of the TopiaTagValues.TAG_NO_LOG_IN_SERVICE
tag value on the given classifier. |
|
static String |
getNotGenerateToStringTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier clazz,
org.nuiton.eugene.models.object.ObjectModel model)
Obtain the value of the TopiaTagValues.TAG_NOT_GENERATE_TO_STRING
tag value on the given class. |
|
static String |
getNotNullTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Obtain the value of the TopiaTagValues.TAG_NOT_NULL
tag value on the given attribute. |
|
static String |
getOrderByTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Obtain the value of the TopiaTagValues.TAG_ORDER_BY
tag value on the given attribute. |
|
static String |
getPersistenceType(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
Renvoie le type de persistence pour le classifier donné. |
|
static String |
getPersistenceType(org.nuiton.eugene.models.object.ObjectModelElement element)
Deprecated. since 2.5, prefer use the method getPersistenceType(ObjectModelClassifier) |
|
static String |
getPersistenceTypeTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
Obtain the value of the TopiaTagValues.TAG_PERSISTENCE_TYPE
tag value on the given classifier. |
|
static String |
getPrimaryKeyAttributesListDeclaration(org.nuiton.eugene.models.object.ObjectModelClass clazz,
boolean includeName)
|
|
static String |
getProxyInterfaceTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier,
org.nuiton.eugene.models.object.ObjectModel model)
Obtain the value of the TopiaTagValues.TAG_PROXY_INTERFACE
tag value on the given classifier. |
|
static String |
getReverseDbName(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
Obtain the reverse db name of an attribute. |
|
static String |
getReverseDBName(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
Deprecated. since 2.5, prefer use the methode getReverseDbName(ObjectModelAttribute) |
|
static String |
getSchemaName(org.nuiton.eugene.models.object.ObjectModelElement element,
org.nuiton.eugene.models.object.ObjectModel model)
Deprecated. since 2.5, prefer use the method getDbSchemaNameTagValue(ObjectModelClassifier, ObjectModel) or getDbSchemaNameTagValue(ObjectModelAttribute, ObjectModel) |
|
static String |
getSecurityCreateTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
Obtain the value of the TopiaTagValues.TAG_SECURITY_CREATE
tag value on the given classifier. |
|
static String |
getSecurityDeleteTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
Obtain the value of the TopiaTagValues.TAG_SECURITY_DELETE
tag value on the given classifier. |
|
static String |
getSecurityLoadTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
Obtain the value of the TopiaTagValues.TAG_SECURITY_LOAD
tag value on the given classifier. |
|
static String |
getSecurityUpdateTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
Obtain the value of the TopiaTagValues.TAG_SECURITY_UPDATE
tag value on the given classifier. |
|
static String |
getSortAttributeTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier,
org.nuiton.eugene.models.object.ObjectModel model)
Obtain the value of the TopiaTagValues.TAG_SORT_ATTRIBUTE
tag value on the given classifier. |
|
static String |
getSqlTypeTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Obtain the value of the TopiaTagValues.TAG_SQL_TYPE
tag value on the given attribute. |
|
static String |
getTransactionTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
Obtain the value of the TopiaTagValues.TAG_TRANSACTION
tag value on the given classifier. |
|
static String |
getTransactionTagValue(org.nuiton.eugene.models.object.ObjectModelOperation operation)
Obtain the value of the TopiaTagValues.TAG_TRANSACTION
tag value on the given operation. |
|
static String |
getTypeTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Obtain the value of the TopiaTagValues.TAG_TYPE
tag value on the given attribute. |
|
static boolean |
hasArrayStereotype(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Deprecated. since 2.5 , only BeanTransformer use it and it is a deprecated transformer, will be remove in version 3.0 |
|
static boolean |
hasDaoStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
Check if the given classifier has the TopiaStereoTypes.STEREOTYPE_DAO stereotype. |
|
static boolean |
hasDaoStereotype(org.nuiton.eugene.models.object.ObjectModelOperation operation)
Check if the given operation has the TopiaStereoTypes.STEREOTYPE_DAO stereotype. |
|
static boolean |
hasDtoStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
Check if the given classifier has the TopiaStereoTypes.STEREOTYPE_DTO stereotype. |
|
static boolean |
hasEntityStereotype(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Check if the given attribute has the TopiaStereoTypes.STEREOTYPE_ENTITY stereotype. |
|
static boolean |
hasEntityStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
Check if the given classifier has the TopiaStereoTypes.STEREOTYPE_ENTITY stereotype. |
|
static boolean |
hasFacadeStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
Check if the given classifier has the TopiaStereoTypes.STEREOTYPE_FACADE stereotype. |
|
static boolean |
hasNothingOrAbstractMethods(org.nuiton.eugene.models.object.ObjectModelClass clazz)
Indique si la classe specifiee n'a aucune ou que des methodes abstraites |
|
static boolean |
hasPrimaryKeyStereotype(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Check if the given attribute has the TopiaStereoTypes.STEREOTYPE_PRIMARYKAY stereotype. |
|
static boolean |
hasServiceStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
Check if the given classifier has the TopiaStereoTypes.STEREOTYPE_SERVICE stereotype. |
|
static boolean |
hasStereotypes(org.nuiton.eugene.models.object.ObjectModelElement element,
String... stereotypes)
|
|
static boolean |
hasUnidirectionalRelationOnAbstractType(org.nuiton.eugene.models.object.ObjectModelAttribute attr,
org.nuiton.eugene.models.object.ObjectModel model)
Cette méthode permet de détecter si - l'attribut représente une relation 1-n - cette relation est unidirectionnelle - le type de l'attribut représente un entité - cette entité a des sous-classes dans le modèle Ce cas correspond à une incompatibilité d'Hibernate qui nous oblige a adopter un comportement particulier. |
|
static boolean |
hasUniqueStereotype(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Check if the given attribute has the TopiaStereoTypes.STEREOTYPE_UNIQUE stereotype. |
|
static boolean |
isAssociationClassDoublon(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
|
|
static boolean |
isBooleanType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
|
|
static boolean |
isClassWithSecurity(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
Tests if the given classifier own at least one security tag value. |
|
static boolean |
isDateType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
|
|
static boolean |
isNaturalId(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
Detecte si un attribut fait partie d'une clef metier. |
|
static boolean |
isNaturalIdMutable(org.nuiton.eugene.models.object.ObjectModelClass clazz)
Detecte si la clef metier d'une classe est mutable ou pas. |
|
static boolean |
isNumericType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
|
|
static boolean |
isPrimitiveType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
|
|
static boolean |
isTextType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
|
|
static Map<org.nuiton.eugene.models.object.ObjectModelClass,Set<org.nuiton.eugene.models.object.ObjectModelClass>> |
searchDirectUsages(org.nuiton.eugene.models.object.ObjectModel model)
|
|
static void |
searchDirectUsages(org.nuiton.eugene.models.object.ObjectModelClass klass,
Map<String,org.nuiton.eugene.models.object.ObjectModelClass> allEntitiesByFQN,
Map<org.nuiton.eugene.models.object.ObjectModelClass,Set<org.nuiton.eugene.models.object.ObjectModelClass>> usages)
|
|
static boolean |
shouldBeAbstract(org.nuiton.eugene.models.object.ObjectModelClass clazz)
Indique si la classe specifiee devrait etre abstraite |
|
static boolean |
shouldGenerateOperatorForDAOHelper(org.nuiton.eugene.models.object.ObjectModel model)
Cherche si le tagvalue TopiaTagValues.TAG_GENERATE_OPERATOR_FOR_DAO_HELPER a été
activé dans le model. |
|
static boolean |
shouldgenerateOperatorForDAOHelper(org.nuiton.eugene.models.object.ObjectModelElement element,
org.nuiton.eugene.models.object.ObjectModel model)
Deprecated. since 2.5, use now the method shouldGenerateOperatorForDAOHelper(ObjectModel) |
|
static boolean |
shouldGenerateStandaloneEnumForDAOHelper(org.nuiton.eugene.models.object.ObjectModel model)
Cherche si le tagvalue TopiaTagValues.TAG_GENERATE_OPERATOR_FOR_DAO_HELPER a été
activé dans le model. |
|
static boolean |
shouldGnerateStandaloneEnumForDAOHelper(org.nuiton.eugene.models.object.ObjectModelElement element,
org.nuiton.eugene.models.object.ObjectModel model)
Deprecated. since 2.5, prefer use the method shouldGenerateStandaloneEnumForDAOHelper(ObjectModel) |
|
static boolean |
sortAttribute(org.nuiton.eugene.models.object.ObjectModelClass clazz,
org.nuiton.eugene.models.object.ObjectModel model)
Cherche et renvoie la liste des attributs constituant la clef metier d'une classe. |
|
| Methods inherited from class org.nuiton.eugene.java.JavaGeneratorUtil |
|---|
cloneOperations, containsGenerics, getConstantPrefixTagValue, getI18nPrefixTagValue, getNoPCSTagValue, hasBeanStereotype, joinGeneric, splitFqnList, splitGeneric |
| Methods inherited from class org.nuiton.eugene.GeneratorUtil |
|---|
computeSerialVersionUID, convertVariableNameToConstantName, findTagValue, getAssocAttrName, getAttributeType, getAttributeType, getCastValue, getClassAttributesListDeclaration, getClassifiers, getClassNameFromQualifiedName, getDocumentationTagValue, getDocumentationTagValue, getFilenameFromQualifiedName, getFormatingExpression, getHashCodeExpression, getInitValue, getInitValue, getOperationParametersListDeclaration, getOperationParametersListName, getParentPackageName, getParsingExpression, getSimpleName, getSimpleName, getTypesList, hasDocumentation, hasIndexedStereotype, hasOrderedStereotype, hasStereotype, isComposition, isFirstAttribute, isNMultiplicity, isNMultiplicity, isOneMultiplicity, isPrimitiveAttributeType, isPrimitiveType, notEmpty, removeGenericDefinition, splitGenericDefinition, toLowerCaseFirstLetter |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEPENDENCIES_DAO
public static final String PERSISTENCE_TYPE_HIBERNATE
public static final String PERSISTENCE_TYPE_LDAP
public static final String PERSISTENCE_TYPE_DEFAULT
public static final String PROPERTY_DEFAULT_PACKAGE
public static final String DEFAULT_PACKAGE
public static final Comparator<org.nuiton.eugene.models.object.ObjectModelClass> OBJECT_MODEL_CLASS_COMPARATOR
| Constructor Detail |
|---|
public TopiaGeneratorUtil()
| Method Detail |
|---|
public static String getDefaultPackage(org.nuiton.eugene.AbstractGenerator<?> generator)
generator - le générateur donné
public static org.nuiton.eugene.models.object.ObjectModelInterface getDAOInterface(org.nuiton.eugene.models.object.ObjectModelClass clazz,
org.nuiton.eugene.models.object.ObjectModel model)
clazz - la classe à testermodel - le modele utilisé
@Deprecated public static String getPersistenceType(org.nuiton.eugene.models.object.ObjectModelElement element)
getPersistenceType(ObjectModelClassifier)
element - l'élément à tester
public static String getPersistenceType(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
classifier - l'élément à tester
@Deprecated public static String getReverseDBName(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
getReverseDbName(ObjectModelAttribute)
attr - the attribute to inspece
public static String getReverseDbName(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
_id.
attr - the attribute to seek
@Deprecated public static String getDBName(org.nuiton.eugene.models.object.ObjectModelElement element)
getDbName(ObjectModelElement)
element - l'élément à tester
public static String getDbName(org.nuiton.eugene.models.object.ObjectModelElement element)
element - l'élément à tester
@Deprecated
public static String getSchemaName(org.nuiton.eugene.models.object.ObjectModelElement element,
org.nuiton.eugene.models.object.ObjectModel model)
getDbSchemaNameTagValue(ObjectModelClassifier, ObjectModel) or getDbSchemaNameTagValue(ObjectModelAttribute, ObjectModel)
element - l'élément à testermodel - le modele utilisé
@Deprecated
public static String getI18nPrefix(org.nuiton.eugene.models.object.ObjectModelElement element,
org.nuiton.eugene.models.object.ObjectModel model)
JavaGeneratorUtil.getI18nPrefixTagValue(ObjectModelElement, ObjectModel)
element - l'élément à testermodel - le modele utilisé
null si non spécifié
@Deprecated
public static boolean shouldgenerateOperatorForDAOHelper(org.nuiton.eugene.models.object.ObjectModelElement element,
org.nuiton.eugene.models.object.ObjectModel model)
shouldGenerateOperatorForDAOHelper(ObjectModel)
TopiaTagValues.TAG_GENERATE_OPERATOR_FOR_DAO_HELPER a été
activé dans le model.
element - l'élément à testermodel - le modele utilisé
true si le tag value trouvé dans le modèle, false
sinon.public static boolean shouldGenerateOperatorForDAOHelper(org.nuiton.eugene.models.object.ObjectModel model)
TopiaTagValues.TAG_GENERATE_OPERATOR_FOR_DAO_HELPER a été
activé dans le model.
model - le modele utilisé
true si le tag value trouvé dans le modèle, false
sinon.
@Deprecated
public static boolean shouldGnerateStandaloneEnumForDAOHelper(org.nuiton.eugene.models.object.ObjectModelElement element,
org.nuiton.eugene.models.object.ObjectModel model)
shouldGenerateStandaloneEnumForDAOHelper(ObjectModel)
TopiaTagValues.TAG_GENERATE_OPERATOR_FOR_DAO_HELPER a été
activé dans le model.
element - l'élément à testermodel - le modele utilisé
true si le tag value trouvé dans le modèle, false
sinon.public static boolean shouldGenerateStandaloneEnumForDAOHelper(org.nuiton.eugene.models.object.ObjectModel model)
TopiaTagValues.TAG_GENERATE_OPERATOR_FOR_DAO_HELPER a été
activé dans le model.
model - le modele utilisé
true si le tag value trouvé dans le modèle, false
sinon.public static List<org.nuiton.eugene.models.object.ObjectModelAttribute> getNaturalIdAttributes(org.nuiton.eugene.models.object.ObjectModelClass clazz)
clazz - la classe à tester
public static boolean generateToString(org.nuiton.eugene.models.object.ObjectModelClass clazz,
org.nuiton.eugene.models.object.ObjectModel model)
toString method for the given class.
clazz - class to testmodel - model
true if toString should be generated.
clef métier.
public static boolean sortAttribute(org.nuiton.eugene.models.object.ObjectModelClass clazz,
org.nuiton.eugene.models.object.ObjectModel model)
clazz - la classe à testermodel - le modele
public static boolean isNaturalId(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
attribute - l'attribut à tester
true si l'attribut fait partie d'une clef metier,
false sinon.@Deprecated public static String getCopyright(org.nuiton.eugene.models.Model model)
model - le modele utilisé
public static <Type extends org.nuiton.eugene.models.object.ObjectModelElement> Collection<Type> getElementsWithStereotype(Collection<Type> elements,
String... stereotypes)
public static boolean hasStereotypes(org.nuiton.eugene.models.object.ObjectModelElement element,
String... stereotypes)
public static String getPrimaryKeyAttributesListDeclaration(org.nuiton.eugene.models.object.ObjectModelClass clazz,
boolean includeName)
public static boolean isAssociationClassDoublon(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
public static String getDOType(org.nuiton.eugene.models.object.ObjectModelElement elem,
org.nuiton.eugene.models.object.ObjectModel model)
public static String getDOType(String type,
org.nuiton.eugene.models.object.ObjectModel model)
public static boolean isNumericType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
public static boolean isTextType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
public static boolean isDateType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
public static boolean isBooleanType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
public static boolean isPrimitiveType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
public static boolean hasNothingOrAbstractMethods(org.nuiton.eugene.models.object.ObjectModelClass clazz)
clazz - l'instance de ObjectModelClass
public static boolean shouldBeAbstract(org.nuiton.eugene.models.object.ObjectModelClass clazz)
clazz - l'instance de ObjectModelClass
public static boolean hasUnidirectionalRelationOnAbstractType(org.nuiton.eugene.models.object.ObjectModelAttribute attr,
org.nuiton.eugene.models.object.ObjectModel model)
Cette méthode permet de détecter si - l'attribut représente une relation 1-n - cette relation est unidirectionnelle - le type de l'attribut représente un entité - cette entité a des sous-classes dans le modèle
Ce cas correspond à une incompatibilité d'Hibernate qui nous oblige a adopter un comportement particulier.
attr - l'attribut a testermodel - le model
public static String getManyToManyTableName(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
attr
Plusieurs cas de figure:
attr - l'attribut servant de base au calcul du nom
public static String getNMultiplicityInterfaceType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
attr - l'attribut a traiter
public static String getNMultiplicityObjectType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
attr - l'attribut a traiter
public static String getNMultiplicityHibernateType(org.nuiton.eugene.models.object.ObjectModelAttribute attr)
attr - l'attribut a traiter
public static List<org.nuiton.eugene.models.object.ObjectModelClass> getEntityClasses(org.nuiton.eugene.models.object.ObjectModel model,
boolean sort)
model - the current model to scansort - flag to allow sort the result
public static List<org.nuiton.eugene.models.object.ObjectModelClass> getClassesByStereotype(String stereotype,
org.nuiton.eugene.models.object.ObjectModel model,
boolean sort)
stereotype - filter stereotypemodel - the current model to scansort - flag to allow sort the result
public static boolean isNaturalIdMutable(org.nuiton.eugene.models.object.ObjectModelClass clazz)
clazz - la classe a tester
true si le tag value a ete positionne sur la classe
via le tag TopiaTagValues.TAG_NATURAL_ID_MUTABLE, false
sinon.
public static List<String> getImports(org.nuiton.eugene.models.object.ObjectModelClass aClass,
String... incomingFqns)
aClass - the clazz to inspectincomingFqns - incoming fqns
public static List<String> getImports(org.nuiton.eugene.models.object.ObjectModelInterface anInterface,
String... incomingFqns)
anInterface - the interface to inspectincomingFqns - incoming fqns
protected static void getImports(org.nuiton.eugene.models.object.ObjectModelClass aClass,
Set<String> fqns)
aClass - the class to inspectfqns - where to store found fqns
protected static void getImports(org.nuiton.eugene.models.object.ObjectModelInterface anInterface,
Set<String> fqns)
anInterface - the interface to inspectfqns - where to store found fqns
protected static void getImports(org.nuiton.eugene.models.object.ObjectModelOperation operation,
Set<String> fqns)
operation - operation to inspectfqns - where to store found fqns
protected static List<String> cleanImports(String packageName,
Set<String> fqns)
List and sort it.
packageName - the current package namefqns - the dirty set of fqns
public static Class<?> getDAOImplementation(org.nuiton.eugene.models.object.ObjectModel model)
TopiaTagValues.TAG_DAO_IMPLEMENTATION in model
and if not found will use the default value which is TopiaDAOImpl.
model - the model which could contains
public static Map<org.nuiton.eugene.models.object.ObjectModelClass,Set<org.nuiton.eugene.models.object.ObjectModelClass>> searchDirectUsages(org.nuiton.eugene.models.object.ObjectModel model)
public static void searchDirectUsages(org.nuiton.eugene.models.object.ObjectModelClass klass,
Map<String,org.nuiton.eugene.models.object.ObjectModelClass> allEntitiesByFQN,
Map<org.nuiton.eugene.models.object.ObjectModelClass,Set<org.nuiton.eugene.models.object.ObjectModelClass>> usages)
public static boolean hasFacadeStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
TopiaStereoTypes.STEREOTYPE_FACADE stereotype.
classifier - classifier to test
true if stereotype was found, false otherwiseTopiaStereoTypes.STEREOTYPE_FACADEpublic static boolean hasEntityStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
TopiaStereoTypes.STEREOTYPE_ENTITY stereotype.
classifier - classifier to test
true if stereotype was found, false otherwiseTopiaStereoTypes.STEREOTYPE_ENTITYpublic static boolean hasEntityStereotype(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
TopiaStereoTypes.STEREOTYPE_ENTITY stereotype.
attribute - attribute to test
true if stereotype was found, false otherwiseTopiaStereoTypes.STEREOTYPE_ENTITYpublic static boolean hasDtoStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
TopiaStereoTypes.STEREOTYPE_DTO stereotype.
classifier - classifier to test
true if stereotype was found, false otherwiseTopiaStereoTypes.STEREOTYPE_DTOpublic static boolean hasServiceStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
TopiaStereoTypes.STEREOTYPE_SERVICE stereotype.
classifier - classifier to test
true if stereotype was found, false otherwiseTopiaStereoTypes.STEREOTYPE_SERVICEpublic static boolean hasDaoStereotype(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
TopiaStereoTypes.STEREOTYPE_DAO stereotype.
classifier - classifier to test
true if stereotype was found, false otherwiseTopiaStereoTypes.STEREOTYPE_DAOpublic static boolean hasDaoStereotype(org.nuiton.eugene.models.object.ObjectModelOperation operation)
TopiaStereoTypes.STEREOTYPE_DAO stereotype.
operation - operation to test
true if stereotype was found, false otherwiseTopiaStereoTypes.STEREOTYPE_DAOpublic static boolean hasUniqueStereotype(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
TopiaStereoTypes.STEREOTYPE_UNIQUE stereotype.
attribute - attribute to test
true if stereotype was found, false otherwiseTopiaStereoTypes.STEREOTYPE_UNIQUEpublic static boolean hasPrimaryKeyStereotype(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
TopiaStereoTypes.STEREOTYPE_PRIMARYKAY stereotype.
attribute - attribute to test
true if stereotype was found, false otherwiseTopiaStereoTypes.STEREOTYPE_PRIMARYKAY@Deprecated public static boolean hasArrayStereotype(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
TopiaStereoTypes.STEREOTYPE_ARRAY stereotype.
attribute - attribute to test
true if stereotype was found, false otherwiseTopiaStereoTypes.STEREOTYPE_ARRAYpublic static String getPersistenceTypeTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
TopiaTagValues.TAG_PERSISTENCE_TYPE
tag value on the given classifier.
classifier - classifier to seek
null if not found nor empty.TopiaTagValues.TAG_PERSISTENCE_TYPEpublic static String getDbNameTagValue(org.nuiton.eugene.models.object.ObjectModelElement element)
TopiaTagValues.TAG_DB_NAME
tag value on the given classifier.
element - classifier to seek
null if not found nor empty.TopiaTagValues.TAG_DB_NAME
public static String getDbSchemaNameTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier,
org.nuiton.eugene.models.object.ObjectModel model)
TopiaTagValues.TAG_SCHEMA_NAME
tag value on the given classifier.
classifier - classifier to seekmodel - model to seek
null if not found nor empty.TopiaTagValues.TAG_SCHEMA_NAME
public static String getDbSchemaNameTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute,
org.nuiton.eugene.models.object.ObjectModel model)
TopiaTagValues.TAG_SCHEMA_NAME
tag value on the given attribute.
attribute - attribute to seekmodel - model to seek
null if not found nor empty.TopiaTagValues.TAG_SCHEMA_NAMEpublic static String getLengthTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
TopiaTagValues.TAG_LENGTH
tag value on the given attribute.
attribute - attribute to seek
null if not found nor empty.TopiaTagValues.TAG_LENGTHpublic static String getAnnotationTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
TopiaTagValues.TAG_ANNOTATION
tag value on the given attribute.
attribute - attribute to seek
null if not found nor empty.TopiaTagValues.TAG_ANNOTATIONpublic static String getAccessTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
TopiaTagValues.TAG_ACCESS
tag value on the given attribute.
attribute - attribute to seek
null if not found nor empty.TopiaTagValues.TAG_ACCESSpublic static String getNaturalIdTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
TopiaTagValues.TAG_NATURAL_ID
tag value on the given attribute.
attribute - attribute to seek
null if not found nor empty.TopiaTagValues.TAG_NATURAL_IDpublic static String getNaturalIdMutableTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
TopiaTagValues.TAG_NATURAL_ID_MUTABLE
tag value on the given classifier.
classifier - classifier to seek
null if not found nor empty.TopiaTagValues.TAG_NATURAL_ID_MUTABLEpublic static String getInverseTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
TopiaTagValues.TAG_INVERSE
tag value on the given attribute.
attribute - attribute to seek
null if not found nor empty.TopiaTagValues.TAG_INVERSEpublic static String getLazyTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
TopiaTagValues.TAG_LAZY
tag value on the given attribute.
attribute - attribute to seek
null if not found nor empty.TopiaTagValues.TAG_LAZYpublic static String getFetchTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
TopiaTagValues.TAG_FETCH
tag value on the given attribute.
attribute - attribute to seek
null if not found nor empty.TopiaTagValues.TAG_FETCHpublic static String getOrderByTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
TopiaTagValues.TAG_ORDER_BY
tag value on the given attribute.
attribute - attribute to seek
null if not found nor empty.TopiaTagValues.TAG_ORDER_BYpublic static String getNotNullTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
TopiaTagValues.TAG_NOT_NULL
tag value on the given attribute.
attribute - attribute to seek
null if not found nor empty.TopiaTagValues.TAG_NOT_NULL
public static String getProxyInterfaceTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier,
org.nuiton.eugene.models.object.ObjectModel model)
TopiaTagValues.TAG_PROXY_INTERFACE
tag value on the given classifier.
classifier - classifier to seekmodel - model to seek
null if not found nor empty.TopiaTagValues.TAG_PROXY_INTERFACEpublic static boolean isClassWithSecurity(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
classifier - the classifier to test
true if there is at least one security tag value on the given classpublic static String getSecurityCreateTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
TopiaTagValues.TAG_SECURITY_CREATE
tag value on the given classifier.
classifier - classifier to seek
null if not found nor empty.TopiaTagValues.TAG_SECURITY_CREATEpublic static String getSecurityDeleteTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
TopiaTagValues.TAG_SECURITY_DELETE
tag value on the given classifier.
classifier - classifier to seek
null if not found nor empty.TopiaTagValues.TAG_SECURITY_DELETEpublic static String getSecurityLoadTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
TopiaTagValues.TAG_SECURITY_LOAD
tag value on the given classifier.
classifier - classifier to seek
null if not found nor empty.TopiaTagValues.TAG_SECURITY_LOADpublic static String getSecurityUpdateTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
TopiaTagValues.TAG_SECURITY_UPDATE
tag value on the given classifier.
classifier - classifier to seek
null if not found nor empty.TopiaTagValues.TAG_SECURITY_UPDATE
public static String getNotGenerateToStringTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier clazz,
org.nuiton.eugene.models.object.ObjectModel model)
TopiaTagValues.TAG_NOT_GENERATE_TO_STRING
tag value on the given class.
clazz - class to seekmodel - model to seek
null if not found nor empty.TopiaTagValues.TAG_NOT_GENERATE_TO_STRING
public static String getSortAttributeTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier,
org.nuiton.eugene.models.object.ObjectModel model)
TopiaTagValues.TAG_SORT_ATTRIBUTE
tag value on the given classifier.
classifier - classifier to seekmodel - model to seek
null if not found nor empty.TopiaTagValues.TAG_SORT_ATTRIBUTEpublic static String getGenerateStandaloneEnumForDAOHelperTagValue(org.nuiton.eugene.models.object.ObjectModel model)
TopiaTagValues.TAG_GENERATE_STANDALONE_ENUM_FOR_DAO_HELPER
tag value on the given model.
model - model to seek
null if not found nor empty.TopiaTagValues.TAG_GENERATE_STANDALONE_ENUM_FOR_DAO_HELPERpublic static String getGenerateOperatorForDAOHelperTagValue(org.nuiton.eugene.models.object.ObjectModel model)
public static String getTypeTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
TopiaTagValues.TAG_TYPE
tag value on the given attribute.
attribute - attribute to seek
null if not found nor empty.TopiaTagValues.TAG_TYPEpublic static String getSqlTypeTagValue(org.nuiton.eugene.models.object.ObjectModelAttribute attribute)
TopiaTagValues.TAG_SQL_TYPE
tag value on the given attribute.
attribute - attribute to seek
null if not found nor empty.TopiaTagValues.TAG_TYPEpublic static String getExceptionClassTagValue(org.nuiton.eugene.models.object.ObjectModel model)
TopiaTagValues.TAG_EXCEPTION_CLASS
tag value on the given interface.
model - model to seek
null if not found nor empty.TopiaTagValues.TAG_EXCEPTION_CLASSpublic static String getTransactionTagValue(org.nuiton.eugene.models.object.ObjectModelOperation operation)
TopiaTagValues.TAG_TRANSACTION
tag value on the given operation.
operation - operation to seek
null if not found nor empty.TopiaTagValues.TAG_TRANSACTIONpublic static String getTransactionTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier)
TopiaTagValues.TAG_TRANSACTION
tag value on the given classifier.
classifier - classifier to seek
null if not found nor empty.TopiaTagValues.TAG_TRANSACTION
public static String getDoCommitTagValue(org.nuiton.eugene.models.object.ObjectModelOperation operation,
org.nuiton.eugene.models.object.ObjectModel model)
TopiaTagValues.TAG_DO_COMMIT
tag value on the given operation.
operation - operation to seekmodel - model to seek
null if not found nor empty.TopiaTagValues.TAG_DO_COMMITpublic static String getErrorArgsTagValue(org.nuiton.eugene.models.object.ObjectModelOperation operation)
TopiaTagValues.TAG_ERROR_ARGS
tag value on the given operation.
operation - operation to seek
null if not found nor empty.TopiaTagValues.TAG_ERROR_ARGS
public static String getNoLogInServiceTagValue(org.nuiton.eugene.models.object.ObjectModelClassifier classifier,
org.nuiton.eugene.models.object.ObjectModel model)
TopiaTagValues.TAG_NO_LOG_IN_SERVICE
tag value on the given classifier.
classifier - classifier to seekmodel - model to seek
null if not found nor empty.TopiaTagValues.TAG_NO_LOG_IN_SERVICEpublic static String getDaoImplementationTagValue(org.nuiton.eugene.models.object.ObjectModel model)
TopiaTagValues.TAG_DAO_IMPLEMENTATION
tag value on the given model.
model - model to seek
null if not found nor empty.TopiaTagValues.TAG_DAO_IMPLEMENTATION
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||