Package com.thoughtworks.qdox.model

Examples of com.thoughtworks.qdox.model.JavaSource


       
        // Modifiers:
        outputModifiers(handler, javadocClass);
       
        // Imports:
        JavaSource parent = javadocClass.getParentSource();
        // Add two implicit imports:
        parent.addImport("java.lang.*");
        if (parent.getPackage().length() > 0) {
            parent.addImport(parent.getPackage() + ".*");
        } else {
            parent.addImport("*");
        }
        String[] imports = parent.getImports();
       
        saxStartElement(handler, IMPORTS_ELEMENT);
        for (int i=0; i<imports.length; i++) {
            if (imports[i].endsWith("*")) {
                // package import:
View Full Code Here


        // Modifiers:
        outputModifiers(handler, javadocClass);

        // Imports:
        JavaSource parent = javadocClass.getParentSource();
        // Add two implicit imports:
        parent.addImport("java.lang.*");
        if (parent.getPackage() != null) {
            parent.addImport(parent.getPackage() + ".*");
        } else {
            parent.addImport("*");
        }
        String[] imports = parent.getImports();

        saxStartElement(handler, IMPORTS_ELEMENT);
        for (int i = 0; i < imports.length; i++) {
            if (imports[i].endsWith("*")) {
                // package import:
View Full Code Here

        // Modifiers:
        outputModifiers(handler, javadocClass);

        // Imports:
        JavaSource parent = javadocClass.getParentSource();
        // Add two implicit imports:
        parent.addImport("java.lang.*");
        if (parent.getPackage().length() > 0) {
            parent.addImport(parent.getPackage() + ".*");
        } else {
            parent.addImport("*");
        }
        String[] imports = parent.getImports();

        saxStartElement(handler, IMPORTS_ELEMENT);
        for (int i=0; i<imports.length; i++) {
            if (imports[i].endsWith("*")) {
                // package import:
View Full Code Here

       
        // Modifiers:
        outputModifiers(handler, javadocClass);
       
        // Imports:
        JavaSource parent = javadocClass.getParentSource();
        // Add two implicit imports:
        parent.addImport("java.lang.*");
        if (parent.getPackage().length() > 0) {
            parent.addImport(parent.getPackage() + ".*");
        } else {
            parent.addImport("*");
        }
        String[] imports = parent.getImports();
       
        saxStartElement(handler, IMPORTS_ELEMENT);
        for (int i=0; i<imports.length; i++) {
            if (imports[i].endsWith("*")) {
                // package import:
View Full Code Here

        ModelBuilder unknownBuilder = new ModelBuilder(classLibrary, docletTagFactory);
        ClassDef classDef = new ClassDef();
        classDef.name = name;
        unknownBuilder.beginClass(classDef);
        unknownBuilder.endClass();
        JavaSource unknownSource = unknownBuilder.getSource();
        JavaClass result = unknownSource.getClasses()[0];
        return result;
    }
View Full Code Here

                    addField(fields[i], binaryBuilder);
                }
            }

            binaryBuilder.endClass();
            JavaSource binarySource = binaryBuilder.getSource();
            // There is always only one class in a "binary" source.
            JavaClass result = binarySource.getClasses()[0];
            return result;
        }
    }
View Full Code Here

            parser.parse();
        } catch (ParseException e) {
            e.setSourceInfo(sourceInfo);
            throw e;
        }
        JavaSource source = builder.getSource();
        sources.add(source);
        addClasses(source);
        return source;
    }
View Full Code Here

    public JavaSource addSource(File file) throws IOException, FileNotFoundException {
        return addSource(file.toURL());
    }

    public JavaSource addSource(URL url) throws IOException, FileNotFoundException {
        JavaSource source = addSource(new InputStreamReader(url.openStream(),encoding), url.toExternalForm());
        source.setURL(url);
        return source;
    }
View Full Code Here

     */
    public JavaClass[] getClasses() {
        Set resultSet = new HashSet();
        JavaSource[] javaSources = getSources();
        for (int i = 0; i < javaSources.length; i++) {
            JavaSource javaSource = javaSources[i];
            addClassesRecursive(javaSource, resultSet);
        }
        JavaClass[] result = (JavaClass[]) resultSet.toArray(new JavaClass[resultSet.size()]);
        return result;
    }
View Full Code Here

    public static void assertApiEquals(URL expected, URL actual) throws IOException {
        JavaDocBuilder builder = new JavaDocBuilder();

        builder.addSource(new InputStreamReader(expected.openStream()), expected.toExternalForm());
        builder.addSource(new InputStreamReader(actual.openStream()), actual.toExternalForm());
        JavaSource expectedSource = builder.getSources()[0];
        JavaSource actualsource = builder.getSources()[1];

        assertApiEquals(expectedSource, actualsource);
    }
View Full Code Here

TOP

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

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.