All Downloads are FREE. Search and download functionalities are using the official Maven repository.

java.GeneratorCommons.ext Maven / Gradle / Ivy

There is a newer version: 1.24.1
Show newest version
extension java::Naming;
extension java::OpenAPIFunctions;

// Function checks whether the passed package is part of the package white list for generation. 
cached String isMayBeInPackageWhitelist(uml::Package package) : 
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.isMayBeInPackageWhitelist(org.eclipse.uml2.uml.Package);
    
cached boolean isInGeneratorWhitelist(uml::NamedElement namedElement) : 
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.isInGeneratorWhitelist(org.eclipse.uml2.uml.NamedElement);
    
cached List getAuthorizationTypeNames(uml::Interface service) :
    JAVA com.anaptecs.jeaf.fwk.generator.util.AuthorizationHelper.getAuthorizationTypeNames(org.eclipse.uml2.uml.Interface);
    
cached boolean isStereotypeApplied(uml::Element element, String stereotype) :
    JAVA com.anaptecs.jeaf.fwk.generator.util.ClassUtil.isStereotypeApplied(org.eclipse.uml2.uml.Element, java.lang.String);
    
cached String getStereotypeValue(uml::Element element, String stereotype, String attribute) :
    JAVA com.anaptecs.jeaf.fwk.generator.util.ClassUtil.getStereotypeValue(org.eclipse.uml2.uml.Element, java.lang.String, java.lang.String);
    
cached List getAllAuthorizationTypes(uml::Model model) :
    JAVA com.anaptecs.jeaf.fwk.generator.util.AuthorizationHelper.getAllAuthorizationTypes(org.eclipse.uml2.uml.Model);
   
cached List[JMM::SecurityRole] getAllSecurityRoles(uml::Model model) :
    JAVA com.anaptecs.jeaf.fwk.generator.util.AuthorizationHelper.getAllSecurityRoles(org.eclipse.uml2.uml.Model);

cached List getAllUseCases(uml::Model model) :
    JAVA com.anaptecs.jeaf.fwk.generator.util.AuthorizationHelper.getAllUseCases(org.eclipse.uml2.uml.Model);

cached List getReferencedAuthorizationTypeNames(uml::Actor actor) :
    JAVA com.anaptecs.jeaf.fwk.generator.util.AuthorizationHelper.getReferencedAuthorizationTypeNames(org.eclipse.uml2.uml.Actor);

cached List getAssociatedUseCases(uml::Actor actor) :
    JAVA com.anaptecs.jeaf.fwk.generator.util.AuthorizationHelper.getAssociatedUseCases(org.eclipse.uml2.uml.Actor);

cached boolean generateServiceObjects() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateServiceObjects();
    
cached boolean generatePOJOs() :
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generatePOJOs();    
    
cached boolean generateEqualsAndHashCode() :
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateEqualsAndHashCode();
    
cached boolean generateEqualsAndHashCodeForStandardClasses() :
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateEqualsAndHashCodeForStandardClasses();
    
cached boolean generateEqualsAndHashCodeForCompositeDataTypes() :
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateEqualsAndHashCodeForCompositeDataTypes();
    
cached boolean generateEqualsAndHashCodeForOpenAPIDataTypes() :
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateEqualsAndHashCodeForOpenAPIDataTypes();
    
cached boolean makePOJOsSerializable() :
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.makePOJOsSerializable(); 
    
cached boolean generateImmutableClasses():
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateImmutableClasses();
    
cached boolean generateHeavyStyleExtensibleEnums() :
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateHeavyStyleExtensibleEnums();    

cached boolean generateExceptionClasses() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateExceptionClasses();
    
cached boolean generateServices() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateServices();
    
cached boolean generateServiceProxies() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateServiceProxies();
    
cached boolean generateServiceProviderInterfaces() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateServiceProviderInterfaces();
    
