Package com.thoughtworks.qdox.model

Examples of com.thoughtworks.qdox.model.JavaClass


        parameters.setProperty( "class", "X" );
        final Attribute attribute = new Attribute( "phoenix:mx-proxy",
                                                   parameters );
        final Attribute result =
            interceptor.processClassAttribute(
                new JavaClass( new JavaSource() ),
                attribute );
        assertNotNull( "attribute", result );
        assertEquals( "attribute.name", "mx.proxy", result.getName() );
        assertEquals( "attribute.value", null, result.getValue() );
        assertEquals( "attribute.parameterCount",
View Full Code Here


        throws Exception
    {
        final PhoenixAttributeInterceptor interceptor = new PhoenixAttributeInterceptor();
        final Attribute attribute = new Attribute(
            "phoenix:configuration-schema" );
        final JavaClass javaClass = new JavaClass( new JavaSource() );
        javaClass.setName( "com.biz.MyClass" );
        final JavaMethod method = new JavaMethod();
        method.setParentClass( javaClass );
        final Attribute result =
            interceptor.processMethodAttribute( method, attribute );
        assertNotNull( "attribute", result );
View Full Code Here

        final Properties parameters = new Properties();
        final String type = "BobbaFett";
        parameters.setProperty( "type", type );
        final Attribute attribute = new Attribute(
            "phoenix:configuration-schema", parameters );
        final JavaClass javaClass = new JavaClass( new JavaSource() );
        javaClass.setName( "com.biz.MyClass" );
        final JavaMethod method = new JavaMethod();
        method.setParentClass( javaClass );
        final Attribute result =
            interceptor.processMethodAttribute( method, attribute );
        assertNotNull( "attribute", result );
View Full Code Here

        final PhoenixAttributeInterceptor interceptor = new PhoenixAttributeInterceptor();
        final Properties parameters = new Properties();
        parameters.setProperty( "type", "relax-ng" );
        final Attribute attribute = new Attribute(
            "phoenix:configuration-schema", parameters );
        final JavaClass javaClass = new JavaClass( new JavaSource() );
        javaClass.setName( "com.biz.MyClass" );
        final JavaMethod method = new JavaMethod();
        method.setParentClass( javaClass );
        final Attribute result =
            interceptor.processMethodAttribute( method, attribute );
        assertNotNull( "attribute", result );
View Full Code Here

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

        parameters.setProperty( "name", type );
        final Attribute attribute = new Attribute( "phoenix:mx", parameters );
        final Attribute[] input = new Attribute[]{attribute};
        final Attribute[] attributes =
            interceptor.processClassAttributes(
                new JavaClass( new JavaSource() ), input );
        assertEquals( "attributes.length", 2, attributes.length );
        assertEquals( "attributes[0].name",
                      "dna.service",
                      attributes[ 0 ].getName() );
        assertEquals( "attributes[0].value",
View Full Code Here

     *
     * @param handler
     * @param jClass
     */
    private void outputSuperClassInheritance(ContentHandler handler, JavaClass jClass, int mode) throws SAXException {
        JavaClass superClass = getJavadocSuperClass(jClass);
        if (superClass != null && hasInheritance(jClass, mode)) {
            outputClassInheritance(handler, superClass, mode);
        }
    }
View Full Code Here

        }
        saxEndElement(handler, INHERIT_ELEMENT);
    }

    private boolean hasInheritance(JavaClass jClass, int mode) {
        JavaClass superClass = getJavadocSuperClass(jClass);
        boolean result = false;

        if (superClass != null) {
            switch (mode) {
                case CLASS_INHERITANCE :
                    // Already there!
                    result = true;
                    break;

                case INTERFACE_INHERITANCE :
                    result = superClass.getImplements().length > 0;
                    break;

                case INNERCLASS_INHERITANCE :
                    result = superClass.getInnerClasses().length > 0;
                    break;

                case FIELD_INHERITANCE :
                    result = superClass.getFields().length > 0;
                    break;

                case METHOD_INHERITANCE :
                    Type[] interfaces = jClass.getImplements();
                    for (int i=0; i<interfaces.length && !result; i++) {
                        JavaClass iface = getJavaClass(interfaces[i].getValue());
                        result = iface != null && iface.getMethods().length > 0;
                    }

                case CONSTRUCTOR_INHERITANCE :
                    JavaMethod[] methods = superClass.getMethods();
                    for (int i=0; i<methods.length && !result; i++) {
View Full Code Here

        if (jClass.getFullyQualifiedName().equals(ROOT_CLASSNAME)) {
            // jClass is root class:
            return null;
        }

        JavaClass superClass = null;

        if (!jClass.isInterface()) {
            try {
                // Use QDocx operation to retrieve class:
                superClass = jClass.getSuperJavaClass();
View Full Code Here

    private JavaClass getJavaClass(String className) {
        if (classMap != null && classMap.containsKey(className)) {
            return (JavaClass) classMap.get(className);
        }

        JavaClass jClass = null;
        SourceResolver resolver = null;

        try {
            resolver = (SourceResolver) manager.lookup(SourceResolver.ROLE);
            Source source = resolver.resolveURI(PROTOCOL + className);
View Full Code Here

TOP

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

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.