org.jnetpcap.packet.structure
Class AnnotatedField

java.lang.Object
  extended by org.jnetpcap.packet.structure.AnnotatedField

public class AnnotatedField
extends java.lang.Object

The Class AnnotatedField.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Constructor Summary
AnnotatedField(java.lang.String name, Field enumAnnotation, java.util.Map<Field.Property,AnnotatedFieldMethod> methods, java.lang.Class<?> declaringClass)
          Instantiates a new annotated field.
 
Method Summary
 void addSubField(AnnotatedField field)
          Adds the sub field.
 void finishProcessing(java.util.List<HeaderDefinitionError> errors)
          Finish processing.
 java.lang.Class<?> getDeclaringClass()
          Gets the declaring class.
 java.lang.String getDescription()
          Gets the description.
 java.lang.String getDisplay()
          Gets the display.
 java.lang.String getFormat()
          Gets the format.
 int getLength()
          Gets the length.
 long getMask()
          Gets the mask.
 java.lang.reflect.Method getMethod()
          Gets the method.
 java.lang.String getName()
          Gets the name.
 java.lang.String getNicname()
          Gets the nicname.
 int getOffset()
          Gets the offset.
 java.lang.String getParent()
          Gets the parent.
 JFormatter.Priority getPriority()
          Gets the priority.
 AnnotatedFieldRuntime getRuntime()
          Gets the runtime.
 JFormatter.Style getStyle()
          Gets the style.
 java.util.List<AnnotatedField> getSubFields()
          Gets the sub fields.
 java.lang.String getUnits()
          Gets the units.
static AnnotatedField inspectEnumConstant(java.lang.String field, Field enumAnnotation, java.util.Map<Field.Property,AnnotatedFieldMethod> methods, java.lang.Class<?> c)
          Inspect enum constant.
static AnnotatedField inspectMethod(java.lang.Class<? extends JHeader> c, java.lang.reflect.Method m)
          Inspect method.
 boolean isSubField()
          Checks if is sub field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotatedField

public AnnotatedField(java.lang.String name,
                      Field enumAnnotation,
                      java.util.Map<Field.Property,AnnotatedFieldMethod> methods,
                      java.lang.Class<?> declaringClass)
Instantiates a new annotated field.

Parameters:
name - the name
enumAnnotation - the enum annotation
methods - the methods
declaringClass - the declaring class
Method Detail

inspectEnumConstant

public static AnnotatedField inspectEnumConstant(java.lang.String field,
                                                 Field enumAnnotation,
                                                 java.util.Map<Field.Property,AnnotatedFieldMethod> methods,
                                                 java.lang.Class<?> c)
Inspect enum constant.

Parameters:
field - the field
enumAnnotation - the enum annotation
methods - the methods
c - the c
Returns:
the annotated field

inspectMethod

public static AnnotatedField inspectMethod(java.lang.Class<? extends JHeader> c,
                                           java.lang.reflect.Method m)
Inspect method.

Parameters:
c - the c
m - the m
Returns:
the annotated field

addSubField

public void addSubField(AnnotatedField field)
Adds the sub field.

Parameters:
field - the field

finishProcessing

public void finishProcessing(java.util.List<HeaderDefinitionError> errors)
Finish processing.

Parameters:
errors - the errors

getDeclaringClass

public java.lang.Class<?> getDeclaringClass()
Gets the declaring class.

Returns:
the declaring class

getDescription

public java.lang.String getDescription()
Gets the description.

Returns:
the description

getDisplay

public final java.lang.String getDisplay()
Gets the display.

Returns:
the display

getFormat

public final java.lang.String getFormat()
Gets the format.

Returns:
the format

getLength

public int getLength()
Gets the length.

Returns:
the length

getMask

public long getMask()
Gets the mask.

Returns:
the mask

getMethod

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

Returns:
the method

getName

public final java.lang.String getName()
Gets the name.

Returns:
the name

getNicname

public final java.lang.String getNicname()
Gets the nicname.

Returns:
the nicname

getOffset

public int getOffset()
Gets the offset.

Returns:
the offset

getParent

public java.lang.String getParent()
Gets the parent.

Returns:
the parent

getPriority

public JFormatter.Priority getPriority()
Gets the priority.

Returns:
the priority

getRuntime

public final AnnotatedFieldRuntime getRuntime()
Gets the runtime.

Returns:
the runtime

getStyle

public JFormatter.Style getStyle()
Gets the style.

Returns:
the style

getSubFields

public java.util.List<AnnotatedField> getSubFields()
Gets the sub fields.

Returns:
the sub fields

getUnits

public java.lang.String getUnits()
Gets the units.

Returns:
the units

isSubField

public boolean isSubField()
Checks if is sub field.

Returns:
true, if is sub field