public final void addField ( final SgField field ) { if ( field == null ) { throw new IllegalArgumentException ( "The argument 'field' cannot be null!" ) ; } if ( field . getOwner ( ) != this ) { throw new IllegalArgumentException ( "The owner of 'field' is different from 'this'!" ) ; } if ( ! fields . contains ( field ) ) { fields . add ( field ) ; } }
Adds a field to the class . Does nothing if the field is already in the list of fields . You will never need to use this method in your code! A field is added automatically to the owning class when it s constructed!