From 203d9f48bca2a8af9df818a3d09265a8e119252b Mon Sep 17 00:00:00 2001 From: Nicolas Feybesse Date: Mon, 24 Oct 2016 12:14:15 +0200 Subject: [PATCH] Remove getMap from API Fix warning in javadoc generation --- .../org/genericsystem/api/core/IRoot.java | 22 +++++-------------- .../constraints/InstanceValueGenerator.java | 5 +++++ .../defaults/DefaultGeneric.java | 9 ++------ .../genericsystem/defaults/DefaultRoot.java | 1 - .../defaults/DefaultSystemProperties.java | 3 +++ 5 files changed, 16 insertions(+), 24 deletions(-) diff --git a/gs-api/src/main/java/org/genericsystem/api/core/IRoot.java b/gs-api/src/main/java/org/genericsystem/api/core/IRoot.java index 54f50da43..093719357 100644 --- a/gs-api/src/main/java/org/genericsystem/api/core/IRoot.java +++ b/gs-api/src/main/java/org/genericsystem/api/core/IRoot.java @@ -12,13 +12,8 @@ public interface IRoot> extends IGeneric { /** - * This Method returns a node reference from the Generic System graph which - * corresponds to the class given as parameter. The node is statically - * created at startup should the java annotation @SystemGeneric has been - * positioned in the given Class. Thus the nodes created are permanently - * accessible through this method and are not removable. It's a secure and - * extremely fast way to a get a reference on a specific node. The - * specialization of implementation class can improve the standard behavior. + * This Method returns a node reference from the Generic System graph which corresponds to the class given as parameter. The node is statically created at startup should the java annotation @SystemGeneric has been positioned in the given Class. Thus + * the nodes created are permanently accessible through this method and are not removable. It's a secure and extremely fast way to a get a reference on a specific node. The specialization of implementation class can improve the standard behavior. * * @param * a customizable subtype of T. @@ -29,8 +24,7 @@ public interface IRoot> extends IGeneric { Custom find(Class clazz); /** - * Return a vertex built during new Root. If called during Root - * initialization, mount system node if nesscessary + * Return a vertex built during new Root. If called during Root initialization, mount system node if nesscessary * * @param * an implementation of a customizable subtype of T. @@ -57,26 +51,22 @@ public interface IRoot> extends IGeneric { */ /** - * Return the meta attribute. The meta attribute is the super of all - * attributes. + * Return the meta attribute. The meta attribute is the super of all attributes. * * @return the meta attribute. */ T getMetaAttribute(); /** - * Return the meta relation. The meta relation is the super of all - * relations. + * Return the meta relation. The meta relation is the super of all relations. * * @return the meta relation. */ T getMetaRelation(); /** - * Close the root. All changes done in the cache but not committed are - * automatically rollbacked. Persist the last state of the engine. + * Close the root. All changes done in the cache but not committed are automatically rollbacked. Persist the last state of the engine. */ void close(); - T getMap(); } diff --git a/gs-api/src/main/java/org/genericsystem/api/core/annotations/constraints/InstanceValueGenerator.java b/gs-api/src/main/java/org/genericsystem/api/core/annotations/constraints/InstanceValueGenerator.java index ee72fd7d7..29e04b0be 100644 --- a/gs-api/src/main/java/org/genericsystem/api/core/annotations/constraints/InstanceValueGenerator.java +++ b/gs-api/src/main/java/org/genericsystem/api/core/annotations/constraints/InstanceValueGenerator.java @@ -8,6 +8,7 @@ import java.lang.annotation.Target; import java.util.Iterator; import java.util.List; + import org.genericsystem.api.core.IGeneric; /** @@ -29,9 +30,13 @@ public static interface ValueGenerator> { /** * @param meta + * the meta of generic to create. * @param supers + * the supers of the generic to create * @param value + * the value proposed of the generic to create * @param components + * the components of the generic to create * @return the generate value for new instances */ Serializable generateInstanceValue(T meta, List supers, Serializable value, List components); diff --git a/gs-defaults/src/main/java/org/genericsystem/defaults/DefaultGeneric.java b/gs-defaults/src/main/java/org/genericsystem/defaults/DefaultGeneric.java index 5f86bf14d..02950c8de 100644 --- a/gs-defaults/src/main/java/org/genericsystem/defaults/DefaultGeneric.java +++ b/gs-defaults/src/main/java/org/genericsystem/defaults/DefaultGeneric.java @@ -109,8 +109,8 @@ default boolean inheritsFrom(T superMeta, List overrides, Serializable superV default boolean isDependencyOf(T meta, List supers, Serializable value, List components) { - return (inheritsFrom(meta, supers, value, components) || getComponents().stream().anyMatch(component -> component.isDependencyOf(meta, supers, value, components)) || (!isMeta() && getMeta().isDependencyOf(meta, supers, value, components)) || (!components - .equals(getComponents()) && componentsDepends(getComponents(), components) && supers.stream().anyMatch(override -> override.inheritsFrom(getMeta())))); + return (inheritsFrom(meta, supers, value, components) || getComponents().stream().anyMatch(component -> component.isDependencyOf(meta, supers, value, components)) || (!isMeta() && getMeta().isDependencyOf(meta, supers, value, components)) + || (!components.equals(getComponents()) && componentsDepends(getComponents(), components) && supers.stream().anyMatch(override -> override.inheritsFrom(getMeta())))); } @@ -301,11 +301,6 @@ default boolean isSystem() { return ApiStatics.TS_SYSTEM == getBirthTs(); } - @Override - default DefaultRoot getRoot() { - throw new IllegalStateException(); - } - @Override default int compareTo(T generic) { long birthTs = getBirthTs(); diff --git a/gs-defaults/src/main/java/org/genericsystem/defaults/DefaultRoot.java b/gs-defaults/src/main/java/org/genericsystem/defaults/DefaultRoot.java index fcb2fa689..5610bdb75 100644 --- a/gs-defaults/src/main/java/org/genericsystem/defaults/DefaultRoot.java +++ b/gs-defaults/src/main/java/org/genericsystem/defaults/DefaultRoot.java @@ -28,7 +28,6 @@ default T getMetaRelation() { return find(MetaRelation.class); } - @Override default T getMap() { return find(SystemMap.class); } diff --git a/gs-defaults/src/main/java/org/genericsystem/defaults/DefaultSystemProperties.java b/gs-defaults/src/main/java/org/genericsystem/defaults/DefaultSystemProperties.java index a5bee472d..e1633da10 100644 --- a/gs-defaults/src/main/java/org/genericsystem/defaults/DefaultSystemProperties.java +++ b/gs-defaults/src/main/java/org/genericsystem/defaults/DefaultSystemProperties.java @@ -58,6 +58,9 @@ default T setSystemPropertyValue(Class propertyClass, return (T) this; } + @Override + DefaultRoot getRoot(); + @Override @SuppressWarnings("unchecked") default T enableSystemProperty(Class propertyClass, int pos, T... targets) {