[savara-commits] savara SVN: r492 - in trunk/bundles: org.scribble.expression.xpath and 24 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Sat Nov 20 18:06:35 EST 2010


Author: objectiser
Date: 2010-11-20 18:06:35 -0500 (Sat, 20 Nov 2010)
New Revision: 492

Added:
   trunk/bundles/org.scribble.expression.xpath/
   trunk/bundles/org.scribble.expression.xpath/.classpath
   trunk/bundles/org.scribble.expression.xpath/.project
   trunk/bundles/org.scribble.expression.xpath/LICENSE.txt
   trunk/bundles/org.scribble.expression.xpath/META-INF/
   trunk/bundles/org.scribble.expression.xpath/META-INF/MANIFEST.MF
   trunk/bundles/org.scribble.expression.xpath/build.properties
   trunk/bundles/org.scribble.expression.xpath/pom.xml
   trunk/bundles/org.scribble.expression.xpath/src/
   trunk/bundles/org.scribble.expression.xpath/src/main/
   trunk/bundles/org.scribble.expression.xpath/src/main/java/
   trunk/bundles/org.scribble.expression.xpath/src/main/java/org/
   trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/
   trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/expression/
   trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/expression/xpath/
   trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/expression/xpath/export/
   trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/expression/xpath/export/text/
   trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/expression/xpath/export/text/XPathExpressionTextExportRule.java
   trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/expression/xpath/model/
   trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/expression/xpath/model/XPathExpression.java
   trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/expression/xpath/model/types/
   trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/expression/xpath/model/types/XPathExpressionTypeResolverRule.java
   trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/expression/xpath/osgi/
   trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/expression/xpath/osgi/Activator.java
   trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/expression/xpath/validation/
   trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/expression/xpath/validation/XPathExpressionValidationRule.java
   trunk/bundles/org.scribble.lang.model/
   trunk/bundles/org.scribble.lang.model/.classpath
   trunk/bundles/org.scribble.lang.model/.project
   trunk/bundles/org.scribble.lang.model/LICENSE.txt
   trunk/bundles/org.scribble.lang.model/META-INF/
   trunk/bundles/org.scribble.lang.model/META-INF/MANIFEST.MF
   trunk/bundles/org.scribble.lang.model/build.properties
   trunk/bundles/org.scribble.lang.model/pom.xml
   trunk/bundles/org.scribble.lang.model/src/
   trunk/bundles/org.scribble.lang.model/src/main/
   trunk/bundles/org.scribble.lang.model/src/main/java/
   trunk/bundles/org.scribble.lang.model/src/main/java/org/
   trunk/bundles/org.scribble.lang.model/src/main/java/org/scribble/
   trunk/bundles/org.scribble.lang.model/src/main/java/org/scribble/lang/
   trunk/bundles/org.scribble.lang.model/src/main/java/org/scribble/lang/model/
   trunk/bundles/org.scribble.lang.model/src/main/java/org/scribble/lang/model/JavaLanguageModel.java
   trunk/bundles/org.scribble.lang.model/src/main/java/org/scribble/lang/model/LanguageModel.java
   trunk/bundles/org.scribble.lang.model/src/main/java/org/scribble/lang/model/osgi/
   trunk/bundles/org.scribble.lang.model/src/main/java/org/scribble/lang/model/osgi/Activator.java
Log:
New trunk with updated build scripts to create OSGi bundles using standard maven, and only the Eclipse plugins and update site using Tycho, to enable the bundles to be uploaded to Nexus and used in other contexts.

Added: trunk/bundles/org.scribble.expression.xpath/.classpath
===================================================================
--- trunk/bundles/org.scribble.expression.xpath/.classpath	                        (rev 0)
+++ trunk/bundles/org.scribble.expression.xpath/.classpath	2010-11-20 23:06:35 UTC (rev 492)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src/main/java"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="output" path="classes"/>
+</classpath>