cached boolean generateServiceProviderImpls() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateServiceProviderImpls();
    
cached boolean generateRESTResources() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateRESTResources();
    
cached boolean generateSecurityAnnotation() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateSecurityAnnotation();
    
cached boolean useDeprecatedSpringSecuredAnnotation() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.useDeprecatedSpringSecuredAnnotation();
    
cached boolean generateRESTRequestValidation() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateRESTRequestValidation();
    
cached boolean generateRESTResponseValidation() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateRESTResponseValidation();
    
cached boolean filterCustomHeaders() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.filterCustomHeaders();
    
cached boolean generateRESTServiceProxies() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateRESTServiceProxies();
    
cached boolean generateRESTServiceProxyConfigFile() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateRESTServiceProxyConfigFile();
    
cached boolean generateActivityInterfaces() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateActivityInterfaces();
    
cached boolean generateActivityImpls() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateActivityImpls();
    
cached boolean generateDomainObjects() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateDomainObjects();
    
cached boolean generatePersistentObjects() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generatePersistentObjects();
    
cached boolean generateObjectMappers() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateObjectMappers();
    
cached boolean generateComponentImplClasses() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateComponentImplClasses();
    
cached boolean generateComponentRuntimeClasses() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateComponentRuntimeClasses();
    
cached boolean generateGlobalParts() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateGlobalParts();
    
cached boolean generateCustomConstraints() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateCustomConstraints();
    
cached boolean generateJUnitTests() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateJUnitTests();

cached boolean generateTypesReport( ):
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateTypesReport();

cached String getTypesReportName( ):
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.getTypesReportName();
    
cached String getTypesReportFileName( ):
    getTypesReportFileNameProperty() + getDeprecationReportFileExtension();   
    
private cached String getTypesReportFileNameProperty():    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.getTypesReportFileName();

cached boolean showAliasInTypesReport( ):
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.showAliasInTypesReport();
    
cached String getAliasRowName( ):
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.getAliasRowName();
    
cached boolean showPackageInTypesReport( ):
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.showPackageInTypesReport();
    
cached boolean showPropertiesInTypesReport( ):
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.showPropertiesInTypesReport();
    
cached boolean groupTypesReportByPackage( ):
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.groupTypesReportByPackage();
    
cached List[String] getTypesReportStereotypes( ):
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.getTypesReportStereotypes();

cached boolean generateBreakingChangesReport():    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateBreakingChangesReport();
    
cached String getBreakingChangesReportName():    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.getBreakingChangesReportName();
    
cached String getBreakingChangesReportFileName():
    getBreakingChangesReportFileNameProperty() + getDeprecationReportFileExtension();   

private cached String getBreakingChangesReportFileNameProperty():    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.getBreakingChangesReportFileName();
    
cached boolean generateRESTDeprecationReport():    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateRESTDeprecationReport();
    
cached String getRESTDeprecationReportName():    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.getRESTDeprecationReportName();
    
cached String getRESTDeprecationReportFileName():
    getRESTDeprecationReportFileNameProperty() + getDeprecationReportFileExtension();    

private cached String getRESTDeprecationReportFileNameProperty():    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.getRESTDeprecationReportFileName();
    
cached boolean generateJavaDeprecationReport():    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateJavaDeprecationReport();
    
cached String getJavaDeprecationReportName():    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.getJavaDeprecationReportName();
    
cached String getJavaDeprecationReportFileName():
    getJavaDeprecationReportFileNameProperty() + getDeprecationReportFileExtension();
    
private cached String getJavaDeprecationReportFileNameProperty():    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.getJavaDeprecationReportFileName();
    
cached String getDeprecationReportFormat():    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.getDeprecationReportFormat();
    
private cached String getDeprecationReportFileExtension():    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.getDeprecationReportFileExtension();
   
cached boolean generateSecurityRolesReport():    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateSecurityRolesReport();
    
