protected void createAndAdd ( Model model , String id , String localName ) { BioPAXElement bpe = this . getFactory ( ) . create ( localName , id ) ; if ( log . isTraceEnabled ( ) ) { log . trace ( "id:" + id + " " + localName + " : " + bpe ) ; } /* null might occur here, * so the following is to prevent the NullPointerException * and to continue the model assembling. */ if ( bpe != null ) { model . add ( bpe ) ; } else { log . warn ( "null object created during reading. It might not be an official BioPAX class.ID: " + id + " Class " + "name " + localName ) ; } }
This method is called by the reader for each OWL instance in the OWL model . It creates a POJO instance with the given id and inserts it into the model . The inserted object is clean in the sense that its properties are not set yet .