Added: trunk/bundles/org.scribble.expression.xpath/.project
===================================================================
--- trunk/bundles/org.scribble.expression.xpath/.project	                        (rev 0)
+++ trunk/bundles/org.scribble.expression.xpath/.project	2010-11-20 23:06:35 UTC (rev 492)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.scribble.expression.xpath</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: trunk/bundles/org.scribble.expression.xpath/LICENSE.txt
===================================================================
--- trunk/bundles/org.scribble.expression.xpath/LICENSE.txt	                        (rev 0)
+++ trunk/bundles/org.scribble.expression.xpath/LICENSE.txt	2010-11-20 23:06:35 UTC (rev 492)
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

Added: trunk/bundles/org.scribble.expression.xpath/META-INF/MANIFEST.MF
===================================================================
--- trunk/bundles/org.scribble.expression.xpath/META-INF/MANIFEST.MF	                        (rev 0)
+++ trunk/bundles/org.scribble.expression.xpath/META-INF/MANIFEST.MF	2010-11-20 23:06:35 UTC (rev 492)
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Scribble Expression Xpath Plug-in
+Bundle-SymbolicName: org.scribble.expression.xpath;singleton:=true
+Bundle-Version: 1.2.0.qualifier
+Bundle-Activator: org.scribble.expression.xpath.osgi.Activator
+Import-Package: org.osgi.framework;version="1.3.0"
+Require-Bundle: org.scribble.core;bundle-version="[1.0.0,2.0.0)",
+ org.scribble.conversation.model;bundle-version="[1.0.0,2.0.0)"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-Vendor: www.scribble.org
+Scribble-Extensions: org.scribble.expression.xpath.validation.XPathExpressionValidationRule,
+  org.scribble.expression.xpath.export.text.XPathExpressionTextExportRule,
+  org.scribble.expression.xpath.model.types.XPathExpressionTypeResolverRule
+Export-Package: org.scribble.expression.xpath.model

Added: trunk/bundles/org.scribble.expression.xpath/build.properties
===================================================================
--- trunk/bundles/org.scribble.expression.xpath/build.properties	                        (rev 0)
+++ trunk/bundles/org.scribble.expression.xpath/build.properties	2010-11-20 23:06:35 UTC (rev 492)
@@ -0,0 +1,5 @@
+source.. = src/main/java/
+output.. = classes/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml

Added: trunk/bundles/org.scribble.expression.xpath/pom.xml
===================================================================
--- trunk/bundles/org.scribble.expression.xpath/pom.xml	                        (rev 0)
+++ trunk/bundles/org.scribble.expression.xpath/pom.xml	2010-11-20 23:06:35 UTC (rev 492)
@@ -0,0 +1,33 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.savara.bundles</groupId>
+	<artifactId>org.scribble.expression.xpath</artifactId> 
+	<version>1.2.0-SNAPSHOT</version>
+	<packaging>jar</packaging>
+	<name>Savara::Bundles::ScribbleExpressionXPath</name>
+
+	<parent>
+		<groupId>org.savara</groupId>
+		<artifactId>bundles</artifactId>
+		<version>1.2.0-SNAPSHOT</version>
+	</parent>
+  
+	<dependencies>
+		<dependency>
+			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.scribble.core</artifactId>
+			<version>1.2.0-SNAPSHOT</version>
+		</dependency>
+		<dependency>
+			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.scribble.conversation.model</artifactId>
+			<version>1.2.0-SNAPSHOT</version>
+		</dependency>
+	    <dependency>
+	      <groupId>org.apache.felix</groupId>
+	      <artifactId>org.osgi.core</artifactId>
+	      <version>${osgi.version}</version>
+	    </dependency>
+	</dependencies>
+</project>

