dk.vajhoej.record
Class StructInfo

java.lang.Object
  extended by dk.vajhoej.record.StructInfo

public class StructInfo
extends java.lang.Object

Class StructInfo contains information about a native struct needed for reading and/or writing.


Constructor Summary
StructInfo(Endian endianess, Alignment alignment, boolean endpad, java.util.List<FieldInfo> fields, java.lang.Class<?> clz)
          Create instance of StructInfo.
 
Method Summary
static StructInfo analyze(java.lang.Class<?> clz)
          Analyze class.
 Alignment getAlignment()
          Get Alignment.
 Endian getEndianess()
          Get endianess.
 boolean getEndpad()
          Get pad at end.
 java.util.List<FieldInfo> getFields()
          Get fields.
 int getLength()
          Get length of fixed length parts of struct.
 boolean isFixedLength()
          Is this a fixed length struct.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StructInfo

public StructInfo(Endian endianess,
                  Alignment alignment,
                  boolean endpad,
                  java.util.List<FieldInfo> fields,
                  java.lang.Class<?> clz)
           throws RecordException
Create instance of StructInfo.

Parameters:
endianess - byte order for all fields
alignment - alignment for all fields
endpad - pad at end
fields - array of FieldInfo describing all fields
clz - class implementing struct
Throws:
RecordException - if error calculating length information
Method Detail

getEndianess

public Endian getEndianess()
Get endianess.

Returns:
endianess byte order for all fields

getAlignment

public Alignment getAlignment()
Get Alignment.

Returns:
alignment for all fields

getEndpad

public boolean getEndpad()
Get pad at end.

Returns:
pad at end

getFields

public java.util.List<FieldInfo> getFields()
Get fields.

Returns:
fields array of FieldInfo describing all fields

isFixedLength

public boolean isFixedLength()
Is this a fixed length struct.

Returns:
true=fixed length, false=variable length

getLength

public int getLength()
Get length of fixed length parts of struct.

Returns:
length

analyze

public static StructInfo analyze(java.lang.Class<?> clz)
                          throws RecordException
Analyze class.

Parameters:
clz - class to analyze
Returns:
StructInfo for class
Throws:
RecordException - if error calculation length information