diff options
author | Florian Noyrit | 2017-04-14 13:26:02 +0000 |
---|---|---|
committer | Florian Noyrit | 2017-04-14 13:48:39 +0000 |
commit | c9d1442de195404898e8d43fac8e614921aa93dc (patch) | |
tree | 736873b9d98e5f0d9ff21edd29b6d68a7979295d /extraplugins/dsml.validation | |
parent | 4cb2981a4c989a031eb145291a8d7faf66308f56 (diff) | |
download | org.eclipse.papyrus-c9d1442de195404898e8d43fac8e614921aa93dc.tar.gz org.eclipse.papyrus-c9d1442de195404898e8d43fac8e614921aa93dc.tar.xz org.eclipse.papyrus-c9d1442de195404898e8d43fac8e614921aa93dc.zip |
[releng] Clean working directory
- Remove some orphan files
Change-Id: I61d37fb3a5d2de29b08d89a00ef6ed03c812fdd7
Diffstat (limited to 'extraplugins/dsml.validation')
2 files changed, 0 insertions, 382 deletions
diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.generator/xtend-gen/org/eclipse/papyrus/dsml/validation/generator/xtend/ClientSelectorGen.java b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.generator/xtend-gen/org/eclipse/papyrus/dsml/validation/generator/xtend/ClientSelectorGen.java deleted file mode 100755 index 2a670c423aa..00000000000 --- a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.generator/xtend-gen/org/eclipse/papyrus/dsml/validation/generator/xtend/ClientSelectorGen.java +++ /dev/null @@ -1,110 +0,0 @@ -/** - * Copyright (c) 2014 CEA LIST and others. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * CEA LIST - Initial API and implementation - */ -package org.eclipse.papyrus.dsml.validation.generator.xtend; - -import com.google.common.collect.Iterators; -import java.util.Iterator; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.papyrus.dsml.validation.model.profilenames.Utils; -import org.eclipse.papyrus.infra.tools.file.IPFileSystemAccess; -import org.eclipse.uml2.uml.Stereotype; -import org.eclipse.xtend2.lib.StringConcatenation; - -/** - * Generator for producing client selector files: Java files that filter the stereotype - * for validation - */ -@SuppressWarnings("all") -public class ClientSelectorGen { - public static CharSequence generateValidationContext(final Stereotype stereotype) { - StringConcatenation _builder = new StringConcatenation(); - _builder.append("/**"); - _builder.newLine(); - _builder.append(" "); - _builder.append("* Created by the Papyrus DSML plugin generator"); - _builder.newLine(); - _builder.append(" "); - _builder.append("*/"); - _builder.newLine(); - _builder.newLine(); - _builder.append("package "); - String _topPkg = Utils.getTopPkg(); - _builder.append(_topPkg); - _builder.append(".selectors;"); - _builder.newLineIfNotEmpty(); - _builder.newLine(); - _builder.append("import org.eclipse.emf.validation.model.IClientSelector;"); - _builder.newLine(); - _builder.append("import org.eclipse.papyrus.uml.service.validation.StereotypeUtil;"); - _builder.newLine(); - _builder.newLine(); - _builder.append("/**"); - _builder.newLine(); - _builder.append(" "); - _builder.append("* This class filters (selects) passed stereotype applications. It returns true, if the"); - _builder.newLine(); - _builder.append(" "); - _builder.append("* associated stereotype (or one of its super-stereotypes) has the name \'[stereotype.name/]\'."); - _builder.newLine(); - _builder.append(" "); - _builder.append("*"); - _builder.newLine(); - _builder.append(" "); - _builder.append("* @generated"); - _builder.newLine(); - _builder.append(" "); - _builder.append("*/"); - _builder.newLine(); - _builder.append("public class "); - String _name = stereotype.getName(); - _builder.append(_name); - _builder.append("ClientSelector implements IClientSelector {"); - _builder.newLineIfNotEmpty(); - _builder.newLine(); - _builder.append("\t"); - _builder.append("public boolean selects(Object stereoApplicationObj) {"); - _builder.newLine(); - _builder.append("\t\t"); - _builder.append("return StereotypeUtil.checkStereoApplication(stereoApplicationObj, \""); - String _name_1 = stereotype.getName(); - _builder.append(_name_1, "\t\t"); - _builder.append("\"); //$NON-NLS-1$"); - _builder.newLineIfNotEmpty(); - _builder.append("\t"); - _builder.append("}"); - _builder.newLine(); - _builder.append("}"); - _builder.newLine(); - return _builder; - } - - /** - * @see org.eclipse.xtext.generator.IGenerator#doGenerate(org.eclipse.emf.ecore.resource.Resource, org.eclipse.xtext.generator.IFileSystemAccess) - * - * @param input - * @param fsa - */ - public static void generate(final Resource input, final IPFileSystemAccess fsa) { - final Iterator<Stereotype> contentIterator = Iterators.<Stereotype>filter(input.getAllContents(), Stereotype.class); - while (contentIterator.hasNext()) { - { - final Stereotype stereotype = contentIterator.next(); - String _replaceAll = Utils.getTopPkg().replaceAll("\\.", "/"); - String _plus = (_replaceAll + "/selectors/"); - String _name = stereotype.getName(); - String _plus_1 = (_plus + _name); - final String fileName = (_plus_1 + "ClientSelector.java"); - fsa.generateFile(fileName, ClientSelectorGen.generateValidationContext(stereotype).toString()); - } - } - } -} diff --git a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.generator/xtend-gen/org/eclipse/papyrus/dsml/validation/generator/xtend/ConstraintGen.java b/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.generator/xtend-gen/org/eclipse/papyrus/dsml/validation/generator/xtend/ConstraintGen.java deleted file mode 100755 index 13af0ce6c6f..00000000000 --- a/extraplugins/dsml.validation/org.eclipse.papyrus.dsml.validation.generator/xtend-gen/org/eclipse/papyrus/dsml/validation/generator/xtend/ConstraintGen.java +++ /dev/null @@ -1,272 +0,0 @@ -package org.eclipse.papyrus.dsml.validation.generator.xtend; - -import com.google.common.base.Objects; -import com.google.common.collect.Iterators; -import java.util.Iterator; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.papyrus.dsml.validation.model.profilenames.Utils; -import org.eclipse.papyrus.infra.tools.file.IPFileSystemAccess; -import org.eclipse.uml2.uml.Constraint; -import org.eclipse.xtend2.lib.StringConcatenation; - -/** - * A generator for Java based constraints - */ -@SuppressWarnings("all") -public class ConstraintGen { - public static CharSequence generateConstraint(final Constraint constraint) { - StringConcatenation _builder = new StringConcatenation(); - _builder.append("/**"); - _builder.newLine(); - _builder.append(" "); - _builder.append("* Created by the Papyrus DSML plugin generator"); - _builder.newLine(); - _builder.append(" "); - _builder.append("*/"); - _builder.newLine(); - _builder.newLine(); - _builder.append("package "); - String _topPkg = Utils.getTopPkg(); - _builder.append(_topPkg); - _builder.append(".constraints;"); - _builder.newLineIfNotEmpty(); - _builder.newLine(); - _builder.append("import org.eclipse.core.runtime.IStatus;"); - _builder.newLine(); - _builder.append("import org.eclipse.emf.validation.AbstractModelConstraint;"); - _builder.newLine(); - _builder.append("import org.eclipse.emf.validation.IValidationContext;"); - _builder.newLine(); - _builder.append("import org.eclipse.emf.ecore.EObject;"); - _builder.newLine(); - { - boolean _isStaticProfile = Utils.isStaticProfile(); - boolean _not = (!_isStaticProfile); - if (_not) { - _builder.append("import org.eclipse.uml2.uml.Element;"); - _builder.newLine(); - _builder.append("import org.eclipse.uml2.uml.Stereotype;"); - _builder.newLine(); - _builder.append("import org.eclipse.uml2.uml.util.UMLUtil;"); - _builder.newLine(); - } - } - _builder.newLine(); - _builder.append("public class "); - String _name = constraint.getName(); - _builder.append(_name); - _builder.append("Constraint extends AbstractModelConstraint {"); - _builder.newLineIfNotEmpty(); - _builder.newLine(); - _builder.append("\t"); - _builder.append("public IStatus validate(IValidationContext ctx) {"); - _builder.newLine(); - _builder.append("\t\t"); - _builder.append("EObject target = ctx.getTarget();"); - _builder.newLine(); - _builder.newLine(); - { - Boolean _isConstraintForStereotype = Utils.isConstraintForStereotype(constraint); - if ((_isConstraintForStereotype).booleanValue()) { - _builder.append("\t\t"); - final String qStereotypeName = Utils.getConstraintForStereotype(constraint); - _builder.newLineIfNotEmpty(); - { - boolean _isStaticProfile_1 = Utils.isStaticProfile(); - if (_isStaticProfile_1) { - _builder.append("\t\t"); - final String qStereotypeNameJava = qStereotypeName.replace("::", "."); - _builder.newLineIfNotEmpty(); - _builder.append("\t\t"); - _builder.append("if (target instanceof "); - _builder.append(qStereotypeNameJava, "\t\t"); - _builder.append(") {"); - _builder.newLineIfNotEmpty(); - _builder.append("\t\t"); - _builder.append("\t"); - _builder.append("if (evaluateConstraint(("); - _builder.append(qStereotypeNameJava, "\t\t\t"); - _builder.append(") target)) {"); - _builder.newLineIfNotEmpty(); - } else { - _builder.append("\t\t"); - _builder.append("Stereotype stereotype = UMLUtil.getStereotype(target);"); - _builder.newLine(); - _builder.append("\t\t"); - _builder.append("if (stereotype.getQualifiedName().equals(\""); - _builder.append(qStereotypeName, "\t\t"); - _builder.append("\")) { //$NON-NLS-1$"); - _builder.newLineIfNotEmpty(); - _builder.append("\t\t"); - _builder.append("\t"); - _builder.append("Element element = UMLUtil.getBaseElement(target);"); - _builder.newLine(); - _builder.append("\t\t"); - _builder.append("\t"); - _builder.append("if (evaluateConstraint(element, stereotype)) {"); - _builder.newLine(); - } - } - _builder.append("\t\t"); - _builder.append("\t\t"); - _builder.append("return ctx.createSuccessStatus();"); - _builder.newLine(); - _builder.append("\t\t"); - _builder.append("\t"); - _builder.append("}"); - _builder.newLine(); - _builder.append("\t\t"); - _builder.append("\t"); - _builder.append("else {"); - _builder.newLine(); - _builder.append("\t\t"); - _builder.append("\t\t"); - _builder.append("return ctx.createFailureStatus(\"\"); //$NON-NLS-1$ failure message is in plugin.xml"); - _builder.newLine(); - _builder.append("\t\t"); - _builder.append("\t"); - _builder.append("}"); - _builder.newLine(); - _builder.append("\t\t"); - _builder.append("}"); - _builder.newLine(); - _builder.append("\t\t"); - _builder.append("return ctx.createSuccessStatus();"); - _builder.newLine(); - } else { - _builder.append("\t\t"); - _builder.append("if (evaluateConstraint(target)) {"); - _builder.newLine(); - _builder.append("\t\t"); - _builder.append("\t"); - _builder.append("return ctx.createSuccessStatus();"); - _builder.newLine(); - _builder.append("\t\t"); - _builder.append("}"); - _builder.newLine(); - _builder.append("\t\t"); - _builder.append("else {"); - _builder.newLine(); - _builder.append("\t\t"); - _builder.append("\t"); - _builder.append("return ctx.createFailureStatus(\"\"); //$NON-NLS-1$ failure message is in plugin.xml"); - _builder.newLine(); - _builder.append("\t\t"); - _builder.append("}"); - _builder.newLine(); - } - } - _builder.append("\t"); - _builder.append("}"); - _builder.newLine(); - _builder.newLine(); - { - Boolean _isConstraintForStereotype_1 = Utils.isConstraintForStereotype(constraint); - if ((_isConstraintForStereotype_1).booleanValue()) { - { - boolean _isStaticProfile_2 = Utils.isStaticProfile(); - if (_isStaticProfile_2) { - _builder.append("\t"); - final String qStereotypeName_1 = Utils.getConstraintForStereotype(constraint); - _builder.newLineIfNotEmpty(); - _builder.append("\t"); - final String qStereotypeNameJava_1 = qStereotypeName_1.replace("::", "."); - _builder.newLineIfNotEmpty(); - _builder.append("\t"); - _builder.append("private boolean evaluateConstraint("); - _builder.append(qStereotypeNameJava_1, "\t"); - _builder.append(" self) {"); - _builder.newLineIfNotEmpty(); - } else { - _builder.append("\t"); - _builder.append("private boolean evaluateConstraint(Element self, Stereotype appliedStereotype) {"); - _builder.newLine(); - } - } - { - String _javaConstraintBody = Utils.getJavaConstraintBody(constraint.getSpecification()); - boolean _notEquals = (!Objects.equal(_javaConstraintBody, null)); - if (_notEquals) { - _builder.append("\t"); - _builder.append("\t"); - String _javaConstraintBody_1 = Utils.getJavaConstraintBody(constraint.getSpecification()); - _builder.append(_javaConstraintBody_1, "\t\t"); - _builder.newLineIfNotEmpty(); - } else { - _builder.append("\t"); - _builder.append("\t"); - _builder.append("return true;"); - _builder.newLine(); - } - } - _builder.append("\t"); - _builder.append("}"); - _builder.newLine(); - } - } - _builder.newLine(); - { - Boolean _isConstraintForStereotype_2 = Utils.isConstraintForStereotype(constraint); - boolean _not_1 = (!(_isConstraintForStereotype_2).booleanValue()); - if (_not_1) { - _builder.append("\t"); - _builder.append("private boolean evaluateConstraint(EObject self) {"); - _builder.newLine(); - { - String _javaConstraintBody_2 = Utils.getJavaConstraintBody(constraint.getSpecification()); - boolean _notEquals_1 = (!Objects.equal(_javaConstraintBody_2, null)); - if (_notEquals_1) { - _builder.append("\t"); - _builder.append("\t"); - String _javaConstraintBody_3 = Utils.getJavaConstraintBody(constraint.getSpecification()); - _builder.append(_javaConstraintBody_3, "\t\t"); - _builder.newLineIfNotEmpty(); - } else { - _builder.append("\t"); - _builder.append("\t"); - _builder.append("return true;"); - _builder.newLine(); - } - } - _builder.append("\t"); - _builder.append("}"); - _builder.newLine(); - } - } - _builder.append("}"); - _builder.newLine(); - return _builder; - } - - /** - * @see org.eclipse.xtext.generator.IGenerator#doGenerate(org.eclipse.emf.ecore.resource.Resource, org.eclipse.xtext.generator.IFileSystemAccess) - * - * @param input - * @param fsa - */ - public static void generate(final Resource input, final IPFileSystemAccess fsa) { - final Iterator<Constraint> contentIterator = Iterators.<Constraint>filter(input.getAllContents(), Constraint.class); - while (contentIterator.hasNext()) { - { - final Constraint constraint = contentIterator.next(); - Boolean _hasSpecificationForJava = Utils.hasSpecificationForJava(constraint); - if ((_hasSpecificationForJava).booleanValue()) { - String _name = constraint.getName(); - boolean _equals = Objects.equal(_name, null); - if (_equals) { - String _qualifiedName = constraint.getContext().getQualifiedName(); - String _plus = ("Constraint has no name, context: " + _qualifiedName); - throw new RuntimeException(_plus); - } - String _replaceAll = Utils.getTopPkg().replaceAll("\\.", "/"); - String _plus_1 = (_replaceAll + "/constraints/"); - String _name_1 = constraint.getName(); - String _plus_2 = (_plus_1 + _name_1); - final String fileName = (_plus_2 + - "Constraint.java"); - fsa.generateFile(fileName, ConstraintGen.generateConstraint(constraint).toString()); - } - } - } - } -} |