Package com.thoughtworks.qdox

Examples of com.thoughtworks.qdox.JavaDocBuilder


     *
     * @param paths source lookup paths (may be empty, but not <code>null</code>)
     */
    public ClassSourceLocator(String[] paths) {
        m_sourcePaths = paths;
        m_builder = new JavaDocBuilder();
        m_lookupSet = new HashSet();
    }
View Full Code Here


        return clazz instanceof DynamicJavaClass;
    }

    protected JavaClass createDynamicJavaClass(String className, String packaze, String[] imports, QDoxCapableMetadataProvider metadataProvider) {
        JavaClass retVal = new DynamicJavaClass(className);
        JavaDocBuilder builder = new JavaDocBuilder(metadataProvider.getDocletTagFactory());
        retVal.setParent(createJavaClassParent(builder.getClassLibrary(), packaze, imports));
        retVal.setJavaClassCache(createJavaClassCache(builder, metadataProvider.getMetadata(), retVal));
        return retVal;
    }
View Full Code Here

   */
  @SuppressWarnings("unchecked")
  public AnnotationTestConverter(File[] files, File destDir) {
    m_fileNames= files;
    m_outDir= destDir;
    m_qdox= new JavaDocBuilder();
    Class<IAnnotation>[] annotations= AnnotationHelper.getAllAnnotations();
    m_annotationMap= new HashMap<String, Class<IAnnotation>>(annotations.length);
    JDK14TagFactory factory= new JDK14TagFactory();
    for(Class<IAnnotation> clazz : annotations) {
      m_annotationMap.put(factory.getTagName(clazz), clazz);
View Full Code Here

  private JavaDocBuilder m_docBuilder;
  private String[] m_dirPaths;
  private IAnnotationTransformer m_transformer;

  public JDK14AnnotationFinder(IAnnotationTransformer transformer) {
    m_docBuilder = new JavaDocBuilder();
    m_transformer = transformer;
  }
View Full Code Here

                    getLog().warn( f + " doesn't exist. Ignored it." );
                }
            }
        }

        JavaDocBuilder builder = new JavaDocBuilder();
        builder.getClassLibrary().addClassLoader( getProjectClassLoader() );
        builder.setEncoding( encoding );
        for ( File f : javaFiles )
        {
            if ( !f.getAbsolutePath().toLowerCase( Locale.ENGLISH ).endsWith( ".java" ) && getLog().isWarnEnabled() )
            {
                getLog().warn( "'" + f + "' is not a Java file. Ignored it." );
                continue;
            }

            try
            {
                builder.addSource( f );
            }
            catch ( ParseException e )
            {
                if ( getLog().isWarnEnabled() )
                {
                    getLog().warn( "QDOX ParseException: " + e.getMessage() + ". Can't fix it." );
                }
            }
        }

        return builder.getClasses();
    }
View Full Code Here

        return discoverClasses( encoding, sources );
    }

    protected Map<String, JavaClass> discoverClasses( final String encoding, List<File> sourceDirectories )
    {
        JavaDocBuilder builder = new JavaDocBuilder();
        builder.setEncoding( encoding );

        for ( File source : sourceDirectories )
        {
            builder.addSourceTree( source );
        }

        JavaClass[] javaClasses = builder.getClasses();

        if ( javaClasses == null || javaClasses.length < 1 )
        {
            return Collections.emptyMap();
        }
View Full Code Here

     * @return an array of java class
     */
    @SuppressWarnings( "unchecked" )
    protected JavaClass[] discoverClasses( final PluginToolsRequest request )
    {
        JavaDocBuilder builder = new JavaDocBuilder();
        builder.setEncoding( request.getEncoding() );
       
        MavenProject project = request.getProject();

        for ( String source : (List<String>) project.getCompileSourceRoots() )
        {
            builder.addSourceTree( new File( source ) );
        }

        // TODO be more dynamic
        File generatedPlugin = new File( project.getBasedir(), "target/generated-sources/plugin" );
        if ( !project.getCompileSourceRoots().contains( generatedPlugin.getAbsolutePath() ) )
        {
            builder.addSourceTree( generatedPlugin );
        }

        return builder.getClasses();
    }
View Full Code Here

     * Constructor.
     *
     * @param sourceFiles All the source files to parse.
     */
    public QDoxTemplateSuiteFactory(File... sourceFiles) {
        builder = new JavaDocBuilder();
        try {
            for (File file : sourceFiles) {
                builder.addSource(file);
            }
        } catch (IOException e) {
View Full Code Here

     * Constructor.
     *
     * @param urls All the URLs of source files to parse.
     */
    public QDoxTemplateSuiteFactory(URL... urls) {
        builder = new JavaDocBuilder();
        try {
            for (URL url : urls) {
                builder.addSource(url);
            }
        } catch (IOException e) {
View Full Code Here

  private JavaDocBuilder m_docBuilder;
  private String[] m_dirPaths;
  private IAnnotationTransformer m_transformer;

  public JDK14AnnotationFinder(IAnnotationTransformer transformer) {
    m_docBuilder = new JavaDocBuilder();
    m_transformer = transformer;
  }
View Full Code Here

TOP

Related Classes of com.thoughtworks.qdox.JavaDocBuilder

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.