本文整理汇总了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;
}
示例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;
}
示例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;
}