de.deepamehta.core.util
Class DeepaMehtaUtils
java.lang.Object
de.deepamehta.core.util.DeepaMehtaUtils
public class DeepaMehtaUtils
- extends Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
private static Logger logger
DM4_HOST_URL
private static final String DM4_HOST_URL
DeepaMehtaUtils
public DeepaMehtaUtils()
isDeepaMehtaURL
public static boolean isDeepaMehtaURL(URL url)
- Checks if an URL refers to this DeepaMehta installation.
The check relies on the "dm4.host.url" system property.
idList
public static List<Long> idList(Iterable<? extends Identifiable> items)
toTopicModels
public static List<TopicModel> toTopicModels(Iterable<? extends Topic> topics)
topicNames
public static String topicNames(Iterable<? extends Topic> topics)
toMap
public static Map toMap(JSONObject o)
toMap
public static Map toMap(JSONObject o,
Map map)
toList
public static List toList(JSONArray o)
stringsToJson
public static JSONArray stringsToJson(Collection<String> strings)
objectsToJSON
public static JSONArray objectsToJSON(Iterable<? extends JSONEnabled> items)
readMigrationFile
public static void readMigrationFile(InputStream is,
String migrationFileName,
DeepaMehtaService dms)
- Creates types and topics from a JSON formatted input stream.
- Parameters:
migrationFileName
- The origin migration file. Used for logging only.
createTopicTypes
public static void createTopicTypes(JSONArray topicTypes,
DeepaMehtaService dms)
throws Exception
- Throws:
Exception
createAssociationTypes
public static void createAssociationTypes(JSONArray assocTypes,
DeepaMehtaService dms)
throws Exception
- Throws:
Exception
createTopics
public static void createTopics(JSONArray topics,
DeepaMehtaService dms)
throws Exception
- Throws:
Exception
createAssociations
public static void createAssociations(JSONArray assocs,
DeepaMehtaService dms)
throws Exception
- Throws:
Exception
Copyright © 2014. All Rights Reserved.