Package com.thoughtworks.qdox.model

Examples of com.thoughtworks.qdox.model.JavaSource


        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 );
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 );
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 );
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

        // 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

      // Try to extract parameter descriptions from JavaDoc in source file
      if (sourceFile != null) {
        getLog().info("Enhancing class [" + clazzName + "]");

        // Parse source file so we can extract the JavaDoc
        JavaSource ast = parseSource(sourceFile);

        // Enhance meta data
        enhanceResourceMetaData(ast, clazz, ctClazz, reportData);

        // Enhance configuration parameters
View Full Code Here

    assertEquals("Documentation for value 5", doc);
  }

  private String getJavadoc(String aParameter, String aNameConstant) throws IOException {
    // Create the Java parser and parse the source code into an abstract syntax tree
    JavaSource source = Util.parseSource("src/test/resources/TestComponent.java", "UTF-8");
   
    return Util.getParameterDocumentation(source, aParameter, aNameConstant);
  }
View Full Code Here

public class ComponentDescriptionExtractorTest {

  @Test
  public void test() throws Exception {
    // Create the Java parser and parse the source code into an abstract syntax tree
    JavaSource source = Util.parseSource("src/test/resources/TestComponent.java", "UTF-8");

    String javadoc = Util.getComponentDocumentation(source, "some.test.mypackage.TestComponent");

    assertEquals("A test component used to test JavadocTextExtractor.", javadoc);
  }
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.