public JsonParserBuilder applyAdapter ( JsonHandlerBase a ) { boolean applied = false ; if ( a instanceof ObjectStartHandler ) { objectStartHandler ( ( ObjectStartHandler ) a ) ; applied = true ; } if ( a instanceof ObjectEndHandler ) { objectEndHandler ( ( ObjectEndHandler ) a ) ; applied = true ; } if ( a instanceof ArrayStartHandler ) { arrayStartHandler ( ( ArrayStartHandler ) a ) ; applied = true ; } if ( a instanceof ArrayEndHandler ) { arrayEndHandler ( ( ArrayEndHandler ) a ) ; applied = true ; } if ( a instanceof BooleanHandler ) { booleanHandler ( ( BooleanHandler ) a ) ; applied = true ; } if ( a instanceof NullHandler ) { nullHandler ( ( NullHandler ) a ) ; applied = true ; } if ( a instanceof StringValueHandler ) { stringValueHandler ( ( StringValueHandler ) a ) ; applied = true ; } if ( a instanceof ObjectKeyHandler ) { objectKeyHandler ( ( ObjectKeyHandler ) a ) ; applied = true ; } if ( a instanceof NumberHandler ) { numberHandler ( ( NumberHandler ) a ) ; applied = true ; } if ( a instanceof IntegerHandler ) { integerHandler ( ( IntegerHandler ) a ) ; applied = true ; } if ( a instanceof FloatingHandler ) { floatingHandler ( ( FloatingHandler ) a ) ; applied = true ; } if ( a instanceof ResetHook ) { resetHook ( ( ResetHook ) a ) ; applied = true ; } if ( ! applied ) throw new IllegalArgumentException ( a + " isn't an instance of any handler interface" ) ; return this ; }
Convenient method to apply the adapter which implements several handler interfaces in one call .