本文整理汇总了Java中org.jnetpcap.packet.annotate.Dynamic.field方法的典型用法代码示例。如果您正苦于以下问题:Java Dynamic.field方法的具体用法?Java Dynamic.field怎么用?Java Dynamic.field使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jnetpcap.packet.annotate.Dynamic
的用法示例。
在下文中一共展示了Dynamic.field方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkAnnotation
import org.jnetpcap.packet.annotate.Dynamic; //导入方法依赖的package包/类
/**
* Check annotation.
*
* @param method
* the method
* @param fields
* the fields
*/
public static void checkAnnotation(Method method, List<AnnotatedField> fields) {
Dynamic runtime = method.getAnnotation(Dynamic.class);
if (runtime.field().length() != 0) {
boolean found = false;
final String name = runtime.field();
for (AnnotatedField f : fields) {
if (f.getName().equals(name)) {
found = true;
break;
}
}
if (!found) {
throw new HeaderDefinitionError("field name defined in annotation ");
}
}
}
示例2: AnnotatedFieldMethod
import org.jnetpcap.packet.annotate.Dynamic; //导入方法依赖的package包/类
/**
* Instantiates a new annotated field method.
*
* @param method
* the method
* @param function
* the function
*/
public AnnotatedFieldMethod(Method method, Field.Property function) {
super(method);
this.function = function;
Dynamic runtime = method.getAnnotation(Dynamic.class);
if (runtime == null) {
throw new HeaderDefinitionError(method.getDeclaringClass(),
"unable get field's annotated runtime");
}
if (runtime.field().length() != 0) {
this.field = runtime.field();
} else {
this.field = guessFieldName(method.getName());
}
}
示例3: AnnotatedFieldMethod
import org.jnetpcap.packet.annotate.Dynamic; //导入方法依赖的package包/类
/**
* Instantiates a new annotated field method.
*
* @param method
* the method
* @param function
* the function
*/
public AnnotatedFieldMethod(Method method, Field.Property function) {
super(method);
this.function = function;
Dynamic runtime = method.getAnnotation(Dynamic.class);
if (runtime == null) {
throw new HeaderDefinitionError(method.getDeclaringClass(),
"unable get field's annotated runtime");
}
if (runtime.field().length() != 0) {
this.field = runtime.field();
} else {
this.field = guessFieldName(method.getName());
}
}