cached String getSecurityRolesReportName():    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.getSecurityRolesReportName();
    
cached String getSecurityRolesReportFileName():
    getSecurityRolesReportFileNameProperty() + getSecurityRolesReportFileExtension();
    
private cached String getSecurityRolesReportFileNameProperty():    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.getSecurityRolesReportFileName();
    
cached String getSecurityRolesReportFormat():    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.getSecurityRolesReportFormat();
    
private cached String getSecurityRolesReportFileExtension():    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.getSecurityRolesReportFileExtension();

cached boolean generateOpenAPISpec() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateOpenAPISpec();
    
cached boolean enableYAML11Compatibility() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.enableYAML11Compatibility();
    
cached String getOpenAPICommentStyle() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.getOpenAPICommentStyle();
    
cached boolean addIgnorableHeadersToOpenAPISpec() :
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.addIgnorableHeadersToOpenAPISpec();
    
cached boolean generateJAXRSAnnotations() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateJAXRSAnnotations();
    
cached boolean generateJacksonAnnotations() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateJacksonAnnotations();
    
cached boolean enableSemVerForJSON() :
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.enableSemVerForJSON();
    
cached boolean generateJSONSerializers() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateJSONSerializers();
    
cached boolean generateConstantsForAttributeNames() :
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateConstantsForAttributeNames();
        
cached List[String] getSuppressedWarnings( ):
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.getSuppressedWarnings();

cached boolean suppressAllWarnings( ):
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.suppressAllWarnings();

cached boolean addGeneratedAnnotation( ):
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.addGeneratedAnnotation();

cached String getGeneratedAnnotation():
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.getGeneratedAnnotation();

cached boolean generateValidAnnotationsForClasses() :
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateValidAnnotationsForClasses();
    
cached boolean generateValidAnnotationsForAssociations() :
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateValidAnnotationsForAssociations();
    
cached boolean generateValidationAnnotationsForAttributesFromMultiplicity() :
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateValidationAnnotationsForAttributesFromMultiplicity();
    
cached boolean generateValidationAnnotationsForAssociationsFromMultiplicity() :
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateValidationAnnotationsForAssociationsFromMultiplicity();
    
cached boolean generateObjectValidationInBuilder() :
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateObjectValidationInBuilder();
    
cached boolean suppressClassNameCommentInOpenAPISpec() :
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.suppressClassNameCommentInOpenAPISpec();

cached String getMavenVersion() :
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.getMavenVersion();        

cached String getFileHeader() :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.getFileHeader();        
    
cached String getOIDRowName(uml::Class class) :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.ClassUtil.getOIDRowName(org.eclipse.uml2.uml.Class);
    
cached String getVersionLabelRowName(uml::Class class) :    
    JAVA com.anaptecs.jeaf.fwk.generator.util.ClassUtil.getVersionLabelRowName(org.eclipse.uml2.uml.Class);
    
cached boolean generatePublicSettersForAssociations() :
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generatePublicSettersForAssociations();
    
cached boolean generateOfOperation() :
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateOfOperation();
    
cached boolean generateOfOperationForOpenAPIDataType() :
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateOfOperationForOpenAPIDataType();
    
cached boolean generateValueOfForOpenAPIDataTypes() :
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateValueOfForOpenAPIDataTypes();
    
cached boolean generateNullChecksForToOneAssociationsOfServiceObjects() :
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateNullChecksForToOneAssociationsOfServiceObjects();
    
cached boolean generatePublicObjectView() :
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generatePublicObjectView();
    
cached boolean disableCollectionImmutability():
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.disableCollectionImmutability();
            
cached boolean disableArrayImmutability():
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.disableArrayImmutability();
            
cached boolean disableBinaryDataImmutability():
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.disableBinaryDataImmutability();
    
cached boolean enableDetailedToString():
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.enableDetailedToString();
    
