Package org.jnetpcap.packet.annotate

Examples of org.jnetpcap.packet.annotate.Dynamic


   * @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;
        }
View Full Code Here


   *          the method
   * @return the annotated field method
   */
  public static AnnotatedFieldMethod inspectMethod(Method method) {

    Dynamic runtime = method.getAnnotation(Dynamic.class);

    Field.Property function = runtime.value();
    switch (function) {
      case LENGTH:
      case OFFSET:
        checkSignature(method, int.class);
        return new IntFunction(method, function);
View Full Code Here

   */
  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());
    }
  }
View Full Code Here

TOP

Related Classes of org.jnetpcap.packet.annotate.Dynamic

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.