package gov.nih.nci.ncicb.xmiinout.domain.bean;


import gov.nih.nci.ncicb.xmiinout.domain.UMLClass;
import gov.nih.nci.ncicb.xmiinout.domain.UMLGeneralization;

import java.util.*;
import org.jdom.*;


public class UMLGeneralizationBean extends JDomDomainObject implements UMLGeneralization {

  private UMLClass subtype, supertype;

  public UMLGeneralizationBean(Element element, UMLClassBean supertype, UMLClassBean subtype) {
    super(element);

    this.subtype = subtype;
    this.supertype = supertype;

    supertype.addGeneralization(this);
    subtype.addGeneralization(this);
  }

  public UMLClass getSubtype() {
    return subtype;
  }

  public UMLClass getSupertype() {
    return supertype;
  }

}
@@ -506,16 +506,326 @@
 rtype;%0A%0A
+    if(subtype == null)%0A      throw new IllegalArgumentException(%22Generalization with Id: %22 + getId() + %22 has invalid subtype. Please correct model.%22);%0A%0A    if(supertype == null)%0A      throw new IllegalArgumentException(%22Generalization with Id: %22 + getId() + %22 has invalid supertype. Please correct model.%22);%0A%0A
     supe

throw runtime exception if either sub or super type is invalid. Better message than nullpointerEx