Added: trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/expression/xpath/export/text/XPathExpressionTextExportRule.java
===================================================================
--- trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/expression/xpath/export/text/XPathExpressionTextExportRule.java	                        (rev 0)
+++ trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/expression/xpath/export/text/XPathExpressionTextExportRule.java	2010-11-20 23:06:35 UTC (rev 492)
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2007-9 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 8 Feb 2009 : Initial version created by gary
+ */
+package org.scribble.expression.xpath.export.text;
+
+import org.scribble.export.*;
+import org.scribble.export.text.*;
+import org.scribble.extensions.RegistryInfo;
+import org.scribble.model.*;
+import org.scribble.expression.xpath.model.*;
+
+/**
+ * This class implements the text based export rule for the
+ * XPathExpression entity.
+ */
+ at RegistryInfo(extension=ExportRule.class)
+public class XPathExpressionTextExportRule implements ExportRule {
+
+	/**
+	 * This method determines whether the exporter rule is appropriate
+	 * for the supplied model object and format.
+	 * 
+	 * @param modelObject The model object
+	 * @param format The format
+	 * @return Whether the rule is appropriate for the model object and
+	 * 						format
+	 */
+	public boolean isSupported(ModelObject modelObject, Formatter format) {
+		return(XPathExpression.class.isAssignableFrom(modelObject.getClass()) &&
+				format instanceof TextFormatter);
+	}
+
+	/**
+	 * This method exports the model object.
+	 * 
+	 * @param modelObject The model object
+	 * @param context The context
+	 * @throws IOException Failed to record export information
+	 */
+	public void export(ModelObject modelObject, ExporterContext context)
+							throws java.io.IOException {
+		XPathExpression expr=(XPathExpression)modelObject;
+		TextFormatter formatter=(TextFormatter)context.getFormatter();
+		
+		formatter.record("xpath[");	
+		
+		if (expr.getQuery() != null) {
+			formatter.record(expr.getQuery());
+		}
+		
+		formatter.record("]");
+	}
+}

Added: trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/expression/xpath/model/XPathExpression.java
===================================================================
--- trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/expression/xpath/model/XPathExpression.java	                        (rev 0)
+++ trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/expression/xpath/model/XPathExpression.java	2010-11-20 23:06:35 UTC (rev 492)
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2005-9 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 25 Jan 2009 : Initial version created by gary
+ */
+package org.scribble.expression.xpath.model;
+
+/**
+ * This class represents an xpath expression.
+ */
+public class XPathExpression extends org.scribble.conversation.model.Expression {
+
+	private static final long serialVersionUID = 6297823747605191013L;
+
+	/**
+	 * This method sets the query string associated with the
+	 * expression.
+	 * 
+	 * @param query The query
+	 */
+	public void setQuery(String query) {
+		m_query = query;
+	}
+	
+	/**
+	 * This method returns the query string associated with
+	 * the xpath expression.
+	 * 
+	 * @return The query
+	 */
+	public String getQuery() {
+		return(m_query);
+	}
+	
+	private String m_query=null;
+}

Added: trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/expression/xpath/model/types/XPathExpressionTypeResolverRule.java
===================================================================
--- trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/expression/xpath/model/types/XPathExpressionTypeResolverRule.java	                        (rev 0)
+++ trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/expression/xpath/model/types/XPathExpressionTypeResolverRule.java	2010-11-20 23:06:35 UTC (rev 492)
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2005-9 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 25 Jan 2009 : Initial version created by gary
+ */
+package org.scribble.expression.xpath.model.types;
+
+import org.scribble.model.ModelObject;
+import org.scribble.model.TypeReference;
+import org.scribble.model.types.*;
+import org.scribble.expression.xpath.model.*;
+import org.scribble.extensions.RegistryInfo;
+
+/**
+ * This class implements the type resolver rule for the
+ * XPathExpression model object.
+ */
+ at RegistryInfo(extension=TypeResolverRule.class)
+public class XPathExpressionTypeResolverRule implements TypeResolverRule {
+
+	/**
+	 * This method determines if the type resolver rule
+	 * is appropriate for the supplied model object.
+	 * 
+	 * @param modelObject The model object
+	 * @return Whether the rule is appropriate
+	 */
+	public boolean isSupported(ModelObject modelObject) {
+		return(modelObject instanceof XPathExpression);
+	}
+	
+	/**
+	 * This method returns the type reference associated
+	 * with the supplied model object.
+	 * 
+	 * @param modelObject The model object
+	 * @return The type reference associated with the
+	 * 			model object, or null if unknown
+	 */
+	public TypeReference resolve(ModelObject modelObject) {
+		TypeReference ret=null;
+		XPathExpression expr=(XPathExpression)modelObject;
+		
+		// TODO: Identify the resulting type from the expression
+		
+		return(ret);
+	}
+}

