Returns an object from a serialised string
@param clazz Class.name value
@param stringContainingSerialisedInput
@param <T>
@return
768177
public <T> T deserialize(Class<T> clazz, String stringContainingSerialisedInput) {
        T instance;
        try {
            instance = storageSerializer.deserialize(clazz, stringContainingSerialisedInput);
        } catch (SerializationException e) {
            throw new IllegalStateException("unable to serialise", e);
        }
        return instance;
    }
507502
public CmsContainer getSerializedContainer(String data) throws SerializationException {

        return (CmsContainer)CmsRpcPrefetcher.getSerializedObjectFromString(getContainerpageService(), data);
    }
543450
public static <T> T fromJsonString(String jsonString, Class<T> clazz, ClassLoader classLoader) {
        if (jsonString == null) {
            return null;
        }
        ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
        if (classLoader != null) {
            Thread.currentThread().setContextClassLoader(classLoader);
        }
        try {
            ObjectMapper mapper = poolMapper.borrowObject();
            if (mapper != null) {
                try {
                    return mapper.readValue(jsonString, clazz);
                } finally {
                    poolMapper.returnObject(mapper);
                }
            }
            throw new DeserializationException("No ObjectMapper instance avaialble!");
        } catch (Exception e) {
            throw e instanceof DeserializationException ? (DeserializationException) e
                    : new DeserializationException(e);
        } finally {
            Thread.currentThread().setContextClassLoader(oldClassLoader);
        }
    }
950778
public <T > Iterable<T> parse(Iterable<String> inputs, Class<T> clazz) {
		List<T> parsedValues = new LinkedList<>();
		for (String input : inputs) {
			parsedValues.add(parse(input, clazz));
		}

		return parsedValues;
	}
1126500
public <T> T get(Map<String, Object> data, String name, Class<T> clazz) {
    return convert(get(data, name), clazz);
  }
1185501
public static <T> T getBean(Class<T> clazz) {
        ApplicationContext appContext = getAppContext();
        
        try {
            return appContext == null ? null : appContext.getBean(clazz);
        } catch (Exception e) {
            return null;
        }
    }
252368
public <T> T parse(String input, Class<T> clazz) {
		try {
			if (String.class.equals(clazz)) {
				return (T) input;
			}

			StringParser<T> parser = getParser(clazz, input);
			if (parser == null) {
				throw new ParserException(String.format("Cannot parse to %s : %s", clazz.getName(), input));
			}

			return parser.parse(input);
		}
		catch (NumberFormatException e) {
			throw new ParserException(e.getMessage());
		}
	}
1075030
public Object newInstance(String clazz) {
        try {
            return Class.forName(clazz).newInstance();
        } catch (Exception e) {
            error(e);
            return null;
        }
    }
392850
public static <T> T getBean(Class<T> clazz) throws ReflectionException {
      return parameterizeObject(Reflect.onClass(clazz).create().<T>get());
   }
48248
public Serializer getSerializer(Class cl)
        throws HessianProtocolException
    {
        if (ObjectName.class.equals(cl)) {
            return new StringValueSerializer();
        }

        return null;
    }
462218
static <T> T convertToCustomClass(Object object, Class<T> clazz) {
    return deserializeToClass(object, clazz, ErrorPath.EMPTY);
  }
1206007
public static <T> T deserialize(final byte[] inBytes, final Class<T> clazz) {
        val inputStream = new ByteArrayInputStream(inBytes);
        return deserialize(inputStream, clazz);
    }
1157629
public <T> T deserialise(final Class<T> clazz, final InputSource source)
	{
		final Object obj = deserialise(source);

		if (clazz.isInstance(obj))
			return clazz.cast(obj);
		else
			throw new JAXBRuntimeException("XML deserialised to " + obj.getClass() + ", could not cast to the expected " + clazz);
	}
899260
@SuppressWarnings({
			"unchecked", "rawtypes"
	})
	public Collection<String> getStringCollection(final Class<? extends Collection> clazz) {
		try {
			final Collection<String> collection = clazz.newInstance();
			final int len = getVInt();
			for (int i = 0; i < len; i++) {
				collection.add(getString());
			}
			return collection;
		} catch (InstantiationException e) {
			throw new IllegalArgumentException("Invalid class", e);
		} catch (IllegalAccessException e) {
			throw new IllegalArgumentException("Invalid class", e);
		}
	}
1010363
@SuppressWarnings("unchecked")
    @Override
    public final <T> T deserialize(byte[] content, Class<T> clazz) throws SerializerException {
        if (byte[].class.equals(clazz)) {
            return (T) content;
        }
        throw new SerializerException("Unable to deserialize to type '" + clazz.getName() + "'");
    }
1032964
@SuppressWarnings({
			"unchecked", "rawtypes"
	})
	public Map<String, String> getStringMap(final Class<? extends Map> clazz) {
		try {
			final Map<String, String> map = clazz.newInstance();
			final int len = getVInt();
			for (int i = 0; i < len; i++) {
				map.put(getString(), getString());
			}
			return map;
		} catch (InstantiationException e) {
			throw new IllegalArgumentException("Invalid class", e);
		} catch (IllegalAccessException e) {
			throw new IllegalArgumentException("Invalid class", e);
		}
	}
364228
private void validateString(Class<?> clazz) throws SerializerException {
        if (null != clazz && !clazz.isAssignableFrom(String.class)) {
            throw new SerializerException("String serializer is able to work only with data types assignable from java.lang.String");
        }
    }