polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmer...@apache.org
Subject [1/6] polygene-java git commit: Core API: remove InitialValueProvider
Date Mon, 05 Jun 2017 09:54:40 GMT
Repository: polygene-java
Updated Branches:
  refs/heads/develop 6e5d9119c -> 767b36167


Core API: remove InitialValueProvider


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

Branch: refs/heads/develop
Commit: 615189bb40a0300e2e2246cb2b21da9115754820
Parents: 6e5d911
Author: Paul Merlin <paulmerlin@apache.org>
Authored: Mon Jun 5 07:44:50 2017 +0200
Committer: Paul Merlin <paulmerlin@apache.org>
Committed: Mon Jun 5 07:44:50 2017 +0200

----------------------------------------------------------------------
 .../api/property/InitialValueProvider.java      | 27 --------------------
 .../api/property/PropertyDescriptor.java        |  2 --
 .../polygene/bootstrap/MetaInfoDeclaration.java |  8 ------
 .../polygene/bootstrap/MixinDeclaration.java    |  4 ---
 .../runtime/property/PropertyModel.java         | 24 +++++------------
 5 files changed, 7 insertions(+), 58 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/615189bb/core/api/src/main/java/org/apache/polygene/api/property/InitialValueProvider.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/polygene/api/property/InitialValueProvider.java
b/core/api/src/main/java/org/apache/polygene/api/property/InitialValueProvider.java
deleted file mode 100644
index cd32a3a..0000000
--- a/core/api/src/main/java/org/apache/polygene/api/property/InitialValueProvider.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- *  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 org.apache.polygene.api.property;
-
-import java.util.function.BiFunction;
-import org.apache.polygene.api.structure.Module;
-
-public interface InitialValueProvider extends BiFunction<Module, PropertyDescriptor, Object>
-{
-}

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/615189bb/core/api/src/main/java/org/apache/polygene/api/property/PropertyDescriptor.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/polygene/api/property/PropertyDescriptor.java
b/core/api/src/main/java/org/apache/polygene/api/property/PropertyDescriptor.java
index 47a8db1..6c7df05 100644
--- a/core/api/src/main/java/org/apache/polygene/api/property/PropertyDescriptor.java
+++ b/core/api/src/main/java/org/apache/polygene/api/property/PropertyDescriptor.java
@@ -54,8 +54,6 @@ public interface PropertyDescriptor extends MetaInfoHolder
 
     AccessibleObject accessor();
 
-    InitialValueProvider initialValueProvider();
-
     Object resolveInitialValue(ModuleDescriptor moduleDescriptor);
 
     ValueType valueType();

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/615189bb/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/MetaInfoDeclaration.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/MetaInfoDeclaration.java
b/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/MetaInfoDeclaration.java
index 348ac10..2967fe5 100644
--- a/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/MetaInfoDeclaration.java
+++ b/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/MetaInfoDeclaration.java
@@ -29,7 +29,6 @@ import java.lang.reflect.Proxy;
 import java.util.HashMap;
 import java.util.Map;
 import org.apache.polygene.api.common.MetaInfo;
-import org.apache.polygene.api.property.InitialValueProvider;
 import org.apache.polygene.api.property.Property;
 
 /**
@@ -218,12 +217,5 @@ public final class MetaInfoDeclaration
             metaInfo.set( info );
             return this;
         }
-
-        @Override
-        public MixinDeclaration<T> declareInitialValueProvider(InitialValueProvider
provider)
-        {
-            metaInfo.add( InitialValueProvider.class, provider);
-            return this;
-        }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/615189bb/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/MixinDeclaration.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/MixinDeclaration.java
b/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/MixinDeclaration.java
index a50f305..90e22f4 100644
--- a/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/MixinDeclaration.java
+++ b/core/bootstrap/src/main/java/org/apache/polygene/bootstrap/MixinDeclaration.java
@@ -20,8 +20,6 @@
 
 package org.apache.polygene.bootstrap;
 
-import org.apache.polygene.api.property.InitialValueProvider;
-
 /**
  * Fluent API for declaring information about properties
  *
@@ -32,6 +30,4 @@ public interface MixinDeclaration<T>
     T declareDefaults();
 
     MixinDeclaration<T> setMetaInfo( Object info );
-
-    MixinDeclaration<T> declareInitialValueProvider(InitialValueProvider provider);
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/615189bb/core/runtime/src/main/java/org/apache/polygene/runtime/property/PropertyModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/property/PropertyModel.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/property/PropertyModel.java
index 79f7ae9..984d8c4 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/property/PropertyModel.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/property/PropertyModel.java
@@ -27,6 +27,7 @@ import java.lang.reflect.Method;
 import java.lang.reflect.Type;
 import java.lang.reflect.TypeVariable;
 import java.util.List;
+import java.util.function.BiFunction;
 import java.util.stream.Stream;
 import org.apache.polygene.api.common.MetaInfo;
 import org.apache.polygene.api.common.QualifiedName;
@@ -35,7 +36,6 @@ import org.apache.polygene.api.constraint.ConstraintViolationException;
 import org.apache.polygene.api.entity.Queryable;
 import org.apache.polygene.api.property.DefaultValues;
 import org.apache.polygene.api.property.GenericPropertyInfo;
-import org.apache.polygene.api.property.InitialValueProvider;
 import org.apache.polygene.api.property.InvalidPropertyTypeException;
 import org.apache.polygene.api.property.Property;
 import org.apache.polygene.api.property.PropertyDescriptor;
@@ -87,8 +87,7 @@ public class PropertyModel
                           boolean useDefaults,
                           ValueConstraintsInstance constraints,
                           MetaInfo metaInfo,
-                          Object initialValue,
-                          InitialValueProvider initialValueProvider
+                          Object initialValue
                         )
     {
         if( accessor instanceof Method )
@@ -105,14 +104,7 @@ public class PropertyModel
         type = GenericPropertyInfo.propertyTypeOf( accessor );
         checkTypeValidity( type );
         qualifiedName = QualifiedName.fromAccessor( accessor );
-        if( initialValueProvider != null )
-        {
-            this.initialValueProvider = initialValueProvider;
-        }
-        else
-        {
-            this.initialValueProvider = new DefaultInitialValueProvider( useDefaults, initialValue
);
-        }
+        initialValueProvider = new DefaultInitialValueProvider( useDefaults, initialValue
);
         this.constraints = constraints;
         final Queryable queryable = accessor.getAnnotation( Queryable.class );
         this.queryable = queryable == null || queryable.value();
@@ -195,12 +187,6 @@ public class PropertyModel
     }
 
     @Override
-    public InitialValueProvider initialValueProvider()
-    {
-        return initialValueProvider;
-    }
-
-    @Override
     public Object resolveInitialValue( ModuleDescriptor moduleDescriptor )
     {
         return initialValueProvider.apply( moduleDescriptor.instance(), this );
@@ -310,6 +296,10 @@ public class PropertyModel
         }
     }
 
+    private interface InitialValueProvider extends BiFunction<Module, PropertyDescriptor,
Object>
+    {
+    }
+
     private class DefaultInitialValueProvider
         implements InitialValueProvider
     {


Mime
View raw message