Added: trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/expression/xpath/osgi/Activator.java
===================================================================
--- trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/expression/xpath/osgi/Activator.java	                        (rev 0)
+++ trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/expression/xpath/osgi/Activator.java	2010-11-20 23:06:35 UTC (rev 492)
@@ -0,0 +1,48 @@
+package org.scribble.expression.xpath.osgi;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator implements BundleActivator {
+
+	// The plug-in ID
+	public static final String PLUGIN_ID = "org.scribble.expression.xpath";
+
+	// The shared instance
+	private static Activator plugin;
+	
+	/**
+	 * The constructor
+	 */
+	public Activator() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		plugin = this;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+	}
+
+	/**
+	 * Returns the shared instance
+	 *
+	 * @return the shared instance
+	 */
+	public static Activator getDefault() {
+		return plugin;
+	}
+
+}

Added: trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/expression/xpath/validation/XPathExpressionValidationRule.java
===================================================================
--- trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/expression/xpath/validation/XPathExpressionValidationRule.java	                        (rev 0)
+++ trunk/bundles/org.scribble.expression.xpath/src/main/java/org/scribble/expression/xpath/validation/XPathExpressionValidationRule.java	2010-11-20 23:06:35 UTC (rev 492)
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2007-9 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 25 Jan 2009 : Initial version created by gary
+ */
+package org.scribble.expression.xpath.validation;
+
+import org.scribble.extensions.*;
+import org.scribble.model.*;
+import org.scribble.expression.xpath.model.*;
+import org.scribble.validation.*;
+import org.scribble.model.admin.ModelListener;
+
+/**
+ * This class implements the validation rule for the
+ * XPathExpression construct.
+ */
+ at RegistryInfo(extension=ValidationRule.class)
+public class XPathExpressionValidationRule extends AbstractValidationRule {
+
+	/**
+	 * This is the default constructor.
+	 */
+	public XPathExpressionValidationRule() {
+	}
+
+	/**
+	 * This method determines whether the rule is appropriate for
+	 * the supplied model object.
+	 * 
+	 * @param obj The model object
+	 * @return Whether the rule is appropriate
+	 */
+	public boolean isSupported(ModelObject obj) {
+		return(obj instanceof XPathExpression);
+	}
+
+	/**
+	 * This method validates the supplied model object.
+	 * 
+	 * @param obj The model object
+	 * @param context The context
+	 * @param l The listener
+	 */
+	public void validate(ModelObject obj, ValidationContext context,
+			ModelListener l) {
+		XPathExpression elem=(XPathExpression)obj;
+
+		// TODO: Use an appropriate xpath parser to validate the
+		// expression and that the referenced variables exist
+	}
+}

Added: trunk/bundles/org.scribble.lang.model/.classpath
===================================================================
--- trunk/bundles/org.scribble.lang.model/.classpath	                        (rev 0)
+++ trunk/bundles/org.scribble.lang.model/.classpath	2010-11-20 23:06:35 UTC (rev 492)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src/main/java"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="output" path="classes"/>
+</classpath>

Added: trunk/bundles/org.scribble.lang.model/.project
===================================================================
--- trunk/bundles/org.scribble.lang.model/.project	                        (rev 0)
+++ trunk/bundles/org.scribble.lang.model/.project	2010-11-20 23:06:35 UTC (rev 492)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.scribble.lang.model</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: trunk/bundles/org.scribble.lang.model/LICENSE.txt
===================================================================
--- trunk/bundles/org.scribble.lang.model/LICENSE.txt	                        (rev 0)
+++ trunk/bundles/org.scribble.lang.model/LICENSE.txt	2010-11-20 23:06:35 UTC (rev 492)
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

