Results 1 to 4 of 4

Thread: Method ITD javadoc

  1. #1

    Question Method ITD javadoc

    Hi,

    I have created advanced addon and then I created fields and methods in Metadata class.
    This methods and fields will be in *.aj files. ( ITD )

    But I dont know how to add some javadoc comments for them.

    Sample method
    Code:
    private MethodMetadata getSampleMethod() {
            // Specify the desired method name
            JavaSymbolName methodName = new JavaSymbolName("sampleMethod");
            
            // Check if a method with the same signature already exists in the target type
            final MethodMetadata method = methodExists(methodName, new ArrayList<AnnotatedJavaType>());
            if (method != null) {
                // If it already exists, just return the method and omit its generation via the ITD
                return method;
            }
            
            // Define method annotations (none in this case)
            List<AnnotationMetadataBuilder> annotations = new ArrayList<AnnotationMetadataBuilder>();
            
            // Define method throws types (none in this case)
            List<JavaType> throwsTypes = new ArrayList<JavaType>();
            
            // Define method parameter types (none in this case)
            List<AnnotatedJavaType> parameterTypes = new ArrayList<AnnotatedJavaType>();
            
            // Define method parameter names (none in this case)
            List<JavaSymbolName> parameterNames = new ArrayList<JavaSymbolName>();
            
            // Create the method body
            InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder();
            bodyBuilder.appendFormalLine("System.out.println(\"Hello World\");");
            
            // Use the MethodMetadataBuilder for easy creation of MethodMetadata
            MethodMetadataBuilder methodBuilder = new MethodMetadataBuilder(getId(), Modifier.PUBLIC, methodName, JavaType.VOID_PRIMITIVE, parameterTypes, parameterNames, bodyBuilder);
            methodBuilder.setAnnotations(annotations);
            methodBuilder.setThrowsTypes(throwsTypes);
            
            return methodBuilder.build(); // Build and return a MethodMetadata instance
        }
    Any ideas how to add javadoc?

  2. #2

    Default

    Created minor improvment issue at JIRA ROO-3160.

  3. #3
    Join Date
    Jan 2010
    Location
    Mislata - Valencia - Spain
    Posts
    163

    Default

    Add javadoc into ITDs is currently not available because AJ builder API limitations.
    There is an improvement to allow write javadoc into Java files, this is a related improvement.
    Mario Martínez Sánchez
    Project Manager & Software Architect
    --------------------------
    Disid Technologies S.L.
    http://www.disid.com
    --------------------------
    gvNIX
    http://gvnix.googlecode.com
    http://www.gvnix.org

  4. #4

    Default

    Related to ROO-1431 which depends to ROO-635 and that one depends on javaparser issue.

    Pretty tangled skein ...

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •