polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [1/2] polygene-java git commit: Fixing the Value, Tranisent and Object templates, so they compile.
Date Sat, 11 Mar 2017 09:55:45 GMT
Repository: polygene-java
Updated Branches:
  refs/heads/develop a7bdc4086 -> 0c7ee1909


Fixing the Value, Tranisent and Object templates, so they compile.


Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/284fb8ee
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/284fb8ee
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/284fb8ee

Branch: refs/heads/develop
Commit: 284fb8eef861f28189397e101a016ee400d8fa16
Parents: a7bdc40
Author: niclas <niclas@spicter.com>
Authored: Sat Mar 11 13:41:20 2017 +0800
Committer: niclas <niclas@spicter.com>
Committed: Sat Mar 11 13:41:20 2017 +0800

----------------------------------------------------------------------
 .../DomainLayer/DomainModule/Object.tmpl        |  4 +-
 .../DomainLayer/DomainModule/Transient.tmpl     | 47 ++++++++++++++++++++
 .../DomainLayer/DomainModule/Value.tmpl         |  2 +-
 .../DomainLayer/DomainModule/bootstrap.tmpl     |  2 +-
 4 files changed, 52 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/284fb8ee/tools/generator-polygene/app/templates/DomainLayer/DomainModule/Object.tmpl
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/DomainLayer/DomainModule/Object.tmpl b/tools/generator-polygene/app/templates/DomainLayer/DomainModule/Object.tmpl
index 27d6119..9ff4e00 100644
--- a/tools/generator-polygene/app/templates/DomainLayer/DomainModule/Object.tmpl
+++ b/tools/generator-polygene/app/templates/DomainLayer/DomainModule/Object.tmpl
@@ -19,8 +19,10 @@
 -%>
 package <%= packageName %>.model.<%= polygene.current.name %>;
 
-import org.apache.polygene.api.injection.scope.This
+import org.apache.polygene.api.injection.scope.Structure;
+import org.apache.polygene.api.injection.scope.Uses;
 import org.apache.polygene.api.mixin.Mixins;
+import org.apache.polygene.api.value.ValueBuilderFactory;
 
 public class <%= polygene.current.clazz.name %>
 {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/284fb8ee/tools/generator-polygene/app/templates/DomainLayer/DomainModule/Transient.tmpl
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/DomainLayer/DomainModule/Transient.tmpl
b/tools/generator-polygene/app/templates/DomainLayer/DomainModule/Transient.tmpl
new file mode 100644
index 0000000..29f32e2
--- /dev/null
+++ b/tools/generator-polygene/app/templates/DomainLayer/DomainModule/Transient.tmpl
@@ -0,0 +1,47 @@
+<%#
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.
+ *
+ *
+-%>
+package <%= packageName %>.model.<%= polygene.current.name %>;
+
+import org.apache.polygene.api.injection.scope.Uses;
+import org.apache.polygene.api.mixin.Mixins;
+import org.apache.polygene.api.property.Property;
+
+@Mixins( { <%= polygene.current.clazz.name %>.Mixin.class } )
+public interface <%= polygene.current.clazz.name %>
+{
+    Property<String> name();     // Sample hidden property
+
+    // If Property declarations are public, the Mixin must be abstract, because PropertyMixin
will implement those methods.
+    abstract class Mixin
+        implements <%= polygene.current.clazz.name %>
+    {
+        // Transients supports @Uses injection
+        //
+        //  Socket socket = serverSockete.accept();
+        //  TransientBuilder<<%= polygene.current.clazz.name %>> builder = transientBuilderFactory.newTransientBuilder(<%=
polygene.current.clazz.name %>.class);
+        //  builder.use( socket );
+        //  builder.prototype().name().set( name + counter++ );
+        //  <%= polygene.current.clazz.name %> <%= polygene.current.clazz.name.toLowerCase()
%> = builder.newInstance();
+
+//        @Uses
+//        private Socket items;
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/284fb8ee/tools/generator-polygene/app/templates/DomainLayer/DomainModule/Value.tmpl
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/DomainLayer/DomainModule/Value.tmpl b/tools/generator-polygene/app/templates/DomainLayer/DomainModule/Value.tmpl
index 60e117d..95eed76 100644
--- a/tools/generator-polygene/app/templates/DomainLayer/DomainModule/Value.tmpl
+++ b/tools/generator-polygene/app/templates/DomainLayer/DomainModule/Value.tmpl
@@ -19,7 +19,7 @@
 -%>
 package <%= packageName %>.model.<%= polygene.current.name %>;
 
-import org.apache.polygene.api.injection.scope.This
+import org.apache.polygene.api.injection.scope.This;
 import org.apache.polygene.api.mixin.Mixins;
 import org.apache.polygene.api.property.Property;
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/284fb8ee/tools/generator-polygene/app/templates/DomainLayer/DomainModule/bootstrap.tmpl
----------------------------------------------------------------------
diff --git a/tools/generator-polygene/app/templates/DomainLayer/DomainModule/bootstrap.tmpl
b/tools/generator-polygene/app/templates/DomainLayer/DomainModule/bootstrap.tmpl
index cbab067..3ee206c 100644
--- a/tools/generator-polygene/app/templates/DomainLayer/DomainModule/bootstrap.tmpl
+++ b/tools/generator-polygene/app/templates/DomainLayer/DomainModule/bootstrap.tmpl
@@ -54,7 +54,7 @@ public class <%- firstUpper(polygene.current.name) %>Module
 <% } %>
 <% if( polygene.current.values ) { %>
   <% for( var value in polygene.current.values ) { %>
-    <% var v = polygene.current.current[value]; %>
+    <% var v = polygene.current.values[value]; %>
         module.values(<%= v.name + ".class" %>)<% if( v.visibility ) {%><%-".visibleIn("
+ v.visibility +")"%><% } %>;
   <% } %>
 <% } %>


Mime
View raw message