Added: trunk/bundles/org.scribble.lang.model/META-INF/MANIFEST.MF
===================================================================
--- trunk/bundles/org.scribble.lang.model/META-INF/MANIFEST.MF	                        (rev 0)
+++ trunk/bundles/org.scribble.lang.model/META-INF/MANIFEST.MF	2010-11-20 23:06:35 UTC (rev 492)
@@ -0,0 +1,14 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Scribble Language Model Plug-in
+Bundle-SymbolicName: org.scribble.lang.model;singleton:=true
+Bundle-Version: 1.2.0.qualifier
+Bundle-Activator: org.scribble.lang.model.osgi.Activator
+Bundle-Vendor: www.scribble.org
+Import-Package: org.osgi.framework;version="1.3.0"
+Require-Bundle: org.scribble.core;bundle-version="[1.0.0,2.0.0)",
+ org.scribble.conversation.model;bundle-version="[1.0.0,2.0.0)"
+Eclipse-LazyStart: true
+Export-Package: org.scribble.lang.model
+Scribble-Extensions: org.scribble.lang.model.JavaLanguageModel
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6

Added: trunk/bundles/org.scribble.lang.model/build.properties
===================================================================
--- trunk/bundles/org.scribble.lang.model/build.properties	                        (rev 0)
+++ trunk/bundles/org.scribble.lang.model/build.properties	2010-11-20 23:06:35 UTC (rev 492)
@@ -0,0 +1,5 @@
+source.. = src/main/java/
+output.. = classes/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml

Added: trunk/bundles/org.scribble.lang.model/pom.xml
===================================================================
--- trunk/bundles/org.scribble.lang.model/pom.xml	                        (rev 0)
+++ trunk/bundles/org.scribble.lang.model/pom.xml	2010-11-20 23:06:35 UTC (rev 492)
@@ -0,0 +1,33 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.savara.bundles</groupId>
+	<artifactId>org.scribble.lang.model</artifactId> 
+	<version>1.2.0-SNAPSHOT</version>
+	<packaging>jar</packaging>
+	<name>Savara::Bundles::ScribbleLangModel</name>
+
+	<parent>
+		<groupId>org.savara</groupId>
+		<artifactId>bundles</artifactId>
+		<version>1.2.0-SNAPSHOT</version>
+	</parent>
+  
+	<dependencies>
+		<dependency>
+			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.scribble.core</artifactId>
+			<version>1.2.0-SNAPSHOT</version>
+		</dependency>
+		<dependency>
+			<groupId>org.savara.bundles</groupId>
+			<artifactId>org.scribble.conversation.model</artifactId>
+			<version>1.2.0-SNAPSHOT</version>
+		</dependency>
+	    <dependency>
+	      <groupId>org.apache.felix</groupId>
+	      <artifactId>org.osgi.core</artifactId>
+	      <version>${osgi.version}</version>
+	    </dependency>
+	</dependencies>
+</project>

Added: trunk/bundles/org.scribble.lang.model/src/main/java/org/scribble/lang/model/JavaLanguageModel.java
===================================================================
--- trunk/bundles/org.scribble.lang.model/src/main/java/org/scribble/lang/model/JavaLanguageModel.java	                        (rev 0)
+++ trunk/bundles/org.scribble.lang.model/src/main/java/org/scribble/lang/model/JavaLanguageModel.java	2010-11-20 23:06:35 UTC (rev 492)
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2007-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 12 Jan 2008 : Initial version created by gary
+ */
+package org.scribble.lang.model;
+
+import org.scribble.model.*;
+import org.scribble.extensions.*;
+
+/**
+ * This class represents the Java language model.
+ * 
+ */
+ at RegistryInfo(extension=Model.class,notation=JavaLanguageModel.JAVA_LANGUAGE)
+public class JavaLanguageModel extends LanguageModel {
+
+	/**
+	 * This method returns the notation associated with
+	 * the model.
+	 * 
+	 * @return The notation
+	 */
+	public String getNotation() {
+		return(JAVA_LANGUAGE);
+	}
+	
+	public static final String JAVA_LANGUAGE="java";
+}

