/** * Constructs a new object of the specified type name using a multi-arg constructor. * @param typeName the class type name of the object * @param paramTypeNames the type names of the params * @param params the param objects * @return the new object */ public static Object construct(String typeName, String[] paramTypeNames, Object[] params) { return construct(typeName, paramTypeNames, params, Construction.class); }
/** * Constructs a new object of the specified type name using a multi-arg constructor. * @param typeName the class type name of the object * @param paramTypeNames the type names of the params * @param params the param objects * @return the new object */ public static Object construct(String typeName, String[] paramTypeNames, Object[] params) { return construct(typeName, paramTypeNames, params, Construction.class); }
/** * Constructs a new object of the specified type name using a multi-arg constructor. * @param typeName the class type name of the object * @param paramTypes the types of the params * @param params the param objects * @return the new object */ public static Object construct(String typeName, Class<?>[] paramTypes, Object[] params) { return construct(typeName, paramTypes, params, Construction.class); }
/** * Constructs a new object of the specified type name using it's no-arg constructor. * @param typeName the class type name of the object * @return the new object */ public static Object construct(String typeName) { return construct(typeName, Construction.class); }
/** * {@inheritDoc} */ @Override public T create(Class<T> type, Node node) { if (type != null) { return Construction.construct(type); } return null; }
/** * Constructs a new object of the specified type using it's no-arg constructor. * @param <T> the type of object * @param type the class type of the object * @return the new object */ public static <T> T construct(Class<T> type) { return construct(type, new Class<?>[0], new Object[0]); }
/** * Constructs a new object of the specified type using it's no-arg constructor. * @param <T> the type of object * @param type the class type of the object * @return the new object */ public static <T> T construct(Class<T> type) { return construct(type, new Class<?>[0], new Object[0]); }
/** * Constructs a new object of the specified type name using a multi-arg constructor. * @param typeName the class type name of the object * @param paramTypes the types of the params * @param params the param objects * @return the new object */ public static Object construct(String typeName, Class<?>[] paramTypes, Object[] params) { return construct(typeName, paramTypes, params, Construction.class); }
/** * Constructs a new object of the specified type name using it's no-arg constructor. * @param typeName the class type name of the object * @param caller the class calling this method (for classloading purposes) * @return the new object */ public static Object construct(String typeName, Class<?> caller) { return construct(typeName, (ClassLoader)(caller != null ? caller.getClassLoader() : null)); }
/** * Constructs a new object of the specified type name using a multi-arg constructor. * @param typeName the class type name of the object * @param paramTypes the types of the params * @param params the param objects * @param caller the class calling this method (for classloading purposes) * @return the new object */ public static Object construct(String typeName, Class<?>[] paramTypes, Object[] params, Class<?> caller) { return construct(typeName, paramTypes, params, caller != null ? caller.getClassLoader() : null); }
/** * Constructs a new object of the specified type name using a multi-arg constructor. * @param typeName the class type name of the object * @param paramTypeNames the type names of the params * @param params the param objects * @param caller the class calling this method (for classloading purposes) * @return the new object */ public static Object construct(String typeName, String[] paramTypeNames, Object[] params, Class<?> caller) { return construct(typeName, paramTypeNames, params, (ClassLoader)(caller != null ? caller.getClassLoader() : null)); }
/** * Constructs a new object of the specified type name using a multi-arg constructor. * @param typeName the class type name of the object * @param paramTypes the types of the params * @param params the param objects * @param caller the class calling this method (for classloading purposes) * @return the new object */ public static Object construct(String typeName, Class<?>[] paramTypes, Object[] params, Class<?> caller) { return construct(typeName, paramTypes, params, caller != null ? caller.getClassLoader() : null); }
/** * Constructs a new object of the specified type name using it's no-arg constructor. * @param typeName the class type name of the object * @param caller the class calling this method (for classloading purposes) * @return the new object */ public static Object construct(String typeName, Class<?> caller) { return construct(typeName, (ClassLoader)(caller != null ? caller.getClassLoader() : null)); }
/** * {@inheritDoc} */ @Override public Serializer newSerializer(FormatType format) { Class<? extends Serializer> c = MAP.get(format); return c != null ? Construction.construct(c) : null; }
/** * Constructs a new object of the specified type name using a multi-arg constructor. * @param typeName the class type name of the object * @param paramTypeNames the type names of the params * @param params the param objects * @param caller the class calling this method (for classloading purposes) * @return the new object */ public static Object construct(String typeName, String[] paramTypeNames, Object[] params, Class<?> caller) { return construct(typeName, paramTypeNames, params, (ClassLoader)(caller != null ? caller.getClassLoader() : null)); }
/** * Constructs a new object of the specified type name using it's no-arg constructor. * @param typeName the class type name of the object * @param loader the classloader to use for classloading * @return the new object */ public static Object construct(String typeName, ClassLoader loader) { return construct(Classes.forName(typeName, loader)); }
/** * Constructs a new object of the specified type name using a multi-arg constructor. * @param typeName the class type name of the object * @param paramTypes the types of the params * @param params the param objects * @param loader the classloader to use for classloading * @return the new object */ public static Object construct(String typeName, Class<?>[] paramTypes, Object[] params, ClassLoader loader) { Class<?> type = Classes.forName(typeName, loader); return construct(type, paramTypes, params); }
@Override public Marshaller createMarshaller(String namespace, Descriptor desc) { try { Class<Marshaller> clazz = getMarshallerClass(namespace); if (clazz != null) { return Construction.construct(clazz, new Class<?>[]{Descriptor.class}, new Object[]{desc}); } return null; } catch (Exception e) { throw new IllegalStateException("Unable to create marshaller", e); } }
/** * Constructs a new object of the specified type name using a multi-arg constructor. * @param typeName the class type name of the object * @param paramTypes the types of the params * @param params the param objects * @param loader the classloader to use for classloading * @return the new object */ public static Object construct(String typeName, Class<?>[] paramTypes, Object[] params, ClassLoader loader) { Class<?> type = Classes.forName(typeName, loader); return construct(type, paramTypes, params); }
/** * Constructs a new object of the specified type name using it's no-arg constructor. * @param typeName the class type name of the object * @param loader the classloader to use for classloading * @return the new object */ public static Object construct(String typeName, ClassLoader loader) { return construct(Classes.forName(typeName, loader)); }