View Javadoc
1   package org.andromda.metafacades.uml14;
2   
3   import org.andromda.core.common.ExceptionUtils;
4   import org.andromda.translation.ocl.ExpressionKinds;
5   
6   /**
7    * Metaclass facade implementation.
8    * @author Bob Fields
9    */
10  public class EntityQueryOperationLogicImpl
11      extends EntityQueryOperationLogic
12  {
13      private static final long serialVersionUID = 34L;
14      /**
15       * @param metaObject
16       * @param context
17       */
18      public EntityQueryOperationLogicImpl(
19          Object metaObject,
20          String context)
21      {
22          super(metaObject, context);
23      }
24  
25      /**
26       * @see org.andromda.metafacades.uml.EntityQueryOperation#getQuery(String)
27       */
28      @Override
29      protected String handleGetQuery(String translation)
30      {
31          ExceptionUtils.checkEmpty("translation", translation);
32          final String[] translatedExpressions = this.translateConstraints(ExpressionKinds.BODY, translation);
33          String query = null;
34  
35          // we just get the first body constraint found
36          if (translatedExpressions != null && translatedExpressions.length > 0)
37          {
38              query = translatedExpressions[0];
39          }
40          return query;
41      }
42  }