Package org.yamcs.utils
Class YObjectLoader<T>
- java.lang.Object
-
- org.yamcs.utils.YObjectLoader<T>
-
public class YObjectLoader<T> extends Object
-
-
Constructor Summary
Constructors Constructor Description YObjectLoader()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> TloadObject(String className, Object... args)Loads classes defined in the yamcs server or client configuration propertiesstatic <T> TloadObject(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> TloadObject(Map<String,Object> conf, Object firstArg)same as the method above but loads a constructor with the firstArg as the first argumentstatic <T> TloadObject(Map<String,Object> conf, Object firstArg, Object secondArg)same as the method above but loads a constructor with firstArg and secondArg as the first two arguments
-
-
-
Method Detail
-
loadObject
public static <T> T loadObject(String className, Object... args) throws ConfigurationException, IOException
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:
ConfigurationExceptionIOException
-
loadObject
public static <T> T loadObject(Map<String,Object> conf) throws ConfigurationException, IOException
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:
IOExceptionConfigurationException
-
loadObject
public static <T> T loadObject(Map<String,Object> conf, Object firstArg) throws ConfigurationException, IOException
same as the method above but loads a constructor with the firstArg as the first argument- Parameters:
conf-firstArg-- Returns:
- a newly created object
- Throws:
ConfigurationExceptionIOException
-
loadObject
public static <T> T loadObject(Map<String,Object> conf, Object firstArg, Object secondArg) throws ConfigurationException, IOException
same 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:
ConfigurationExceptionIOException
-
-