cached boolean enableLegacyBuilderStyle():
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.enableLegacyBuilderStyle();
    
cached boolean generateBuilderMethodWithAllManadatoryFields():
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.generateBuilderMethodWithAllManadatoryFields();
    
cached boolean isBinaryType(uml::Property property):
    property.type.name == "byte";
            
cached boolean isPort(uml::Property property):
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.isPort(org.eclipse.uml2.uml.Property);
    
cached boolean runChecks(uml::NamedElement element):
    runChecks(element, "");

cached boolean runChecks(uml::NamedElement element, String stereotype):
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.runChecks(org.eclipse.uml2.uml.NamedElement, java.lang.String);
    
cached boolean isCharSequence(uml::Type type):
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.isCharSequence(org.eclipse.uml2.uml.Type);

cached boolean isNumericForAnnotation(uml::Type type):
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.isNumericForAnnotation(org.eclipse.uml2.uml.Type);

cached boolean isDateForAnnotation(uml::Type type):
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.isDateForAnnotation(org.eclipse.uml2.uml.Type);

cached boolean isBooleanForAnnotation(uml::Type type):
    JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.isBooleanForAnnotation(org.eclipse.uml2.uml.Type);

cached boolean hasReadOnlyProperties(uml::Class class):
    JAVA com.anaptecs.jeaf.fwk.generator.util.ClassUtil.hasReadOnlyProperties(org.eclipse.uml2.uml.Class);
    
cached boolean needsToImplementIdentifiable(uml::Class class):
    JAVA com.anaptecs.jeaf.fwk.generator.util.ClassUtil.needsToImplementIdentifiable(org.eclipse.uml2.uml.Class);
    
cached boolean implementsIdentifiable(uml::Class class):
    JAVA com.anaptecs.jeaf.fwk.generator.util.ClassUtil.implementsIdentifiable(org.eclipse.uml2.uml.Class);
    
cached boolean isPOJO(uml::Element element):
    element.isStereotypeApplied("POJO");
    
cached boolean isServiceObject(uml::Element element):
    element.isStereotypeApplied("ServiceObject");
    
boolean isJEAFEnumerationProperty(uml::Property property) : 
    isStereotypeApplied(property.type, "JEAFEnumeration");   
    
boolean isParamJEAFEnumeration(uml::Parameter parameter) : 
    parameter.type.isStereotypeApplied("JEAFEnumeration");   
    
cached boolean isDomainObject(uml::Element element):
    element.isStereotypeApplied("DomainObject");
    
cached boolean isPersistentObject(uml::Element element):
    element.isStereotypeApplied("PersistentObject");
    
cached boolean hasPersistentClasses(uml::Package package):
	JAVA com.anaptecs.jeaf.fwk.generator.util.ClassUtil.hasPersistentClasses(org.eclipse.uml2.uml.Package);
    
List getPersistentClassNames(uml::Package package):
	JAVA com.anaptecs.jeaf.fwk.generator.util.ClassUtil.getPersistentClassNames(org.eclipse.uml2.uml.Package);
	
List getPersistentClassesMappingFileNames(uml::Package package):
	JAVA com.anaptecs.jeaf.fwk.generator.util.ClassUtil.getPersistentClassesMappingFileNames(org.eclipse.uml2.uml.Package);
	
String getObjectIDClassName(JMM::ServiceObject serviceObject): 'com.anaptecs.jeaf.core.api.ServiceObjectID';

String getObjectIDClassName(JMM::POJO pojo): 'com.anaptecs.jeaf.xfun.api.common.ObjectID';

String getObjectIDClassName(JMM::DomainObject domainObject): 'com.anaptecs.jeaf.core.api.DomainObjectID';

uml::Class getOwningClass(uml::Operation operation): (uml::Class) operation.owner;

boolean isDeprecated(uml::NamedElement element) :
  isStereotypeApplied(element, "JEAFDeprecated") || isStereotypeApplied(element, "deprecated");
  
