1 | /* |
---|
2 | * This file is part of OpenModelica. |
---|
3 | * |
---|
4 | * Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), |
---|
5 | * c/o Linköpings universitet, Department of Computer and Information Science, |
---|
6 | * SE-58183 Linköping, Sweden. |
---|
7 | * |
---|
8 | * All rights reserved. |
---|
9 | * |
---|
10 | * THIS PROGRAM IS PROVIDED UNDER THE TERMS OF GPL VERSION 3 LICENSE OR |
---|
11 | * THIS OSMC PUBLIC LICENSE (OSMC-PL). |
---|
12 | * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE |
---|
13 | * OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, ACCORDING TO RECIPIENTS CHOICE. |
---|
14 | * |
---|
15 | * The OpenModelica software and the Open Source Modelica |
---|
16 | * Consortium (OSMC) Public License (OSMC-PL) are obtained |
---|
17 | * from OSMC, either from the above address, |
---|
18 | * from the URLs: http://www.ida.liu.se/projects/OpenModelica or |
---|
19 | * http://www.openmodelica.org, and in the OpenModelica distribution. |
---|
20 | * GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html. |
---|
21 | * |
---|
22 | * This program is distributed WITHOUT ANY WARRANTY; without |
---|
23 | * even the implied warranty of MERCHANTABILITY or FITNESS |
---|
24 | * FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH |
---|
25 | * IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE CONDITIONS OF OSMC-PL. |
---|
26 | * |
---|
27 | * See the full OSMC Public License conditions for more details. |
---|
28 | * |
---|
29 | * Contributors: |
---|
30 | * Wladimir Schamai, EADS Innovation Works 2009-2011 |
---|
31 | * Uwe Pohlmann, University of Paderborn 2009-2010 |
---|
32 | * Parham Vasaiely, EADS Innovation Works / Hamburg University of Applied Sciences 2009-2011 |
---|
33 | */ |
---|
34 | package org.openmodelica.modelicaml.model.explorer.customization; |
---|
35 | import org.eclipse.gmt.modisco.infra.query.core.exception.ModelQueryExecutionException; |
---|
36 | import org.eclipse.gmt.modisco.infra.query.core.java.IJavaModelQuery; |
---|
37 | import org.eclipse.gmt.modisco.infra.query.core.java.ParameterValueList; |
---|
38 | import org.eclipse.uml2.uml.Classifier; |
---|
39 | |
---|
40 | // TODO: Auto-generated Javadoc |
---|
41 | /** |
---|
42 | * checks if the class has more then x number of properties. |
---|
43 | */ |
---|
44 | public class IsHaveMoreThanXProperties implements IJavaModelQuery<Classifier, Boolean> { |
---|
45 | |
---|
46 | /* (non-Javadoc) |
---|
47 | * @see org.eclipse.gmt.modisco.infra.query.core.java.IJavaModelQuery#evaluate(org.eclipse.emf.ecore.EObject, org.eclipse.gmt.modisco.infra.query.core.java.ParameterValueList) |
---|
48 | */ |
---|
49 | public Boolean evaluate(final Classifier context, final ParameterValueList parameterValues) |
---|
50 | throws ModelQueryExecutionException { |
---|
51 | // TODO Auto-generated method stub |
---|
52 | if (context.getAllAttributes().size() > 3 ) { |
---|
53 | return false; |
---|
54 | } |
---|
55 | return true; |
---|
56 | } |
---|
57 | } |
---|