Added: trunk/bundles/org.scribble.lang.model/src/main/java/org/scribble/lang/model/LanguageModel.java
===================================================================
--- trunk/bundles/org.scribble.lang.model/src/main/java/org/scribble/lang/model/LanguageModel.java	                        (rev 0)
+++ trunk/bundles/org.scribble.lang.model/src/main/java/org/scribble/lang/model/LanguageModel.java	2010-11-20 23:06:35 UTC (rev 492)
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2007-8 Pi4 Technologies Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ * Change History:
+ * 12 Jan 2008 : Initial version created by gary
+ */
+package org.scribble.lang.model;
+
+import org.scribble.model.*;
+import org.scribble.conversation.model.*;
+
+/**
+ * This class represents the language model.
+ * 
+ */
+public abstract class LanguageModel extends Model {
+
+	/**
+	 * This method returns the model name associated with
+	 * the model.
+	 * 
+	 * @return The model name
+	 */
+	public LocatedName getModelName() {
+		return(m_modelName);
+	}
+	
+	/**
+	 * This method sets the model name.
+	 * 
+	 * @param modelName The model name
+	 */
+	public void setModelName(LocatedName modelName) {
+		m_modelName = modelName;
+	}
+	
+	/**
+	 * This method returns a read-only list of roles
+	 * associated with the model. If this model represents
+	 * a local model, then the roles in the list
+	 * will be the remote roles, with the local
+	 * role being associated with the model name.
+	 * 
+	 * @return The read-only list of roles
+	 */
+	public java.util.List<Role> getRoles() {
+		java.util.List<Role> ret=null;
+		final java.util.List<Role> roles=
+			new java.util.Vector<Role>();
+		
+		if (m_conversations != null) {
+			// Identify all of the roles defined in the
+			// top level conversations
+			for (int i=0; i < m_conversations.size(); i++) {
+				m_conversations.get(i).visit(new Visitor() {
+					
+					public boolean visit(ModelObject obj) {
+						boolean ret=true;
+						
+						if (obj instanceof Conversation &&
+								m_conversations.contains(obj)) {
+							ret = false;
+							
+						} else if (obj instanceof RoleList) {
+							RoleList plist=(RoleList)obj;
+							
+							roles.addAll(plist.getRoles());
+						}
+						
+						return(ret);
+					}
+				});
+			}
+		}
+		
+		ret = new java.util.Vector<Role>(roles) {
+			public boolean add(Role obj) {
+				throw new java.lang.RuntimeException("Read only list");
+			}
+		};
+		
+		return(ret);
+	}
+
+	/**
+	 * This method returns the protocol.
+	 * 
+	 * @return The protocol
+	 */
+	@Reference(containment=true)
+	public java.util.List<Conversation> getConversations() {
+		return(m_conversations);
+	}
+	
+	/**
+	 * This method returns the list of definitions supported by
+	 * this model.
+	 * 
+	 * @return The list of definitions
+	 */
+	public java.util.List<Definition> getDefinitions() {
+		java.util.List<Definition> ret=new java.util.Vector<Definition>();
+		
+		ret.addAll(getConversations());
+		
+		return(ret);
+	}
+	
+	private LocatedName m_modelName=null;
+	private java.util.List<Conversation> m_conversations=
+				new ContainmentList<Conversation>(this, Conversation.class);
+}

Added: trunk/bundles/org.scribble.lang.model/src/main/java/org/scribble/lang/model/osgi/Activator.java
===================================================================
--- trunk/bundles/org.scribble.lang.model/src/main/java/org/scribble/lang/model/osgi/Activator.java	                        (rev 0)
+++ trunk/bundles/org.scribble.lang.model/src/main/java/org/scribble/lang/model/osgi/Activator.java	2010-11-20 23:06:35 UTC (rev 492)
@@ -0,0 +1,48 @@
+package org.scribble.lang.model.osgi;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator implements BundleActivator {
+
+	// The plug-in ID
+	public static final String PLUGIN_ID = "org.scribble.experimental.lang.model";
+
+	// The shared instance
+	private static Activator plugin;
+	
+	/**
+	 * The constructor
+	 */
+	public Activator() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		plugin = this;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+	}
+
+	/**
+	 * Returns the shared instance
+	 *
+	 * @return the shared instance
+	 */
+	public static Activator getDefault() {
+		return plugin;
+	}
+
+}



More information about the savara-commits mailing list