polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From soelvs...@apache.org
Subject [2/2] polygene-java git commit: consolidated common code for "lists" of compositemodels
Date Sun, 21 Jan 2018 21:01:12 GMT
consolidated common code for "lists" of compositemodels


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

Branch: refs/heads/develop
Commit: e1cc8a6e0902b19792717b71e9366be37cbda97f
Parents: 468bd3d
Author: soelvsten <kent.soelvsten@gmail.com>
Authored: Sun Jan 21 22:00:47 2018 +0100
Committer: soelvsten <kent.soelvsten@gmail.com>
Committed: Sun Jan 21 22:00:47 2018 +0100

----------------------------------------------------------------------
 .../runtime/composite/CompositesModel.java      | 61 ++++++++++++++++++++
 .../runtime/composite/TransientsModel.java      | 38 +-----------
 .../polygene/runtime/entity/EntitiesModel.java  | 40 ++-----------
 .../polygene/runtime/object/ObjectsModel.java   | 34 ++---------
 .../service/ImportedServicesInstance.java       |  4 +-
 .../runtime/service/ImportedServicesModel.java  | 49 ++++------------
 .../runtime/service/ServicesInstance.java       |  4 +-
 .../polygene/runtime/service/ServicesModel.java | 60 ++++---------------
 .../polygene/runtime/structure/ModuleModel.java | 18 +++---
 .../polygene/runtime/value/ValuesModel.java     | 40 ++-----------
 .../polygene/library/rdf/model/Model2XML.java   |  2 +-
 .../ImportedServiceCompositeDescriptor.java     |  7 +++
 12 files changed, 120 insertions(+), 237 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e1cc8a6e/core/runtime/src/main/java/org/apache/polygene/runtime/composite/CompositesModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/composite/CompositesModel.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/composite/CompositesModel.java
new file mode 100644
index 0000000..a0c4e65
--- /dev/null
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/composite/CompositesModel.java
@@ -0,0 +1,61 @@
+/*
+ *  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.runtime.composite;
+
+import org.apache.polygene.api.util.HierarchicalVisitor;
+import org.apache.polygene.api.util.VisitableHierarchy;
+import org.apache.polygene.api.util.VisitableModelDescriptor;
+
+import java.util.List;
+import java.util.stream.Stream;
+
+public abstract class CompositesModel<MD extends VisitableModelDescriptor>
+        implements VisitableHierarchy<Object, Object>
+{
+    private final List<MD> compositeModels;
+
+    public CompositesModel( List<MD> compositeModels)
+    {
+        this.compositeModels = compositeModels;
+    }
+
+    @Override
+    public final <ThrowableType extends Throwable> boolean accept( HierarchicalVisitor<?
super Object, ? super Object, ThrowableType> modelVisitor )
+            throws ThrowableType
+    {
+        if( modelVisitor.visitEnter( this ) )
+        {
+            for( MD compositeModel : compositeModels)
+            {
+                if( !compositeModel.accept( modelVisitor ) )
+                {
+                    break;
+                }
+            }
+        }
+        return modelVisitor.visitLeave( this );
+    }
+
+    public final Stream<MD> stream()
+    {
+        return compositeModels.stream();
+    }
+}

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e1cc8a6e/core/runtime/src/main/java/org/apache/polygene/runtime/composite/TransientsModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/composite/TransientsModel.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/composite/TransientsModel.java
index a18ef09..9b92de4 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/composite/TransientsModel.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/composite/TransientsModel.java
@@ -21,48 +21,14 @@
 package org.apache.polygene.runtime.composite;
 
 import java.util.List;
-import java.util.stream.Stream;
-import org.apache.polygene.api.composite.TransientDescriptor;
-import org.apache.polygene.api.util.HierarchicalVisitor;
-import org.apache.polygene.api.util.VisitableHierarchy;
 
 /**
  * JAVADOC
  */
