Class AmexFields<M>

java.lang.Object
cl.netswitch.iso.amex8583.AmexFields<M>
Type Parameters:
M - the type of the AMEX message.

public class AmexFields<M> extends Object
Definition of all data elements of an AMEX message.
  • Constructor Details

    • AmexFields

      public AmexFields(int maxFieldIndex)
      Constructs a new AmexFields instance.
      Parameters:
      maxFieldIndex - the maximum field index of a message.
      Throws:
      IllegalArgumentException - if maxFieldIndex is negative.
  • Method Details

    • get

      public final AmexField<M,?> get(int index)
      Returns the field indexed by the specified ID.
      Parameters:
      index - the index of the required field.
      Returns:
      the field or null if not defined.
      Throws:
      IndexOutOfBoundsException - if index is out-of-bounds.
    • add

      public final void add(AmexField<M,?> field)
      Adds a field to the collection of fields.
      Parameters:
      field - the field to be added to be collection.
      Throws:
      NullPointerException - if field is null.
      IndexOutOfBoundsException - if field index is out-of-bounds.
      IllegalArgumentException - if field index is already defined.
    • add

      public final void add(AmexField<M,?> field, AmexObfuscate obfuscate)
      Adds a field to the collection of fields with obfuscate option.
      Parameters:
      field - the field to be added to be collection.
      obfuscate - the obfuscate option of the field.
      Throws:
      NullPointerException - if an argument is null.
      IndexOutOfBoundsException - if field index is out-of-bounds.
      IllegalArgumentException - if field index is already defined.
    • writeClass

      public final void writeClass(String name, PrintStream writer)
      Generates a class that implements a message for defined fields.
      Parameters:
      name - the name of the class to be generated.
      writer - the writer used to write the generated class.
      Throws:
      NullPointerException - if an argument is null.
    • writeClass

      public final void writeClass(String name, String dePrefix, PrintStream writer)
      Generates a class that implements a message for defined fields and prefix.
      Parameters:
      name - the name of the class to be generated.
      dePrefix - the data element (DE) prefix (can be null).
      writer - the writer used to write the generated class.
      Throws:
      NullPointerException - if an argument is null.