entity.ModelProperties.ext Maven / Gradle / Ivy
import uml;
import JMM;
import Persistence;
extension java::GeneratorCommons;
List[PersistentObject] entity (Class dao) : dao.clientDependency.supplier.typeSelect(PersistentObject);
boolean hasEntities (Class dao) : !dao.entity().isEmpty;
boolean isUnnamed (NamedElement elem) : elem.name.length == 0;
List[Property] attribute (Type type):
if type.isEnumeration()
then ((uml::Enumeration) type).ownedAttribute
else ((uml::Class) type).ownedAttribute;
List[Comment] comment (Class c) : c.ownedAttribute.select(a|Comment.isInstance(a.type));
List[Property] associationEnd (Class c) : c.ownedAttribute.select(a|Class.isInstance(a.type));
String getCommentBody(Comment c) : c.body.trim();
boolean hasInitValue(Property p) : !p.ownedElement.isEmpty;
String initValue(Property p) :
JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.getJavaDefaultValue(org.eclipse.uml2.uml.Property);
List getSubclasses(Class e) :
JAVA com.anaptecs.jeaf.fwk.generator.util.ClassUtil.getSubclasses(org.eclipse.uml2.uml.Class);
InstanceValue getDefaultValueForEnum(Parameter param):
param.ownedElement.typeSelect(InstanceValue).first().stringValue();
boolean hasDefaultValueForEnum(Parameter param):
!param.ownedElement.typeSelect(InstanceValue).isEmpty;
InstanceValue getDefaultValueForEnumProperty(Property param):
param.ownedElement.typeSelect(InstanceValue).first().stringValue();
boolean hasDefaultValueForEnumProperty(Property param):
!param.ownedElement.typeSelect(InstanceValue).isEmpty;
InstanceValue getDefaultValueForBasicType(Parameter param):
param.getDefault().replaceAll("\"", "") + param.appendJavaTypeDetails();
private cached appendJavaTypeDetails(Parameter param):
if param.type.isFloatType()
then "f"
else "";
boolean hasDefaultValueForBasicType(Parameter param):
if param.getDefault().trim().length > 0
then true
else false;
InstanceValue getDefaultValueForBasicTypeProperty(Property param):
param.getDefault().replaceAll("\"", "");
boolean hasDefaultValueForBasicTypeProperty(Property param):
if param.getDefault().trim().length > 0
then true
else false;