| [comment encoding = UTF-8 /] |
| [comment |
| /******************************************************************************* |
| * Copyright (c) 2015 Jad El-khoury. |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * and Eclipse Distribution License v. 1.0 which accompanies this distribution. |
| * |
| * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html |
| * and the Eclipse Distribution License is available at |
| * http://www.eclipse.org/org/documents/edl-v10.php. |
| * |
| * Contributors: |
| * |
| * Jad El-khoury - initial implementation of queries for handling of client code. |
| * |
| *******************************************************************************/ |
| /] |
| |
| [module requiredAdaptorServices('http://org.eclipse.lyo/oslc4j/adaptorInterface')/] |
| |
| [import org::eclipse::lyo::oslc4j::codegenerator::services::adaptorInterfaceServices/] |
| [import org::eclipse::lyo::oslc4j::codegenerator::services::resourceServices/] |
| [import org::eclipse::lyo::oslc4j::codegenerator::services::services/] |
| |
| [query public javaClassPackageNameForClient(aRequiredAdaptor : RequiredAdaptor, anAdaptorInterface : AdaptorInterface) : String = |
| javaClassBaseNamespace(anAdaptorInterface).concat('.clients') |
| /] |
| |
| [query public javaClassNameForClient(aRequiredAdaptor : RequiredAdaptor) : String = |
| if (aRequiredAdaptor.oclIsTypeOf(GenericRequiredAdaptor)) then |
| javaString(aRequiredAdaptor.oclAsType(GenericRequiredAdaptor).name, 'oslc', true).concat('Client') |
| else |
| javaName(aRequiredAdaptor.oclAsType(ModelledRequiredAdaptor).adaptorInterface, true).concat('Client') |
| endif |
| /] |
| |
| [query public javaClassFullNameForClient(aRequiredAdaptor : RequiredAdaptor, anAdaptorInterface : AdaptorInterface) : String = |
| javaClassPackageNameForClient(aRequiredAdaptor, anAdaptorInterface).concat('.').concat(javaClassNameForClient(aRequiredAdaptor)) |
| /] |
| |
| [query public javaClassFullFileNameForClient(aRequiredAdaptor : RequiredAdaptor, anAdaptorInterface : AdaptorInterface) : String = |
| javaFilesBasePath(anAdaptorInterface).concatenatePaths(javaClassPackageNameForClient(aRequiredAdaptor, anAdaptorInterface).substituteAll('.', '/')).concat('/').concat(javaClassNameForClient(aRequiredAdaptor)).concat('.java') |
| /] |