当前位置: 首页>>代码示例>>Java>>正文


Java DontSerialize类代码示例

本文整理汇总了Java中org.red5.annotations.DontSerialize的典型用法代码示例。如果您正苦于以下问题:Java DontSerialize类的具体用法?Java DontSerialize怎么用?Java DontSerialize使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DontSerialize类属于org.red5.annotations包,在下文中一共展示了DontSerialize类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: serializeField

import org.red5.annotations.DontSerialize; //导入依赖的package包/类
/**
 * Checks whether the field should be serialized or not
 * 
 * @param keyName key name
 * @param field The field to be serialized
 * @param getter Getter method for field
 * @return <tt>true</tt> if the field should be serialized, otherwise <tt>false</tt>
 */
public static boolean serializeField(String keyName, Field field, Method getter) {
	log.trace("serializeField - keyName: {} field: {} method: {}", new Object[] { keyName, field, getter });
	// if "field" is a class or is transient, skip it
	if ("class".equals(keyName)) {
		return false;
	}
	if (field != null) {
		if (Modifier.isTransient(field.getModifiers())) {
			log.trace("Skipping {} because its transient", keyName);
			return false;							
		} else if (field.isAnnotationPresent(DontSerialize.class)) {
			log.trace("Skipping {} because its marked with @DontSerialize", keyName);
			return false;			
		}
	}
	if (getter != null && getter.isAnnotationPresent(DontSerialize.class)) {
		log.trace("Skipping {} because its marked with @DontSerialize", keyName);
		return false;
	}
	log.trace("Serialize field: {}", field);
	return true;
}
 
开发者ID:Kyunghwa-Yoo,项目名称:StitchRTSP,代码行数:31,代码来源:Serializer.java

示例2: serializeField

import org.red5.annotations.DontSerialize; //导入依赖的package包/类
/**
 * Checks whether the field should be serialized or not
 * 
 * @param keyName
 *            key name
 * @param field
 *            The field to be serialized
 * @param getter
 *            Getter method for field
 * @return <tt>true</tt> if the field should be serialized, otherwise <tt>false</tt>
 */
public static boolean serializeField(String keyName, Field field, Method getter) {
    log.trace("serializeField - keyName: {} field: {} method: {}", new Object[] { keyName, field, getter });
    // if "field" is a class or is transient, skip it
    if ("class".equals(keyName)) {
        return false;
    }
    if (field != null) {
        if (Modifier.isTransient(field.getModifiers())) {
            log.trace("Skipping {} because its transient", keyName);
            return false;
        } else if (field.isAnnotationPresent(DontSerialize.class)) {
            log.trace("Skipping {} because its marked with @DontSerialize", keyName);
            return false;
        }
    }
    if (getter != null && getter.isAnnotationPresent(DontSerialize.class)) {
        log.trace("Skipping {} because its marked with @DontSerialize", keyName);
        return false;
    }
    log.trace("Serialize field: {}", field);
    return true;
}
 
开发者ID:Red5,项目名称:red5-io,代码行数:34,代码来源:Serializer.java

示例3: serializeField

import org.red5.annotations.DontSerialize; //导入依赖的package包/类
/**
 * Checks whether the field should be serialized or not
 * 
 * @param keyName key name
 * @param field The field to be serialized
 * @param getter Getter method for field
 * @return <code>true</code> if the field should be serialized, otherwise
 *         <code>false</code>
 */
public boolean serializeField(String keyName, Field field, Method getter) {
	log.trace("serializeField - keyName: {} field: {} method: {}", new Object[] { keyName, field, getter });
	if ("class".equals(keyName)) {
		return false;
	}
	if ((field != null && field.isAnnotationPresent(DontSerialize.class)) || (getter != null && getter.isAnnotationPresent(DontSerialize.class))) {
		log.trace("Skipping {} because its marked with @DontSerialize", keyName);
		return false;
	}
	log.trace("Serialize field: {}", field);
	return true;
}
 
开发者ID:cwpenhale,项目名称:red5-mobileconsole,代码行数:22,代码来源:Serializer.java


注:本文中的org.red5.annotations.DontSerialize类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。