public < T > T addObject ( T object , NameValuePair ... params ) throws RedmineException { final EntityConfig < T > config = getConfig ( object . getClass ( ) ) ; if ( config . writer == null ) { throw new RuntimeException ( "can't create object: writer is not implemented or is not registered in RedmineJSONBuilder for object " + object ) ; } URI uri = getURIConfigurator ( ) . getObjectsURI ( object . getClass ( ) , params ) ; HttpPost httpPost = new HttpPost ( uri ) ; String body = RedmineJSONBuilder . toSimpleJSON ( config . singleObjectName , object , config . writer ) ; setEntity ( httpPost , body ) ; String response = send ( httpPost ) ; logger . debug ( response ) ; return parseResponse ( response , config . singleObjectName , config . parser ) ; }
Performs an add object request .