public static boolean isImplicit ( ArgumentUnit argumentUnit ) throws IllegalStateException { // is the implicit flag set? String implicitProperty = ArgumentUnitUtils . getProperty ( argumentUnit , ArgumentUnitUtils . PROP_KEY_IS_IMPLICIT ) ; // is the length really zero? int length = argumentUnit . getEnd ( ) - argumentUnit . getBegin ( ) ; boolean zeroSize = length == 0 ; if ( implicitProperty != null && Boolean . valueOf ( implicitProperty ) && zeroSize ) { return true ; } if ( implicitProperty == null && ! zeroSize ) { return false ; } throw new IllegalStateException ( "argumentUnit is inconsistent. 'implicit' flag: " + implicitProperty + ", but length: " + length ) ; }
Returns true is the argumentUnit length is 0 and flag is set to implicit . If length is greater than zero and flag is not set to implicit returns false . In any other case throws an exception