Package com.thoughtworks.qdox.model

Examples of com.thoughtworks.qdox.model.Type


         throw new Exception(message + " Number of exceptions should be equal");
      }

      for (int j = 0; j < expectedExceptions.size(); j++)
      {
         Type expectedException = (Type)expectedExceptions.get(j);
         Type actualException = (Type)actualExceptions.get(j);

         if (expectedException.equals(actualException) == false)
         {
            throw new Exception("Exception " + expectedException + " and " + actualException + " should be equal for method " + expected);
         }
View Full Code Here


     */
    public static String[] getJavaMethodParametersAsStringArray(final JavaMethod method) {
        JavaParameter[] javaParameters = method.getParameters();
        String[] parameters = new String[javaParameters.length];
        for (int i = 0; i < javaParameters.length; i++) {
            Type type = javaParameters[i].getType();
            int dimensions = type.getDimensions();
            StringBuffer parameter = new StringBuffer(type.getValue());
            for (int j = 0; j < dimensions; j++) {
                parameter.append("[]");
            }
            parameters[i] = parameter.toString();
        }
View Full Code Here

                for( int i = 0; i < parts.length - 1; ++i ) {
                    String className = getNamePrefix( i );
                    String typeName = classParent.resolveType( className );

                    if( typeName != null ) {
                        Type type = Type.createUnresolved( typeName, 0, classParent );
                        JavaClass javaClass = type.getJavaClass();

                        if( javaClass != null ) {
                            fieldIndex = i + 1;
                            field = resolveField( javaClass, i + 1, parts.length - 1 );
                            break;
View Full Code Here

        // interfaces
        List interfaceList = new ArrayList();
        Type[] interfaces = javaClass.getImplements();
        for (int i = 0; i < interfaces.length; i++) {
            Type anInterface = interfaces[i];
            interfaceList.add(createInterfaceMetaData(anInterface));
        }
        classMetaData.setInterfaces(interfaceList);

        // super class
View Full Code Here

        MethodMetaData data = new MethodMetaData();
        data.setName(method.getName());
        data.setModifiers(TransformationUtil.getModifiersAsInt(method.getModifiers()));

        Type returnType = method.getReturns();
        if (returnType != null) {
            data.setReturnType(TypeConverter.convertTypeToJava(returnType));
        }

        JavaParameter[] parameters = method.getParameters();
View Full Code Here

        // interfaces
        List interfaceList = new ArrayList();
        Type[] interfaces = javaClass.getImplements();
        for (int i = 0; i < interfaces.length; i++) {
            Type anInterface = interfaces[i];
            interfaceList.add(createInterfaceMetaData(anInterface));
        }
        classMetaData.setInterfaces(interfaceList);

        // super class
View Full Code Here

        MethodMetaData data = new MethodMetaData();
        data.setName(method.getName());
        data.setModifiers(TransformationUtil.getModifiersAsInt(method.getModifiers()));

        Type returnType = method.getReturns();
        if (returnType != null) {
            data.setReturnType(TypeConverter.convertTypeToJava(returnType));
        }

        JavaParameter[] parameters = method.getParameters();
View Full Code Here

     *
     * @return The last <code>Throwable</code> parameter, if there is any.
     */
    public JavaParameter getThrowable() {
        JavaParameter[] parameters = javaMethod.getParameters();
        Type throwable = new Type(Throwable.class.getName());
        for (int i = parameters.length - 1; i >= 0; i--) {
            if (parameters[i].getType().isA(throwable)) {
                return parameters[i];
            }
        }
View Full Code Here

        }
        if ( fixTag( THROWS_TAG ) && javaMethod.getExceptions() != null && javaMethod.getExceptions().length > 0 )
        {
            for ( int i = 0; i < javaMethod.getExceptions().length; i++ )
            {
                Type exception = javaMethod.getExceptions()[i];

                separatorAdded = appendDefaultThrowsTag( sb, indent, separatorAdded, exception );
            }
        }
        if ( fixTag( SINCE_TAG ) && isNewMethodFromLastRevision( javaMethod ) )
View Full Code Here

        if ( javaMethod.getExceptions() != null )
        {
            for ( int j = 0; j < javaMethod.getExceptions().length; j++ )
            {
                Type exception = javaMethod.getExceptions()[j];

                if ( exception.getValue().endsWith( exceptionClassName ) )
                {
                    originalJavadocTag =
                        StringUtils.replace( originalJavadocTag, exceptionClassName, exception.getValue() );
                    if ( StringUtils.removeDuplicateWhitespace( originalJavadocTag ).trim().endsWith(
                        "@" + THROWS_TAG + " " + exception.getValue() ) )
                    {
                        originalJavadocTag += " if any.";
                    }

                    sb.append( originalJavadocTag );

                    // added qualified name
                    javaEntityTags.putJavadocThrowsTag( exception.getValue(), originalJavadocTag );

                    return;
                }
            }
        }
View Full Code Here

TOP

Related Classes of com.thoughtworks.qdox.model.Type

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.