cached boolean isReadOnly(uml::Property property):
  property.isReadOnly || property.isStereotypeApplied("CompositeDataTypePublicField") || property.owner.isReadOnlyClass() || generateImmutableClasses();
  
cached boolean isReadOnlyClass(uml::Element class):
  if class.isStereotypeApplied("POJO")
  then ((JMM::ServiceObject) class).readOnly
  else 
        if class.isStereotypeApplied("ServiceObject")
        then ((JMM::POJO) class).readOnly
        else false;

  
boolean isTransient(uml::Property property):
  property.isStereotypeApplied("Transient") || property.isStereotypeApplied("CompositeDataTypePublicField");
  
cached boolean isTransientBidirectionalBackReference(uml::Property property) :
  property.opposite != null && property.opposite.isNavigable() && property.opposite.isTransient();
  
cached boolean belongsToTransientBidirectionalBackReference(uml::Property property) :
  property.opposite != null && property.isNavigable() && property.isTransient();
  
cached boolean isBooleanType(uml::Type type) :
  type.fqn() == "java.lang.Boolean" || type.fqn() == "Boolean" ||type.fqn() == "boolean"; 

cached boolean isStringType(uml::Type type) :
  type.fqn() == "java.lang.String" || type.fqn() == "String";
  
cached boolean isCharacterType(uml::Type type) :
  type.fqn() == "java.lang.Character" || type.fqn() == "char";
  
cached boolean isUtilDate(uml::Type type) :
  type.fqn() == "java.util.Date";

cached boolean isCalendar(uml::Type type) :
  type.fqn() == "java.util.Calendar";
  
cached boolean isLocalDate(uml::Type type) :
  type.fqn() == "java.time.LocalDate";

cached boolean isLocalDateTime(uml::Type type) :
  type.fqn() == "java.time.LocalDateTime";

cached boolean isLocalTime(uml::Type type) :
  type.fqn() == "java.time.LocalTime";
  
cached boolean isLocalDateType(uml::Type type) :
  isLocalDateTime(type) || isLocalTime(type) || isLocalDate(type);

cached boolean isOffsetDateTime(uml::Type type) :
  type.fqn() == "java.time.OffsetDateTime";

cached boolean isOffsetTime(uml::Type type) :
  type.fqn() == "java.time.OffsetTime";
  
cached boolean belongsToJavaTimeAPI(uml::Type type) :
  isLocalDate(type) || isLocalDateTime(type) || isLocalTime(type) || isOffsetDateTime(type) || isOffsetTime(type);
  
cached boolean isSQLDate(uml::Type type) :
  type.fqn() == "java.sql.Date";

cached boolean isSQLTime(uml::Type type) :
  type.fqn() == "java.sql.Time";

cached boolean isSQLTimestamp(uml::Type type) :
  type.fqn() == "java.sql.Timestamp";
  
cached boolean isSQLDateType(uml::Type type) :
  isSQLTimestamp(type) || isSQLTime(type) || isSQLDate(type);
  
cached boolean isAnyDateType(uml::Type type) :
  isOffsetDateTime(type) || isOffsetTime(type) || isLocalDateType(type) || isSQLDateType(type) || isUtilDate(type) || isCalendar(type);

cached boolean isByteType(uml::Type type) :
  type.fqn() == "java.lang.Byte" || type.fqn() == "Byte" || type.fqn() == "byte"; 

cached boolean isShortType(uml::Type type) :
  type.fqn() == "java.lang.Short" || type.fqn() == "Short" || type.fqn() == "short"; 

cached boolean isIntegerType(uml::Type type) :
  type.fqn() == "java.lang.Integer" || type.fqn() == "Integer" || type.fqn() == "int"; 

cached boolean isLongType(uml::Type type) :
  type.fqn() == "java.lang.Long" || type.fqn() == "Long" || type.fqn() == "long"; 

