| [comment encoding = UTF-8 /] |
| [comment |
| /******************************************************************************* |
| * Copyright (c) 2012 IBM Corporation and others. |
| * |
| * 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: |
| * |
| * Russell Boykin - initial API and implementation |
| * Alberto Giammaria - initial API and implementation |
| * Chris Peters - initial API and implementation |
| * Gianluca Bernardini - initial API and implementation |
| * Michael Fiedler - Bugzilla adpater implementations |
| * Jad El-khoury - initial implementation of code generator (https://bugs.eclipse.org/bugs/show_bug.cgi?id=422448) |
| *******************************************************************************/ |
| /] |
| |
| [module generateDomainSpecificationConstants('http://org.eclipse.lyo/oslc4j/adaptorInterface')] |
| |
| [import org::eclipse::lyo::oslc4j::codegenerator::services::services/] |
| [import org::eclipse::lyo::oslc4j::codegenerator::services::serviceServices/] |
| [import org::eclipse::lyo::oslc4j::codegenerator::services::resourceServices/] |
| [import org::eclipse::lyo::oslc4j::codegenerator::services::adaptorInterfaceServices/] |
| [import org::eclipse::lyo::oslc4j::codegenerator::services::domainSpecificationServices/] |
| |
| [template public generateResourceConstants(aResource : Resource)] |
| public static String [resourceConstantName(aResource)/] = "[aResource.javaName(true)/]"; |
| public static String [resourcePathConstantName(aResource)/] = "[aResource.javaName(false)/]"; |
| public static String [resourceTypeConstantName(aResource)/] = [domainSpecificationNamespaceConstantName(aResource.definingDomainSpecification())/] + [resourceConstantName(aResource)/]; |
| [/template] |
| |
| [template public generateDomainSpecificationConstants(aDomainSpecification: DomainSpecification, anAdaptorInterface : AdaptorInterface)] |
| [file (javaInterfaceFullFileNameForConstants(aDomainSpecification, anAdaptorInterface), false, 'UTF-8')] |
| /******************************************************************************* |
| * Copyright (c) 2012 IBM Corporation and others. |
| * |
| * 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: |
| * |
| * Russell Boykin - initial API and implementation |
| * Alberto Giammaria - initial API and implementation |
| * Chris Peters - initial API and implementation |
| * Gianluca Bernardini - initial API and implementation |
| * Michael Fiedler - Bugzilla adpater implementations |
| * Jad El-khoury - initial implementation of code generator (https://bugs.eclipse.org/bugs/show_bug.cgi?id=422448) |
| * |
| * This file is generated by org.eclipse.lyo.oslc4j.codegenerator |
| *******************************************************************************/ |
| |
| package [javaInterfacePackageNameForConstants(aDomainSpecification, anAdaptorInterface) /]; |
| |
| import org.eclipse.lyo.oslc4j.core.model.OslcConstants; |
| |
| // [protected ('imports')] |
| // [/protected] |
| |
| public interface [javaInterfaceNameForConstants(aDomainSpecification) /] |
| { |
| // [protected ('user constants')] |
| // [/protected] |
| |
| public static String [domainSpecificationConstantName(aDomainSpecification)/] = "[aDomainSpecification.namespaceURI/]"; |
| public static String [domainSpecificationNamespaceConstantName(aDomainSpecification)/] = "[aDomainSpecification.namespaceURI/]"; |
| public static String [domainSpecificationNamespacePrefixConstantName(aDomainSpecification)/] = "[aDomainSpecification.namespacePrefix.name/]"; |
| |
| [for (aResource: Resource | relevantResources(anAdaptorInterface)->intersection(aDomainSpecification.resources)->sortedBy(name))] |
| [generateResourceConstants(aResource) /] |
| [/for] |
| } |
| [/file] |
| [/template] |