Package com.thoughtworks.qdox.model

Examples of com.thoughtworks.qdox.model.JavaMethod


        parameters.setProperty( "name", type );
        parameters.setProperty( "role", key );
        final Attribute attribute = new Attribute( "phoenix:dependency",
                                                   parameters );
        final Attribute result =
            interceptor.processMethodAttribute( new JavaMethod(), attribute );
        assertNotNull( "attribute", result );
        assertEquals( "attribute.name", "dna.dependency", result.getName() );
        assertEquals( "attribute.value", null, result.getValue() );
        assertEquals( "attribute.parameterCount",
                      2,
View Full Code Here


    {
        final PhoenixAttributeInterceptor interceptor = new PhoenixAttributeInterceptor();
        final Attribute[] input = new Attribute[]{
            new Attribute( "RandomJAttribute" )};
        final Attribute[] attributes =
            interceptor.processMethodAttributes( new JavaMethod(), input );
        assertEquals( "attributes.length", 1, attributes.length );
        assertEquals( "attributes[0].name",
                      "RandomJAttribute",
                      attributes[ 0 ].getName() );
        assertEquals( "attributes[0].value",
View Full Code Here

    {
        final PhoenixAttributeInterceptor interceptor = new PhoenixAttributeInterceptor();
        final Attribute[] input = new Attribute[]{
            new Attribute( "mx.operation" )};
        final Attribute[] attributes =
            interceptor.processMethodAttributes( new JavaMethod(), input );
        assertEquals( "attributes.length", 1, attributes.length );
        assertEquals( "attributes[0].name",
                      "mx.operation",
                      attributes[ 0 ].getName() );
        assertEquals( "attributes[0].value",
View Full Code Here

        final PhoenixAttributeInterceptor interceptor = new PhoenixAttributeInterceptor();
        final Attribute[] input =
            new Attribute[]{new Attribute( "mx.operation" ),
                            new Attribute( "param", "var" )};
        final Attribute[] attributes =
            interceptor.processMethodAttributes( new JavaMethod(), input );
        assertEquals( "attributes.length", 2, attributes.length );
        assertEquals( "attributes[0].name",
                      "mx.operation",
                      attributes[ 0 ].getName() );
        assertEquals( "attributes[0].value",
View Full Code Here

        final Attribute[] input =
            new Attribute[]{new Attribute( "mx.operation" ),
                            new Attribute( "param",
                                           "var This is the description" )};
        final Attribute[] attributes =
            interceptor.processMethodAttributes( new JavaMethod(), input );
        assertEquals( "attributes.length", 3, attributes.length );
        assertEquals( "attributes[0].name",
                      "mx.operation",
                      attributes[ 0 ].getName() );
        assertEquals( "attributes[0].value",
View Full Code Here

                first = attrs;
            }
            current = first;
            for (Iterator it = m_methodAttributes.iterator(); it.hasNext();) {
                MethodAttributeInfo struct = (MethodAttributeInfo) it.next();
                JavaMethod method = struct.method;
                if (name.equals("<init>")) {
                    continue;
                }
                String[] parameters = QDoxParser.getJavaMethodParametersAsStringArray(method);
                if (name.equals(method.getName()) && Arrays.equals(parameters, DescriptorUtil.getParameters(desc))) {
                    if (first == null) {
                        first = new CustomAttribute(((byte[]) struct.attribute));
                        current = first;
                    } else {
                        current.next = new CustomAttribute(((byte[]) struct.attribute));
                        ;
                        current = current.next;
                    }
                }
            }
            for (Iterator it = m_constructorAttributes.iterator(); it.hasNext();) {
                MethodAttributeInfo struct = (MethodAttributeInfo) it.next();
                JavaMethod method = struct.method;
                String[] parameters = QDoxParser.getJavaMethodParametersAsStringArray(method);
                if (name.equals("<init>") && Arrays.equals(parameters, DescriptorUtil.getParameters(desc))) {
                    if (first == null) {
                        first = new CustomAttribute(((byte[]) struct.attribute));
                        current = first;
View Full Code Here

                if (enhancer.initialize(clazz.getFullyQualifiedName(), classPath)) {
                    handleClassAnnotations(enhancer, clazz);
                    //handleInnerClassAnnotations(enhancer, clazz, destDir);
                    JavaMethod[] methods = clazz.getMethods();
                    for (int j = 0; j < methods.length; j++) {
                        JavaMethod method = methods[j];
                        if (method.isConstructor()) {
                            handleConstructorAnnotations(enhancer, method);
                        } else {
                            handleMethodAnnotations(enhancer, method);
                        }
                    }
View Full Code Here

                if (enhancer.initialize(clazz.getFullyQualifiedName(), classPath)) {
                    handleClassAnnotations(manager, enhancer, clazz);
                    handleInnerClassAnnotations(manager, enhancer, clazz, classPath, destDir);
                    JavaMethod[] methods = clazz.getMethods();
                    for (int j = 0; j < methods.length; j++) {
                        JavaMethod method = methods[j];
                        if (method.isConstructor()) {
                            handleConstructorAnnotations(manager, enhancer, method);
                        } else {
                            handleMethodAnnotations(manager, enhancer, method);
                        }
                    }
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

            }
        };
    }

    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

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.