org.jnetpcap.packet.structure
Class AnnotatedHeaderLengthMethod

java.lang.Object
  extended by org.jnetpcap.packet.structure.AnnotatedMethod
      extended by org.jnetpcap.packet.structure.AnnotatedHeaderLengthMethod

public class AnnotatedHeaderLengthMethod
extends AnnotatedMethod

The Class AnnotatedHeaderLengthMethod.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Field Summary
 
Fields inherited from class org.jnetpcap.packet.structure.AnnotatedMethod
declaringClass, isMapped, method, object
 
Constructor Summary
AnnotatedHeaderLengthMethod(java.lang.Class<? extends JHeader> c, int length, HeaderLength.Type type)
          Instantiates a new annotated header length method.
 
Method Summary
static void clearCache()
          Clear cache.
 int getHeaderLength(JBuffer buffer, int offset)
          Gets the header length.
 java.lang.reflect.Method getMethod()
          Gets the method.
 boolean hasStaticLength()
          Checks for static length.
static AnnotatedHeaderLengthMethod[] inspectClass(java.lang.Class<? extends JHeader> c)
          Inspect annotations within the class for length methods.
 java.lang.String toString()
          To string.
protected  void validateSignature(java.lang.reflect.Method method)
          Validate signature.
 
Methods inherited from class org.jnetpcap.packet.structure.AnnotatedMethod
getMethods, setIsMapped
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AnnotatedHeaderLengthMethod

public AnnotatedHeaderLengthMethod(java.lang.Class<? extends JHeader> c,
                                   int length,
                                   HeaderLength.Type type)
Instantiates a new annotated header length method.

Parameters:
c - the c
length - the length
type - the type
Method Detail

inspectClass

public static AnnotatedHeaderLengthMethod[] inspectClass(java.lang.Class<? extends JHeader> c)
Inspect annotations within the class for length methods.

Parameters:
c - class to inspect
Returns:
array containing length methods for various header "record" sub-structures

getHeaderLength

public int getHeaderLength(JBuffer buffer,
                           int offset)
Gets the header length.

Parameters:
buffer - the buffer
offset - the offset
Returns:
the header length

getMethod

public final java.lang.reflect.Method getMethod()
Gets the method.

Overrides:
getMethod in class AnnotatedMethod
Returns:
the method
See Also:
AnnotatedMethod.getMethod()

hasStaticLength

public boolean hasStaticLength()
Checks for static length.

Returns:
true, if successful

validateSignature

protected void validateSignature(java.lang.reflect.Method method)
Validate signature.

Specified by:
validateSignature in class AnnotatedMethod
Parameters:
method - the method
See Also:
AnnotatedMethod.validateSignature(java.lang.reflect.Method)

clearCache

public static void clearCache()
Clear cache.


toString

public java.lang.String toString()
To string.

Overrides:
toString in class AnnotatedMethod
Returns:
the string
See Also:
AnnotatedMethod.toString()