Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 142AB200C33 for ; Sat, 11 Mar 2017 10:55:47 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 12AD5160B88; Sat, 11 Mar 2017 09:55:47 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 32A6F160B5D for ; Sat, 11 Mar 2017 10:55:46 +0100 (CET) Received: (qmail 54271 invoked by uid 500); 11 Mar 2017 09:55:45 -0000 Mailing-List: contact commits-help@polygene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@polygene.apache.org Delivered-To: mailing list commits@polygene.apache.org Received: (qmail 54260 invoked by uid 99); 11 Mar 2017 09:55:45 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 Mar 2017 09:55:45 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4ED1BDFE8F; Sat, 11 Mar 2017 09:55:45 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: niclas@apache.org To: commits@polygene.apache.org Date: Sat, 11 Mar 2017 09:55:45 -0000 Message-Id: <4cafda87da004ee2bd2b85550f8911d7@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] polygene-java git commit: Fixing the Value, Tranisent and Object templates, so they compile. archived-at: Sat, 11 Mar 2017 09:55:47 -0000 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 Authored: Sat Mar 11 13:41:20 2017 +0800 Committer: niclas 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 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 +")"%><% } %>; <% } %> <% } %>