Package org.yamcs.utils
Class YObjectLoader<T>
java.lang.Object
org.yamcs.utils.YObjectLoader<T>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
loadObject
(String className, Object... args) Loads classes defined in the yamcs server or client configuration propertiesstatic <T> T
loadObject
(Map<String, Object> conf) loads an object defined like this: class: org.yamcs.... args: key1: value1 key2: value2 "args" can also be called "config" or can be missing.static <T> T
loadObject
(Map<String, Object> conf, Object firstArg) same as the method above but loads a constructor with the firstArg as the first argumentstatic <T> T
same as the method above but loads a constructor with firstArg and secondArg as the first two arguments
-
Constructor Details
-
YObjectLoader
public YObjectLoader()
-
-
Method Details
-
loadObject
Loads classes defined in the yamcs server or client configuration properties- Parameters:
className
-args
-- Returns:
- an object of the given class instantiated with the given parameters
- Throws:
ConfigurationException
-
loadObject
loads an object defined like this: class: org.yamcs.... args: key1: value1 key2: value2 "args" can also be called "config" or can be missing. The value of args can also be a list or a scalar type. args can also be called config or spec. If args is present, then a constructor with the given type is invoked otherwise the constructor without any argument is invoked.- Parameters:
conf
-- Returns:
- a new object
- Throws:
IOException
ConfigurationException
-
loadObject
public static <T> T loadObject(Map<String, Object> conf, Object firstArg) throws ConfigurationException, IOExceptionsame as the method above but loads a constructor with the firstArg as the first argument- Parameters:
conf
-firstArg
-- Returns:
- a newly created object
- Throws:
ConfigurationException
IOException
-
loadObject
public static <T> T loadObject(Map<String, Object> conf, Object firstArg, Object secondArg) throws ConfigurationException, IOExceptionsame as the method above but loads a constructor with firstArg and secondArg as the first two arguments- Parameters:
conf
-firstArg
-secondArg
-- Returns:
- a newly created object
- Throws:
ConfigurationException
IOException
-