public class ZMQUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static Map<String,Class<?>> |
PRIMITIVE_ARRAY_NAME_CLASS_MAP |
static Map<String,Class<?>> |
PRIMITIVE_NAME_CLASS_MAP |
static Set<Class> |
PRIMITIVES |
| Constructor and Description |
|---|
ZMQUtil(Collection<ClassLoader> cl,
String[] excludePaths) |
| Modifier and Type | Method and Description |
|---|---|
static Object |
convertToPrimitiveArray(byte[] bytes,
Object clazz) |
static Object |
decodeArray(byte[] byteArray,
Class arrayClass) |
protected static Object |
deserialize(byte[] message,
Function<mmcorej.org.json.JSONObject,?> deserializationFn) |
static byte[] |
encodeArray(Object array)
Convert array of primitives to a String
|
Set<Class> |
getPackageClasses(String packageName) |
static Set<String> |
getPackages() |
static Collection<String> |
getPackagesFromJars(URLClassLoader cl) |
protected static Class |
loadClass(String path) |
static mmcorej.org.json.JSONArray |
parseConstructors(String classpath,
Function<Class,Object> classMapper) |
void |
serialize(ConcurrentHashMap<String,Object> externalObjects,
Object o,
mmcorej.org.json.JSONObject json,
int port)
This version serializes primitves, converts lists to JSONArrays, and sends
out pointers to Objects
|
static mmcorej.org.json.JSONObject |
toJSON(Object o)
Convert objects that will be serialized into JSON.
|
public ZMQUtil(Collection<ClassLoader> cl, String[] excludePaths)
protected static Object deserialize(byte[] message, Function<mmcorej.org.json.JSONObject,?> deserializationFn)
public static mmcorej.org.json.JSONObject toJSON(Object o)
public void serialize(ConcurrentHashMap<String,Object> externalObjects, Object o, mmcorej.org.json.JSONObject json, int port)
externalObjects - the servers map of its external objects, needed for memory manamgemento - Object to be serializedjson - JSONObject that will contain the serialized Object can not beport - Port that the object is being sent out onpublic static byte[] encodeArray(Object array)
array - public static mmcorej.org.json.JSONArray parseConstructors(String classpath, Function<Class,Object> classMapper) throws mmcorej.org.json.JSONException, ClassNotFoundException
mmcorej.org.json.JSONExceptionClassNotFoundExceptionpublic static Collection<String> getPackagesFromJars(URLClassLoader cl)
public Set<Class> getPackageClasses(String packageName) throws UnsupportedEncodingException
UnsupportedEncodingExceptionCopyright © 2023. All rights reserved.