public IConstructorType getConstructorType( IType classBean, Expression[] eArgs, List<IConstructorType> listAllMatchingMethods, ParserBase parserState ) throws ParseException
  {
    if( classBean == null )
    {
      throw new ParseException( parserState == null ? null : parserState.makeFullParserState(), Res.MSG_BEAN_CLASS_IS_NULL );
    }

    if( ErrorType.shouldHandleAsErrorType( classBean ) )
    {
      return ErrorType.getInstance().getErrorTypeConstructorType( eArgs, listAllMatchingMethods );
    }

    if( classBean instanceof TypeVariableType )
    {
      // Using dynamic ctor so any params are legal in call e.g., new T( a, b, c ) // this call is not verified until runtime

      IType[] paramTypes = new IType[eArgs == null ? 0 : eArgs.length];
      for( int i = 0; i < paramTypes.length; i++ )
      {
        paramTypes[i] = eArgs[i].getType();
      }
      ConstructorType ctorType = new ConstructorType( new DynamicConstructorInfo( classBean.getTypeInfo(), paramTypes ) );
      if( listAllMatchingMethods != null )
      {
        listAllMatchingMethods.add( ctorType );
      }
      return ctorType;
    }

    ITypeInfo typeInfo = classBean.getTypeInfo();
    if( typeInfo != null )
    {
      List<? extends IConstructorInfo> constructors;
      if( typeInfo instanceof IRelativeTypeInfo )
      {
        while( classBean instanceof ITypeVariableType )
        {
          classBean = ((ITypeVariableType)classBean).getBoundingType();
        }
        constructors = ((IRelativeTypeInfo)typeInfo).getConstructors( classBean );
      }
      else
      {
        constructors = typeInfo.getConstructors();
      }

      for( IConstructorInfo constructor : constructors )
      {
        if( typeInfo instanceof JavaTypeInfo )
        {
          if( constructor.isPrivate() )
          {
            continue;
          }
        }
        IParameterInfo[] paramTypes = constructor.getParameters();
        if( eArgs == null || paramTypes.length == eArgs.length )
        {
          if( listAllMatchingMethods == null )
          {
            return new ConstructorType( constructor );
          }
          listAllMatchingMethods.add( new ConstructorType( constructor ) );
        }
      }

      if( listAllMatchingMethods != null && listAllMatchingMethods.size() > 0 )
      {
        return listAllMatchingMethods.get( 0 );
      }
    }

    throw new NoCtorFoundException( parserState == null ? null : parserState.makeFullParserState(), TypeSystem.getUnqualifiedClassName( classBean ), eArgs == null ? 0 : eArgs.length );
  }
public IConstructorType getConstructorType ( IType classBean , Expression [ ] eArgs , List < IConstructorType > listAllMatchingMethods , ParserBase parserState ) throws ParseException { if ( classBean == null ) { throw new ParseException ( parserState == null ? null : parserState . makeFullParserState ( ) , Res . MSG_BEAN_CLASS_IS_NULL ) ; } if ( ErrorType . shouldHandleAsErrorType ( classBean ) ) { return ErrorType . getInstance ( ) . getErrorTypeConstructorType ( eArgs , listAllMatchingMethods ) ; } if ( classBean instanceof TypeVariableType ) { IType [ ] paramTypes = new IType [ eArgs == null ? 0 : eArgs . length ] ; for ( int i = 0 ; i < paramTypes . length ; i ++ ) { paramTypes [ i ] = eArgs [ i ] . getType ( ) ; } ConstructorType ctorType = new ConstructorType ( new DynamicConstructorInfo ( classBean . getTypeInfo ( ) , paramTypes ) ) ; if ( listAllMatchingMethods != null ) { listAllMatchingMethods . add ( ctorType ) ; } return ctorType ; } ITypeInfo typeInfo = classBean . getTypeInfo ( ) ; if ( typeInfo != null ) { List < ? extends IConstructorInfo > constructors ; if ( typeInfo instanceof IRelativeTypeInfo ) { while ( classBean instanceof ITypeVariableType ) { classBean = ( ( ITypeVariableType ) classBean ) . getBoundingType ( ) ; } constructors = ( ( IRelativeTypeInfo ) typeInfo ) . getConstructors ( classBean ) ; } else { constructors = typeInfo . getConstructors ( ) ; } for ( IConstructorInfo constructor : constructors ) { if ( typeInfo instanceof JavaTypeInfo ) { if ( constructor . isPrivate ( ) ) { continue ; } } IParameterInfo [ ] paramTypes = constructor . getParameters ( ) ; if ( eArgs == null || paramTypes . length == eArgs . length ) { if ( listAllMatchingMethods == null ) { return new ConstructorType ( constructor ) ; } listAllMatchingMethods . add ( new ConstructorType ( constructor ) ) ; } } if ( listAllMatchingMethods != null && listAllMatchingMethods . size ( ) > 0 ) { return listAllMatchingMethods . get ( 0 ) ; } } throw new NoCtorFoundException ( parserState == null ? null : parserState . makeFullParserState ( ) , TypeSystem . getUnqualifiedClassName ( classBean ) , eArgs == null ? 0 : eArgs . length ) ; }
Get the type of the method specified in the member path.

@param classBean   The declaring class of the constructor.
@param parserState The parserState that may be involved in the process of parsing a constructor. Can be null.
@return A Gosu type for the constructor.