Package com.thoughtworks.qdox.model

Examples of com.thoughtworks.qdox.model.JavaMethod


        throws Exception
    {
        final DNAAttributeInterceptor interceptor = new DNAAttributeInterceptor();
        final Attribute attribute = new Attribute( "ignored" );
        final Attribute result =
            interceptor.processMethodAttribute( new JavaMethod(), attribute );
        assertNotNull( "attribute", result );
        assertEquals( "attribute.name", "ignored", result.getName() );
        assertEquals( "attribute.value", null, result.getValue() );
        assertEquals( "attribute.parameterCount", 0, result.getParameterCount() );
    }
View Full Code Here


        final DNAAttributeInterceptor interceptor = new DNAAttributeInterceptor();

        final MockJavaClass clazz = new MockJavaClass();
        clazz.setName( "Blah" );

        final JavaMethod javaMethod = new JavaMethod();
        javaMethod.setParentClass( clazz );
        final Attribute attribute = new Attribute( "dna.configuration" );
        final Attribute result =
            interceptor.processMethodAttribute( javaMethod, attribute );
        assertNotNull( "attribute", result );
        assertEquals( "attribute.name", "dna.configuration", result.getName() );
View Full Code Here

        final DNAAttributeInterceptor interceptor = new DNAAttributeInterceptor();

        final MockJavaClass clazz = new MockJavaClass();
        clazz.setName( "Blah" );

        final JavaMethod javaMethod = new JavaMethod();
        javaMethod.setParentClass( clazz );
        final Attribute attribute = new Attribute( "dna.parameters" );
        final Attribute result =
            interceptor.processMethodAttribute( javaMethod, attribute );
        assertNotNull( "attribute", result );
        assertEquals( "attribute.name", "dna.parameters", result.getName() );
View Full Code Here

        final DNAAttributeInterceptor interceptor = new DNAAttributeInterceptor();
        final Properties parameters = new Properties();
        parameters.setProperty( "type", "Foo" );
        parameters.setProperty( "optional", "true" );
        final Attribute attribute = new Attribute( "dna.dependency", parameters );
        final JavaMethod method = new JavaMethod();
        method.setParentClass( new MockJavaClass() );
        final Attribute result =
            interceptor.processMethodAttribute( method, attribute );
        assertNotNull( "attribute", result );
        assertEquals( "attribute.name", "dna.dependency", result.getName() );
        assertEquals( "attribute.value", null, result.getValue() );
View Full Code Here

        throws Exception
    {
        final DNAAttributeInterceptor interceptor = new DNAAttributeInterceptor();
        final Properties parameters = new Properties();
        final Attribute attribute = new Attribute( "dna.dependency", parameters );
        final JavaMethod method = new JavaMethod();
        method.setParentClass( new MockJavaClass() );
        try
        {
            interceptor.processMethodAttribute( method, attribute );
        }
        catch( final IllegalArgumentException iae )
View Full Code Here

    {
        final DNAAttributeInterceptor interceptor = new DNAAttributeInterceptor();
        final Properties parameters = new Properties();
        parameters.setProperty( "type", "Foo" );
        final Attribute attribute = new Attribute( "dna.dependency", parameters );
        final JavaMethod method = new JavaMethod();
        method.setParentClass( new MockJavaClass() );
        final Attribute result =
            interceptor.processMethodAttribute( method, attribute );
        assertNotNull( "attribute", result );
        assertEquals( "attribute.name", "dna.dependency", result.getName() );
        assertEquals( "attribute.value", null, result.getValue() );
View Full Code Here

            }
        };
    }

    private FactoryMethod enhance(FactoryMethod factoryMethod) {
        JavaMethod methodSource = findMethodInSource(factoryMethod);
        if (methodSource != null) {
            factoryMethod.setJavaDoc(createJavaDocComment(methodSource));
            JavaParameter[] parametersFromSource
                    = methodSource.getParameters();
            List<FactoryMethod.Parameter> parametersFromReflection
                    = factoryMethod.getParameters();

            if (parametersFromReflection.size() == parametersFromSource.length) {
                for (int i = 0; i < parametersFromSource.length; i++) {
View Full Code Here

    JavaClass jc = getClassByName(methodClass);
    if (jc != null) {
      List<JavaMethod> methods = new ArrayList<JavaMethod>();
      JavaMethod[] allMethods = jc.getMethods();
      for (int i = 0; i < allMethods.length; i++) {
        JavaMethod jm = allMethods[i];
        if (methodsAreEqual(jm, methodName, parameterTypes)) {
          methods.add(jm);
        }
      }
     
      JavaMethod method = null;
//      if (methods.size() > 1) {
//        ppp("WARNING:  method " + methodName + " is overloaded, only considering the first one");
//      }
     
      if (methods.size() > 0) {
View Full Code Here

        {
            StringBuilder msg = new StringBuilder();
            msg.append( "No param '" ).append( paramName ).append( "' key found in " + mapName + " for the entity: " );
            if ( isJavaMethod )
            {
                JavaMethod javaMethod = (JavaMethod) entity;
                msg.append( getJavaMethodAsString( javaMethod ) );
            }
            else
            {
                JavaClass javaClass = (JavaClass) entity;
View Full Code Here

                // fixing methods
                if ( javaClass.getMethods() != null )
                {
                    for ( int i = 0; i < javaClass.getMethods().length; i++ )
                    {
                        JavaMethod method = javaClass.getMethods()[i];

                        if ( lineNumber == method.getLineNumber() )
                        {
                            fixMethodComment( stringWriter, originalContent, method, indent );

                            takeCareSingleComment( stringWriter, originalContent, method );
                        }
View Full Code Here

TOP

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

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.