-public class TransientsModel
-    implements VisitableHierarchy<Object, Object>
+public class TransientsModel extends CompositesModel<TransientModel>
 {
-    private final List<TransientModel> transientModels;
-
     public TransientsModel( List<TransientModel> transientModels )
     {
-        this.transientModels = transientModels;
-    }
-
-    public Stream<TransientModel> models()
-    {
-        return transientModels.stream();
-    }
-
-    @Override
-    public <ThrowableType extends Throwable> boolean accept( HierarchicalVisitor<?
super Object, ? super Object, ThrowableType> modelVisitor )
-        throws ThrowableType
-    {
-        if( modelVisitor.visitEnter( this ) )
-        {
-            for( TransientModel transientModel : transientModels )
-            {
-                if( !transientModel.accept( modelVisitor ) )
-                {
-                    break;
-                }
-            }
-        }
-        return modelVisitor.visitLeave( this );
-    }
-
-    public Stream<? extends TransientDescriptor> stream()
-    {
-        return transientModels.stream();
+        super(transientModels);
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e1cc8a6e/core/runtime/src/main/java/org/apache/polygene/runtime/entity/EntitiesModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/entity/EntitiesModel.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/entity/EntitiesModel.java
index ebb3d78..6f4a482 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/entity/EntitiesModel.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/entity/EntitiesModel.java
@@ -20,49 +20,19 @@
 
 package org.apache.polygene.runtime.entity;
 
-import java.util.List;
-import java.util.stream.Stream;
-import org.apache.polygene.api.entity.EntityDescriptor;
-import org.apache.polygene.api.util.HierarchicalVisitor;
 import org.apache.polygene.api.util.VisitableHierarchy;
+import org.apache.polygene.runtime.composite.CompositesModel;
+
+import java.util.List;
 
 /**
  * Model of entities in a particular Module.
  */
-public class EntitiesModel
+public class EntitiesModel extends CompositesModel<EntityModel>
     implements VisitableHierarchy<Object, Object>
 {
-    private final List<EntityModel> entityModels;
-
     public EntitiesModel( List<EntityModel> entityModels )
     {
-        this.entityModels = entityModels;
-    }
-
-    public Stream<EntityModel> models()
-    {
-        return entityModels.stream();
-    }
-
-    @Override
-    public <ThrowableType extends Throwable> boolean accept( HierarchicalVisitor<?
super Object, ? super Object, ThrowableType> modelVisitor )
-        throws ThrowableType
-    {
-        if( modelVisitor.visitEnter( this ) )
-        {
-            for( EntityModel entityModel : entityModels )
-            {
-                if( !entityModel.accept( modelVisitor ) )
-                {
-                    break;
-                }
-            }
-        }
-        return modelVisitor.visitLeave( this );
-    }
-
-    public Stream<? extends EntityDescriptor> stream()
-    {
-        return entityModels.stream();
+        super(entityModels);
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e1cc8a6e/core/runtime/src/main/java/org/apache/polygene/runtime/object/ObjectsModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/object/ObjectsModel.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/object/ObjectsModel.java
index 84d2c11..04b7d0a 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/object/ObjectsModel.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/object/ObjectsModel.java
@@ -20,43 +20,19 @@
 
 package org.apache.polygene.runtime.object;
 
-import java.util.List;
-import java.util.stream.Stream;
-import org.apache.polygene.api.util.HierarchicalVisitor;
 import org.apache.polygene.api.util.VisitableHierarchy;
+import org.apache.polygene.runtime.composite.CompositesModel;
+
+import java.util.List;
 
 /**
  * JAVADOC
  */
-public class ObjectsModel
+public class ObjectsModel extends CompositesModel<ObjectModel>
     implements VisitableHierarchy<Object, Object>
 {
-    private final List<ObjectModel> objectModels;
-
     public ObjectsModel( List<ObjectModel> objectModels )
     {
-        this.objectModels = objectModels;
-    }
-
-    @Override
-    public <ThrowableType extends Throwable> boolean accept( HierarchicalVisitor<?
super Object, ? super Object, ThrowableType> visitor )
-        throws ThrowableType
-    {
-        if( visitor.visitEnter( this ) )
-        {
-            for( ObjectModel objectModel : objectModels )
-            {
-                if( !objectModel.accept( visitor ) )
-                {
-                    break;
-                }
-            }
-        }
-        return visitor.visitLeave( this );
-    }
-
-    public Stream<ObjectModel> models()
-    {
-        return objectModels.stream();
+        super(objectModels);
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e1cc8a6e/core/runtime/src/main/java/org/apache/polygene/runtime/service/ImportedServicesInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/service/ImportedServicesInstance.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/service/ImportedServicesInstance.java
index 61a15c9..ffd0f95 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/service/ImportedServicesInstance.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/service/ImportedServicesInstance.java
@@ -58,7 +58,7 @@ public class ImportedServicesInstance
 
     public Stream<ImportedServiceModel> models()
     {
-        return servicesModel.models();
+        return servicesModel.stream();
     }
 
     @Override
@@ -117,7 +117,7 @@ public class ImportedServicesInstance
 
     public Stream<? extends ImportedServiceDescriptor> stream()
     {
-        return servicesModel.models();
+        return servicesModel.stream();
     }
 
     public Stream<ServiceReference<?>> references()

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e1cc8a6e/core/runtime/src/main/java/org/apache/polygene/runtime/service/ImportedServicesModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/service/ImportedServicesModel.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/service/ImportedServicesModel.java
index af34755..91a559f 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/service/ImportedServicesModel.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/service/ImportedServicesModel.java
@@ -20,58 +20,31 @@
 
 package org.apache.polygene.runtime.service;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Stream;
 import org.apache.polygene.api.service.ServiceReference;
 import org.apache.polygene.api.structure.ModuleDescriptor;
-import org.apache.polygene.api.util.HierarchicalVisitor;
 import org.apache.polygene.api.util.VisitableHierarchy;
+import org.apache.polygene.runtime.composite.CompositesModel;
+
+import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * JAVADOC
  */
-public class ImportedServicesModel
+public class ImportedServicesModel extends CompositesModel<ImportedServiceModel>
     implements VisitableHierarchy<Object, Object>
 {
-    private List<ImportedServiceModel> importedServiceModels;
-
     public ImportedServicesModel( List<ImportedServiceModel> importedServiceModels
)
     {
-        this.importedServiceModels = importedServiceModels;
+        super(importedServiceModels);
     }
 
     public ImportedServicesInstance newInstance( ModuleDescriptor module )
     {
-        List<ServiceReference<?>> serviceReferences = new ArrayList<>();
-        for( ImportedServiceModel serviceModel : importedServiceModels )
-        {
-            ImportedServiceReferenceInstance serviceReferenceInstance = new ImportedServiceReferenceInstance(
serviceModel, module );
-            serviceReferences.add( serviceReferenceInstance );
-        }
-
-        return new ImportedServicesInstance( this, serviceReferences );
-    }
-
-    @Override
-    public <ThrowableType extends Throwable> boolean accept( HierarchicalVisitor<?
super Object, ? super Object, ThrowableType> visitor )
-        throws ThrowableType
-    {
-        if( visitor.visitEnter( this ) )
-        {
-            for( ImportedServiceModel importedServiceModel : importedServiceModels )
-            {
-                if( !importedServiceModel.accept( visitor ) )
-                {
-                    break;
-                }
-            }
-        }
-        return visitor.visitLeave( this );
-    }
-
-    public Stream<ImportedServiceModel> models()
-    {
-        return importedServiceModels.stream();
+        List<ServiceReference<?>> serviceReferences = stream()
+                .map(serviceModel -> new ImportedServiceReferenceInstance(serviceModel,
module))
+                .<ServiceReference<?>>map(ServiceReference.class::cast)
+                .collect(Collectors.toList());
+        return new ImportedServicesInstance(this, serviceReferences );
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e1cc8a6e/core/runtime/src/main/java/org/apache/polygene/runtime/service/ServicesInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/service/ServicesInstance.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/service/ServicesInstance.java
index c40a74a..e6b1a41 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/service/ServicesInstance.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/service/ServicesInstance.java
@@ -56,7 +56,7 @@ public class ServicesInstance
 
     public Stream<? extends ServiceDescriptor> models()
     {
-        return servicesModel.models();
+        return servicesModel.stream();
     }
 
     @Override
@@ -112,7 +112,7 @@ public class ServicesInstance
 
     public Stream<? extends ServiceDescriptor> descriptors()
     {
-        return servicesModel.models();
+        return servicesModel.stream();
     }
 
     public Stream<ServiceReference<?>> references()

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e1cc8a6e/core/runtime/src/main/java/org/apache/polygene/runtime/service/ServicesModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/service/ServicesModel.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/service/ServicesModel.java
index ebdf64c..563ff2b 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/service/ServicesModel.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/service/ServicesModel.java
@@ -20,71 +20,31 @@
 
 package org.apache.polygene.runtime.service;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.stream.Stream;
-import org.apache.polygene.api.service.ServiceDescriptor;
 import org.apache.polygene.api.service.ServiceReference;
 import org.apache.polygene.api.structure.ModuleDescriptor;
-import org.apache.polygene.api.util.HierarchicalVisitor;
 import org.apache.polygene.api.util.VisitableHierarchy;
+import org.apache.polygene.runtime.composite.CompositesModel;
+
+import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * JAVADOC
  */
-public class ServicesModel
+public class ServicesModel extends CompositesModel<ServiceModel>
     implements VisitableHierarchy<Object, Object>
 {
-    private final List<ServiceModel> serviceModels;
-
     public ServicesModel( List<ServiceModel> serviceModels )
     {
-        this.serviceModels = serviceModels;
+        super(serviceModels);
     }
 
     public ServicesInstance newInstance( ModuleDescriptor module )
     {
-        List<ServiceReference<?>> serviceReferences = new ArrayList<>();
-        for( ServiceModel serviceModel : serviceModels )
-        {
-            ServiceReferenceInstance serviceReferenceInstance = new ServiceReferenceInstance(
serviceModel, module );
-            serviceReferences.add( serviceReferenceInstance );
-        }
-
+        List<ServiceReference<?>> serviceReferences = stream()
+                        .map(serviceModel -> new ServiceReferenceInstance(serviceModel,
module))
+                        .<ServiceReference<?>>map(ServiceReference.class::cast)
+                        .collect(Collectors.toList());
         return new ServicesInstance( this, serviceReferences );
     }
-
-    @Override
-    public <ThrowableType extends Throwable> boolean accept( HierarchicalVisitor<?
super Object, ? super Object, ThrowableType> visitor )
-        throws ThrowableType
-    {
-        if( visitor.visitEnter( this ) )
-        {
-            for( ServiceModel serviceModel : serviceModels )
-            {
-                if( !serviceModel.accept( visitor ) )
-                {
-                    break;
-                }
-            }
-        }
-        return visitor.visitLeave( this );
-    }
-
-    public Stream<? extends ServiceDescriptor> models()
-    {
-        return serviceModels.stream();
-    }
-
-    public boolean contains( Class<?> type )
-    {
-        for( ServiceModel model : serviceModels )
-        {
-            if( model.hasType( type ) )
-            {
-                return true;
-            }
-        }
-        return false;
-    }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e1cc8a6e/core/runtime/src/main/java/org/apache/polygene/runtime/structure/ModuleModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/structure/ModuleModel.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/structure/ModuleModel.java
index e873952..0c2abac 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/structure/ModuleModel.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/structure/ModuleModel.java
@@ -235,7 +235,7 @@ public class ModuleModel
     @Override
     public Stream<? extends ServiceDescriptor> serviceComposites()
     {
-        return servicesModel.models();
+        return servicesModel.stream();
     }
 
     @Override
@@ -247,13 +247,13 @@ public class ModuleModel
     @Override
     public Stream<? extends ImportedServiceDescriptor> importedServices()
     {
-        return importedServicesModel.models();
+        return importedServicesModel.stream();
     }
 
     @Override
     public Stream<? extends ObjectDescriptor> objects()
     {
-        return objectsModel.models();
+        return objectsModel.stream();
     }
 
     @Override
@@ -329,34 +329,34 @@ public class ModuleModel
 
     public Stream<? extends ObjectDescriptor> visibleObjects( Visibility visibility
)
     {
-        return objectsModel.models()
+        return objectsModel.stream()
             .filter( new VisibilityPredicate( visibility ) );
     }
 
     public Stream<? extends TransientDescriptor> visibleTransients( Visibility visibility
)
     {
-        return transientsModel.models()
+        return transientsModel.stream()
             .filter( new VisibilityPredicate( visibility ) );
     }
 
     public Stream<? extends EntityDescriptor> visibleEntities( Visibility visibility
)
     {
-        return entitiesModel.models()
+        return entitiesModel.stream()
             .filter( new VisibilityPredicate( visibility ) );
     }
 
     public Stream<? extends ValueDescriptor> visibleValues( Visibility visibility )
     {
-        return valuesModel.models()
+        return valuesModel.stream()
             .filter( new VisibilityPredicate( visibility ) );
     }
 
     public Stream<? extends ModelDescriptor> visibleServices( Visibility visibility
)
     {
         return concat(
-            servicesModel.models()
+            servicesModel.stream()
                 .filter( new VisibilityPredicate( visibility ) ),
-            importedServicesModel.models()
+            importedServicesModel.stream()
                 .filter( new VisibilityPredicate( visibility ) )
         );
     }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e1cc8a6e/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValuesModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValuesModel.java
b/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValuesModel.java
index caa875b..dbd36e7 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValuesModel.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValuesModel.java
@@ -20,49 +20,19 @@
 
 package org.apache.polygene.runtime.value;
 
-import java.util.List;
-import java.util.stream.Stream;
-import org.apache.polygene.api.util.HierarchicalVisitor;
 import org.apache.polygene.api.util.VisitableHierarchy;
-import org.apache.polygene.api.value.ValueDescriptor;
+import org.apache.polygene.runtime.composite.CompositesModel;
+
+import java.util.List;
 
 /**
  * JAVADOC
  */
-public final class ValuesModel
+public final class ValuesModel extends CompositesModel<ValueModel>
     implements VisitableHierarchy<Object, Object>
 {
-    private final List<ValueModel> valueModels;
-
     public ValuesModel( List<ValueModel> valueModels )
     {
-        this.valueModels = valueModels;
-    }
-
-    public Stream<ValueModel> models()
-    {
-        return valueModels.stream();
-    }
-
-    @Override
-    public <ThrowableType extends Throwable> boolean accept( HierarchicalVisitor<?
super Object, ? super Object, ThrowableType> visitor )
-        throws ThrowableType
-    {
-        if( visitor.visitEnter( this ) )
-        {
-            for( ValueModel valueModel : valueModels )
-            {
-                if( !valueModel.accept( visitor ) )
-                {
-                    break;
-                }
-            }
-        }
-        return visitor.visitLeave( this );
-    }
-
-    public Stream<? extends ValueDescriptor> stream()
-    {
-        return valueModels.stream();
+        super(valueModels);
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e1cc8a6e/libraries/rdf/src/main/java/org/apache/polygene/library/rdf/model/Model2XML.java
----------------------------------------------------------------------
diff --git a/libraries/rdf/src/main/java/org/apache/polygene/library/rdf/model/Model2XML.java
b/libraries/rdf/src/main/java/org/apache/polygene/library/rdf/model/Model2XML.java
index f9cb7ec..ef52fb7 100644
--- a/libraries/rdf/src/main/java/org/apache/polygene/library/rdf/model/Model2XML.java
+++ b/libraries/rdf/src/main/java/org/apache/polygene/library/rdf/model/Model2XML.java
@@ -53,7 +53,7 @@ public class Model2XML
         simpleMappings.put( "EntitiesModel", "entities" );
         simpleMappings.put( "ServicesModel", "services" );
         simpleMappings.put( "ImportedServicesModel", "importedservices" );
-        simpleMappings.put( "ObjectsModel", "objects" );
+        simpleMappings.put( "CompositesModel", "objects" );
         simpleMappings.put( "ValuesModel", "values" );
         simpleMappings.put( "MixinsModel", "mixins" );
         simpleMappings.put( "CompositeMethodsModel", "methods" );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/e1cc8a6e/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/ImportedServiceCompositeDescriptor.java
----------------------------------------------------------------------
diff --git a/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/ImportedServiceCompositeDescriptor.java
b/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/ImportedServiceCompositeDescriptor.java
index a87cd08..83b115c 100644
--- a/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/ImportedServiceCompositeDescriptor.java
+++ b/tools/model-detail/src/main/java/org/apache/polygene/tools/model/descriptor/ImportedServiceCompositeDescriptor.java
@@ -31,6 +31,7 @@ import org.apache.polygene.api.service.ImportedServiceDescriptor;
 import org.apache.polygene.api.service.ServiceImporter;
 import org.apache.polygene.api.structure.ModuleDescriptor;
 import org.apache.polygene.api.util.Classes;
+import org.apache.polygene.api.util.HierarchicalVisitor;
 
 /**
  * XXX Workaround for inconsistency in Polygene core-api/spi
@@ -99,6 +100,12 @@ public class ImportedServiceCompositeDescriptor
         return importedService.serviceImporter();
     }
 
+    @Override
+    public <ThrowableType extends Throwable> boolean accept(HierarchicalVisitor<?
super Object, ? super Object, ThrowableType> visitor) throws ThrowableType
+    {
+        return importedService.accept(visitor);
+    }
+
     public String toURI()
     {
         return Classes.toURI( primaryType() );


Mime
View raw message