cached boolean isFloatType(uml::Type type) :
  type.fqn() == "java.lang.Float" || type.fqn() == "Float" || type.fqn() == "float"; 

cached boolean isDoubleType(uml::Type type) :
  type.fqn() == "java.lang.Double" || type.fqn() == "Double" || type.fqn() == "double"; 

cached boolean isCharatcerType(uml::Type type) :
  type.fqn() == "java.lang.Character" || type.fqn() == "char"; 

cached boolean isBigInteger(uml::Type type) :
  type.fqn() == "java.math.BigInteger"; 

cached boolean isBigDecimal(uml::Type type) :
  type.fqn() == "java.math.BigDecimal";

cached boolean isEnumeration(uml::Element element):
  JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.isEnumeration(org.eclipse.uml2.uml.Element);  
  
cached String getEnterpriseJavaPackage():
  JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.getEnterpriseJavaPackage();

cached boolean isTargetRuntimeJEAF():
  JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.isTargetRuntimeJEAF();
  
cached boolean isTargetRuntimeJava():
  JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.isTargetRuntimeJava();
  
cached boolean isTargetRuntimeSpring():
  JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.isTargetRuntimeSpring();
  
cached boolean isRESTLibraryJAXRS():
  JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.isRESTLibraryJAXRS();
  
cached boolean isRESTLibrarySpringWebMVC():
  JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.isRESTLibrarySpringWebMVC();
  
cached int getRESTDefaultSuccessStatusCode():
  JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.getRESTDefaultSuccessStatusCode();
  
cached int getRESTDefaultVoidStatusCode():
  JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.getRESTDefaultVoidStatusCode();
  
cached boolean isCompositeDataType(uml::Type class):
  if generatePublicObjectView() == false
  then false
  else 
	  if class.isStereotypeApplied("POJO")
	  then ((JMM::POJO) class).compositeDataType
	  else 
	  		if class.isStereotypeApplied("ServiceObject")
	  		then ((JMM::ServiceObject) class).compositeDataType
	  		else false;
 
cached String getCompositeDateTypePublicFieldName(uml::Type class):
  if class.isStereotypeApplied("POJO")
  then ((JMM::POJO) class).compositeDataTypePublicFieldName
  else 
  		if class.isStereotypeApplied("ServiceObject")
  		then ((JMM::ServiceObject) class).compositeDataTypePublicFieldName
  		else false;
 
cached boolean isCompositeDataTypeReadonly(uml::Type class):
  if class.isStereotypeApplied("POJO")
  then ((JMM::POJO) class).compositeDataTypeReadonly
  else 
  		if class.isStereotypeApplied("ServiceObject")
  		then ((JMM::ServiceObject) class).compositeDataTypeReadonly
  		else false;
 
cached boolean hasCompositeDateTypeCustomSerialization(uml::Type class):
  if class.isStereotypeApplied("POJO")
  then ((JMM::POJO) class).compositeDataTypeCustomSerialization
  else 
  		if class.isStereotypeApplied("ServiceObject")
  		then ((JMM::ServiceObject) class).compositeDataTypeCustomSerialization
  		else false;
 
cached boolean generateInternalViewOfCompositeDataType(uml::Type class):
  if generatePublicObjectView() == true
  then false
  else 
	  if class.isStereotypeApplied("POJO")
	  then ((JMM::POJO) class).compositeDataType
	  else 
	  		if class.isStereotypeApplied("ServiceObject")
	  		then ((JMM::ServiceObject) class).compositeDataType
	  		else false;

cached List[uml::Property] getCompositePublicFieldProperties(uml::Type type):
	type.getAllAttributesFromHierarchy().select(e|e.isStereotypeApplied("CompositeDataTypePublicField"));
	
cached boolean hasCompositePublicFieldProperties(uml::Type type):
	!type.getCompositePublicFieldProperties().isEmpty;


