Logo Search packages:      
Sourcecode: gant version File versions

Object org::codehaus::gant::GantMetaClass::processArgument ( final Object  argument  )  [inline, private]

Process the argument to a depends call. If the parameter is a Closure just process it. If it is a String then do a lookup for the Closure in the binding, and if found process it.

Parameters:
argument The argument.
Returns:
The result of the Closure.

Definition at line 86 of file GantMetaClass.java.

References binding, and processClosure().

Referenced by invokeMethod().

                                                           {
    Object returnObject = null ;
    final String errorReport = "depends called with an argument (" + argument + ") that is not a known target or list of targets." ;
    if ( argument instanceof Closure ) { returnObject = processClosure ( (Closure) argument ) ; }
    else if ( argument instanceof String ) {
      final Object entry = binding.getVariable ( (String) argument ) ;
      if ( ( entry != null ) && ( entry instanceof Closure ) ) { returnObject = processClosure ( (Closure) entry ) ; }
      else { throw new RuntimeException ( errorReport ) ; }
    }
    else { throw new RuntimeException ( errorReport ) ; }
    return returnObject ;
  }


Generated by  Doxygen 1.6.0   Back to index