01: package org.andromda.metafacades.emf.uml2;
02:
03: import org.andromda.core.common.ExceptionUtils;
04: import org.andromda.translation.ocl.ExpressionKinds;
05:
06: /**
07: * MetafacadeLogic implementation for
08: * org.andromda.metafacades.uml.EntityQueryOperation.
09: *
10: * @see org.andromda.metafacades.uml.EntityQueryOperation
11: */
12: public class EntityQueryOperationLogicImpl extends
13: EntityQueryOperationLogic {
14: public EntityQueryOperationLogicImpl(final Object metaObject,
15: final String context) {
16: super (metaObject, context);
17: }
18:
19: /**
20: * @see org.andromda.metafacades.uml.EntityQueryOperation#getQuery(java.lang.String)
21: */
22: protected java.lang.String handleGetQuery(
23: final java.lang.String translation) {
24: ExceptionUtils.checkEmpty("translation", translation);
25: final String[] translatedExpressions = this
26: .translateConstraints(ExpressionKinds.BODY, translation);
27: String query = null;
28:
29: // we just get the first body constraint found
30: if (translatedExpressions != null
31: && translatedExpressions.length > 0) {
32: query = translatedExpressions[0];
33: }
34: return query;
35: }
36: }
|