Class AmexFields<M>
java.lang.Object
cl.netswitch.iso.amex8583.AmexFields<M>
- Type Parameters:
M- the type of the AMEX message.
Definition of all data elements of an AMEX message.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidAdds a field to the collection of fields.final voidadd(AmexField<M, ?> field, AmexObfuscate obfuscate) Adds a field to the collection of fields with obfuscate option.get(int index) Returns the field indexed by the specified ID.final voidwriteClass(String name, PrintStream writer) Generates a class that implements a message for defined fields.final voidwriteClass(String name, String dePrefix, PrintStream writer) Generates a class that implements a message for defined fields and prefix.
-
Constructor Details
-
AmexFields
public AmexFields(int maxFieldIndex) Constructs a newAmexFieldsinstance.- Parameters:
maxFieldIndex- the maximum field index of a message.- Throws:
IllegalArgumentException- ifmaxFieldIndexis negative.
-
-
Method Details
-
get
Returns the field indexed by the specified ID.- Parameters:
index- the index of the required field.- Returns:
- the field or
nullif not defined. - Throws:
IndexOutOfBoundsException- ifindexis out-of-bounds.
-
add
Adds a field to the collection of fields.- Parameters:
field- the field to be added to be collection.- Throws:
NullPointerException- iffieldisnull.IndexOutOfBoundsException- if field index is out-of-bounds.IllegalArgumentException- if field index is already defined.
-
add
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 thefield.- Throws:
NullPointerException- if an argument isnull.IndexOutOfBoundsException- if field index is out-of-bounds.IllegalArgumentException- if field index is already defined.
-
writeClass
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 isnull.
-
writeClass
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 isnull.
-