Returns a JSON API resource type used by Katharsis. If a class cannot be
found, <i>null</i> is returned. The value is fetched from
{@link ResourceInformation#getResourceType()} attribute.

@param clazz
resource class
@return resource type or null
337168
public String getResourceType(Class<?> clazz) {
		RegistryEntry entry = getEntry(clazz, true);
		if (entry == null) {
			return null;
		}
		ResourceInformation resourceInformation = entry.getResourceInformation();
		if (resourceInformation == null) {
			return null;
		}
		return resourceInformation.getResourceType();
	}
440156
public <T> T getResponseBody(Class<T> clazz) {
        final ByteBuf byteBuf = httpInputMessage.getBody();
        if(byteBuf.readableBytes() == 0 || Void.class.isAssignableFrom(clazz)) return null;

        final MediaType mediaType = MediaType.parseMediaType(httpInputMessage.getHeaders().get(HttpHeaders.CONTENT_TYPE));
        for (HttpMessageConverter httpMessageConverter : httpMessageConverters) {
            if (httpMessageConverter.canRead(clazz, mediaType)) {
                return (T) httpMessageConverter.read(clazz, httpInputMessage);
            }
        }
        return null;
    }
95776
public EntityType getEntityType(Class<?> clazz) {
    EntityType type = context.getEntityType(clazz);
    if (null == type) {
      type = new EntityType(clazz);
    }
    return type;
  }
999115
public Class<?> getArrayType(Class<?> clazz) {

        if (clazz.isArray()) {
            return getArrayType(clazz.getComponentType());
        }

        return clazz;
    }
990901
public static boolean isNotPojo(Class<?> clazz) throws NullPointerException {
        Assert.notNull(clazz, "clazz不能为null");
        return Boolean.class.isAssignableFrom(clazz) || Character.class.isAssignableFrom(clazz)
               || Number.class.isAssignableFrom(clazz) || Map.class.isAssignableFrom(clazz)
               || String.class.isAssignableFrom(clazz) || Collection.class.isAssignableFrom(clazz)
               || Enum.class.isAssignableFrom(clazz) || isGeneralType(clazz);
    }
47842
@Nullable protected Cluster getCluster(final String clusterUUID) throws FlexiantException {
        return this.getResource(clusterUUID, ResourceType.CLUSTER, Cluster.class);
    }
594396
public String getClassTypeName(Class<?> clazz) {
        
        String type = null;

        if (clazz.isInterface()) {
            type = "interface";
        }
        else if (clazz.isPrimitive() || clazz.isArray()) {
            // type already null
        }
        else {
            type = "class";
        }

        return type;
    }
486621
@Nullable
    public <T> T properties(Class<T> clazz) throws JsonProcessingException {
        return properties != null ? Jackson.treeToValue(properties, clazz) : null;
    }
76226
public <T> T fromJson(@Nullable String jsonString, Class<T> clazz) {
		if (StringUtils.isEmpty(jsonString)) {
			return null;
		}

		try {
			return mapper.readValue(jsonString, clazz);
		} catch (IOException e) {
			logger.warn("parse json string error:" + jsonString, e);
			return null;
		}
	}
752022
public static Class<?> getEncoderType(Class<? extends Encoder> clazz) {
        Method[] methods = clazz.getMethods();
        for (Method m : methods) {
            if ("encode".equals(m.getName()) && !m.isBridge()) {
                return m.getParameterTypes()[0];
            }
        }
        throw JsrWebSocketMessages.MESSAGES.unknownEncoderType(clazz);
    }
328705
public static Type[] getSupperGenericType(Class clazz) {
        ParameterizedType parameterizedType;
        if (clazz.getGenericInterfaces().length > 0) {//父类是interface, the super type is an interface.
            if (clazz.getGenericInterfaces()[0] instanceof ParameterizedType) {
                /*注意：有多个父接口时，这里是取第一个父接口
                  Attention: if multiple parents are defined, we only get the first one.*/
                parameterizedType = (ParameterizedType) clazz.getGenericInterfaces()[0];
            } else {
                return null;
            }
        } else {//父类是class, the super type is a class.
            if (clazz.getGenericSuperclass() instanceof ParameterizedType) {
                parameterizedType = (ParameterizedType) clazz.getGenericSuperclass();
            } else {
                return null;
            }
        }
        return parameterizedType.getActualTypeArguments();
    }
630625
public static Class<?> getPropertyType( Clazz<?> clazz, String name )
	{
		return propertyValues.getPropertyType(clazz, name);
	}
434222
public static String parseSource(ResourceInfo resourceInfo) {
        if (resourceInfo != null) {
            Class clazz = resourceInfo.getResourceClass();
            if (clazz != null)
                return ClassUtils.toString(clazz, resourceInfo.getResourceMethod());
        }
        return null;
    }
907447
private static File _getClassSource (final Class <?> type)
  {
    if (type != null)
    {
      final String classResource = type.getName ().replace ('.', '/') + ".class";
      return _getResourceSource (classResource, type.getClassLoader ());
    }
    return null;
  }
1364896
public static ClassLoader getClassLoader(Class clazz){
        ClassLoader classLoader = clazz.getClassLoader();
        return classLoader==null ? ClassLoader.getSystemClassLoader() : classLoader;
    }
1209441
public String getClassAlias(Class clazz) {
        if (clazz == null)
            return null;

        TypeEncoder<?, U> encoder = classMapping.get(clazz);
        if (encoder != null)
            return encoder.getAlias();

        return null;
    }
262424
public ResourceFactory findResourceFactory(String name, Type clazz) {
        Map<String, ResourceEntry> map = this.store.get(clazz);
        if (map != null && map.containsKey(name)) return this;
        if (parent != null) return parent.findResourceFactory(name, clazz);
        return null;
    }