cached boolean hasCustomHeaders(uml::Type class):
	if class.isStereotypeApplied("BeanParam")
	then ((JMM::BeanParam)class).supportsCustomHeaders
	else false;
	  		
cached boolean hasParamCustomHeaders(uml::Parameter param):
	if param.isStereotypeApplied("BeanParam")
	then ((JMM::BeanParam)param).supportsCustomHeaders
	else 
		if param.type.isStereotypeApplied("BeanParam")
		then ((JMM::BeanParam) param.type).hasHierarchyCustomHeaders()
		else false;
	
cached boolean hasHierarchyCustomHeaders(JMM::BeanParam class):
	if class.supportsCustomHeaders 
	then true
	else 
		if class.superClass != null && class.superClass.typeSelect(JMM::BeanParam).size > 0
		then class.superClass.typeSelect(JMM::BeanParam).first().hasHierarchyCustomHeaders()
		else false;
	  		

cached boolean validateOnBuild(uml::Class class):
  if class.isStereotypeApplied("POJO")
  then ((JMM::POJO) class).validateOnBuild
  else 
        if class.isStereotypeApplied("ServiceObject")
        then ((JMM::ServiceObject) class).validateOnBuild
        else false;
 
    

cached int getMetaModelVersion(uml::Element element):
  element.getModel().getAllAppliedProfiles().allOwnedElements().typeSelect(JMM::ModelVersion).get(0).revision;
  
String getWarningMessage(uml::NamedElement element, String errorCode, List[String] params):
	"       " + getMessage(element, errorCode, params);

String getErrorMessage(uml::NamedElement element, String errorCode, List[String] params):
	" !!!  " + getMessage(element, errorCode, params);

String getMessage(uml::NamedElement element, String errorCode, List[String] params):
	JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.getMessage(org.eclipse.uml2.uml.NamedElement, java.lang.String, java.util.List);
 
 
cached String toLocalVar(String name) :
 	if( name.startsWith("p"))
 	then name.replaceFirst("p", "l")
 	else "l" + name.toFirstUpper();

cached boolean ignore(uml::Element element):
	element.isStereotypeApplied("Ignore") || element.owner.isStereotypeApplied("Ignore");
	
cached List[uml::Property] getRequiredPropertiesForBuilder(uml::Class class):
	class.getAllAttributesFromHierarchy().select(e|e.isMultivalued() == false && e.isStatic == false && e.lower > 0 && e.isPropertySuppressed() == false && e.belongsToTransientBidirectionalBackReference() == false);
	
	
cached boolean suppressTechnicalHttpHeaders():
	JAVA com.anaptecs.jeaf.fwk.generator.util.GeneratorCommons.suppressTechnicalHttpHeaders();
	
cached boolean isParameterSuppressed(uml::Parameter param):
	suppressTechnicalHttpHeaders() && (param.isTechnicalHeaderParameter() || (param.isBeanParamater() && param.type.getAllAttributesFromHierarchy().select(e|e.isPropertySuppressed() == false).size == 0 ));

cached boolean isPropertySuppressed(uml::Property property):
	(suppressTechnicalHttpHeaders() && property.isTechnicalHeaderProperty()) || property.isDerived  || property.isStereotypeApplied("Ignore");
	
cached boolean isTechnicalHeaderParameter(uml::Parameter param):
	param.isStereotypeApplied("HeaderParam") && ((JMM::HeaderParam) param).technicalHeader;

cached boolean isTechnicalHeaderProperty(uml::Property property):
	property.isStereotypeApplied("HeaderParam") && ((JMM::HeaderParam) property).technicalHeader;

cached boolean isTechnicalBaseClass(uml::Class class):
    if class.isStereotypeApplied("POJO")
    then ((JMM::POJO) class).technicalBaseClass
    else 
        if class.isStereotypeApplied("ServiceObject")
        then ((JMM::ServiceObject) class).technicalBaseClass
        else false;
    




© 2015 - 2024 Weber Informatics LLC | Privacy Policy