3 Replies Latest reply on Oct 29, 2009 5:58 PM by Darrell Loverin

    ConfigurationInfo argcount

    Marvin Velo Level 1

      Hi,

       

      What is the meaning of negative values on flex2.compiler.config.ConfigurationInfo.argcount ?

       

      I saw it being assigned with -1 and -2 values.... I assume -1 is an array like... but what about -2?  Is there a -3, -4, -X that I should be aware also?

       

       

      VELO

        • 1. Re: ConfigurationInfo argcount
          Darrell Loverin Level 4

          If argcount equals -1 it means there is a list of items

             argcount equal -2 means a specific argcount has not been specified in the constructor. Later on the number of arguments is determined.

           

          There are no -3, -4, ... argcounts.

          1 person found this helpful
          • 2. Re: ConfigurationInfo argcount
            Marvin Velo Level 1

            Ok, about this -2 .... later when?  Is there anyway to retrieve this information?

             

            For instance:

                 public static ConfigurationInfo getRuntimeSharedLibraryPathInfo()
                 {
                      return new ConfigurationInfo()
                      {
                           public boolean allowMultiple()
                           {
                                return true;
                           }
            
                           public String[] getSoftPrerequisites()
                           {
                                return new String[] {"static-link-runtime-shared-libraries"};
                           }
            
                           public String getArgName(int argnum)
                           {
                                String argName = null;
                                
                                if (argnum == 0) 
                                {
                                     argName = "path-element";
                                }
                                else 
                                {
                                     argnum = (argnum + 1) % 2;
                                     if (argnum == 0)
                                     {
                                          argName = "rsl-url";
                                     }
                                     else 
                                     {
                                          argName = "policy-file-url";
                                     }
                                }
                                return argName;
                           }
                           
                           public boolean doChecksum()
                           {
                                return false;
                           }
                      };
                 }
            
             
            

             

            The argcount is never defined here, I wonder is there is any way to interpolate this value.....

             

             

            VELO

            • 3. Re: ConfigurationInfo argcount
              Darrell Loverin Level 4

              See ConfigurationInfo.setSetterMethod. Set a breakpoint on the "argcount = -1;" line.

               

                 protected final void setSetterMethod( Method setter )

                  {

                      Class[] pt = setter.getParameterTypes();

               

                      assert ( pt.length >= 2 ) : ( "coding error: config setter must take at least 2 args!" );

               

                      this.setter = setter;

               

                      if (pt.length == 2)

                      {

                          Class c = pt[1];

               

                          if (ConfigurationBuffer.isSupportedListType( c ))

                          {

                              if (argcount == -2)

                                  argcount = -1;      // infinite list

               

                              argtypes = new Class[] {String.class};

                              return;

                          }