summaryrefslogtreecommitdiffstats
path: root/context/context-management/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'context/context-management/src/main/java')
-rw-r--r--context/context-management/src/main/java/org/onap/policy/apex/context/SchemaHelper.java8
-rw-r--r--context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java9
-rw-r--r--context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelper.java1
3 files changed, 17 insertions, 1 deletions
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/SchemaHelper.java b/context/context-management/src/main/java/org/onap/policy/apex/context/SchemaHelper.java
index 44ec06c6d..b6d21a20d 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/SchemaHelper.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/SchemaHelper.java
@@ -92,6 +92,14 @@ public interface SchemaHelper {
Object createNewInstance(Object incomingObject);
/**
+ * Create an object of a sub type of this object.
+ *
+ * @param subType the sub type definition of this type
+ * @return a new object of the sub type
+ */
+ Object createNewSubInstance(String subType);
+
+ /**
* Unmarshal an object in schema format into a Java object.
*
* @param object the object as a Java object
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java
index f50eb5914..6d98313ed 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/AbstractSchemaHelper.java
@@ -22,6 +22,7 @@ package org.onap.policy.apex.context.impl.schema;
import java.lang.reflect.Constructor;
+import org.apache.commons.lang3.NotImplementedException;
import org.onap.policy.apex.context.ContextRuntimeException;
import org.onap.policy.apex.context.SchemaHelper;
import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey;
@@ -169,4 +170,12 @@ public abstract class AbstractSchemaHelper implements SchemaHelper {
throw new ContextRuntimeException(returnString);
}
}
+
+ /* (non-Javadoc)
+ * @see org.onap.policy.apex.context.SchemaHelper#createNewSubInstance(java.lang.String)
+ */
+ @Override
+ public Object createNewSubInstance(String subType) {
+ throw new NotImplementedException("sub types are not supported on this schema helper");
+ }
}
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelper.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelper.java
index 8b61f718a..fcc7c4d60 100644
--- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelper.java
+++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/schema/java/JavaSchemaHelper.java
@@ -279,5 +279,4 @@ public class JavaSchemaHelper extends AbstractSchemaHelper {
return gsonBuilder.create();
}
-
}