"a new transient %s", this.entity.getSimpleTypeName()), null); commentStructure.addComment(comment, CommentLocation.BEGINNING); method.setCommentStructure(commentStructure);
"https://vladmihalcea.com/2016/06/06/how-to-implement-equals-and-hashcode-using-the-jpa-entity-identifier/")), CommentLocation.BEGINNING); methodBuilder.setCommentStructure(commentStructure);
methodBuilder.setCommentStructure(commentStructure);
methodMetadataBuilder.setCommentStructure(JavadocComment.create("Gets %s value\n%s", fieldName, fieldJavaDoc)); } else { methodMetadataBuilder .setCommentStructure(JavadocComment.create("Gets %s value", fieldName));
"https://vladmihalcea.com/2016/06/06/how-to-implement-equals-and-hashcode-using-the-jpa-entity-identifier/")), CommentLocation.BEGINNING); methodBuilder.setCommentStructure(commentStructure);
methodMetadataBuilder.setCommentStructure(JavadocComment.create(" Sets %s value\n%s", fieldName, fieldJavaDoc)); } else { methodMetadataBuilder .setCommentStructure(JavadocComment.create("Sets %s value", fieldName));
commentStructure.addComment(new JavadocComment(description, paramInfo, null, null), CommentLocation.BEGINNING); methodBuilder.setCommentStructure(commentStructure);
methodBuilder.setCommentStructure(commentStructure);
"%1$s the generated transient {@link %1$s}", this.entity.getSimpleTypeName()), null); comment.addComment(javadocComment, CommentLocation.BEGINNING); methodBuilder.setCommentStructure(comment);
/** * This method returns the getXmlIdentityInfo() method. * * @return MethodMetadata that contains the getXmlIdentityInfoMethod */ public MethodMetadata getXmlIdentityInfoMethod() { // Check if already exists if (xmlIdentityInfoMethod != null) { return xmlIdentityInfoMethod; } // If not, generate a new one InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder(); // return getClass().getName() + ":" + getId(); bodyBuilder.appendFormalLine(String.format("return getClass().getName() + \":\" + %s();", identifierAccessor.getMethodName())); MethodMetadataBuilder method = new MethodMetadataBuilder(getId(), Modifier.PUBLIC, new JavaSymbolName("getXmlIdentityInfo"), JavaType.STRING, bodyBuilder); method.addAnnotation(new AnnotationMetadataBuilder(JavaType.XML_ID)); AnnotationMetadataBuilder xmlAttributeAnnotation = new AnnotationMetadataBuilder(JavaType.XML_ATTRIBUTE); xmlAttributeAnnotation.addStringAttribute("name", "id"); method.addAnnotation(xmlAttributeAnnotation); CommentStructure comment = new CommentStructure(); comment.addComment(new JavadocComment("Must return an unique ID across all entities"), CommentLocation.BEGINNING); method.setCommentStructure(comment); xmlIdentityInfoMethod = method.build(); return xmlIdentityInfoMethod; }
this.entity.getSimpleTypeName()), null); comment.addComment(javadocComment, CommentLocation.BEGINNING); methodBuilder.setCommentStructure(comment);
"%1$s the specific {@link %1$s}", this.entity.getSimpleTypeName()), null); comment.addComment(javadocComment, CommentLocation.BEGINNING); methodBuilder.setCommentStructure(comment);
/** * This method generates new method instance using an existing * methodMetadata * * @param declaredByMetadataId * @param method * * @return */ private MethodMetadata getNewMethod(String declaredByMetadataId, MethodMetadata method) { // Create bodyBuilder InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder(); bodyBuilder.appendFormalLine(method.getBody()); // Use the MethodMetadataBuilder for easy creation of MethodMetadata // based on existing method MethodMetadataBuilder methodBuilder = new MethodMetadataBuilder(declaredByMetadataId, method.getModifier(), method.getMethodName(), method.getReturnType(), method.getParameterTypes(), method.getParameterNames(), bodyBuilder); methodBuilder.setAnnotations(method.getAnnotations()); // ROO-3834: Including default comment structure during push-in methodBuilder.setCommentStructure(method.getCommentStructure()); return methodBuilder.build(); }
/** * Obtains a method annotated with @After for doing the test class teardown phase * after finishing each test. * * @return {@link MethodMetadataBuilder} */ private MethodMetadataBuilder getCleanMethod() { final InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder(); bodyBuilder.newLine(); bodyBuilder.appendFormalLine("// Clean needed after executing each test method"); bodyBuilder.appendFormalLine("// To be implemented by developer"); bodyBuilder.newLine(); // Use the MethodMetadataBuilder for easy creation of MethodMetadata MethodMetadataBuilder methodBuilder = new MethodMetadataBuilder(getId(), Modifier.PUBLIC, new JavaSymbolName("clean"), JavaType.VOID_PRIMITIVE, bodyBuilder); // Add @After methodBuilder.addAnnotation(new AnnotationMetadataBuilder(AFTER).build()); // Add comment CommentStructure comment = new CommentStructure(); JavadocComment javaDocComment = new JavadocComment( "This method will be automatically executed after each test method for freeing resources allocated with @Before annotated method."); comment.addComment(javaDocComment, CommentLocation.BEGINNING); methodBuilder.setCommentStructure(comment); return methodBuilder; }
commentStructure.addComment(new JavadocComment( "Test method example. To be implemented by developer."), CommentLocation.BEGINNING); methodBuilder.setCommentStructure(commentStructure);
commentStructure.addComment(new JavadocComment( "Test method example. To be implemented by developer."), CommentLocation.BEGINNING); methodBuilder.setCommentStructure(commentStructure);
new JavadocComment("Creates the initial list of generated entities."); comment.addComment(javadocComment, CommentLocation.BEGINNING); methodBuilder.setCommentStructure(comment);
/** * Obtains a method annotated with @After for doing the test class teardown phase * after finishing each test. * * @return {@link MethodMetadataBuilder} */ private MethodMetadataBuilder getCleanMethod() { final InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder(); bodyBuilder.newLine(); bodyBuilder.appendFormalLine("// Clean needed after executing each test method"); bodyBuilder.appendFormalLine("// To be implemented by developer"); bodyBuilder.newLine(); // Use the MethodMetadataBuilder for easy creation of MethodMetadata MethodMetadataBuilder methodBuilder = new MethodMetadataBuilder(getId(), Modifier.PUBLIC, new JavaSymbolName("clean"), JavaType.VOID_PRIMITIVE, bodyBuilder); // Add @After methodBuilder.addAnnotation(new AnnotationMetadataBuilder(AFTER).build()); // Add comment CommentStructure comment = new CommentStructure(); JavadocComment javaDocComment = new JavadocComment( "This method will be automatically executed after each test method for freeing resources allocated with @Before annotated method."); comment.addComment(javaDocComment, CommentLocation.BEGINNING); methodBuilder.setCommentStructure(comment); return methodBuilder; }
/** * Obtains a method annotated with @After for doing the test class teardown phase * after finishing each test. * * @return {@link MethodMetadataBuilder} */ private MethodMetadataBuilder getCleanMethod() { final InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder(); bodyBuilder.newLine(); bodyBuilder.appendFormalLine("// Clean needed after executing each test method"); bodyBuilder.appendFormalLine("// To be implemented by developer"); bodyBuilder.newLine(); // Use the MethodMetadataBuilder for easy creation of MethodMetadata MethodMetadataBuilder methodBuilder = new MethodMetadataBuilder(getId(), Modifier.PUBLIC, new JavaSymbolName("clean"), JavaType.VOID_PRIMITIVE, bodyBuilder); // Add @After methodBuilder.addAnnotation(new AnnotationMetadataBuilder(AFTER).build()); // Add comment CommentStructure comment = new CommentStructure(); JavadocComment javaDocComment = new JavadocComment( "This method will be automatically executed after each test method for freeing resources allocated with @Before annotated method."); comment.addComment(javaDocComment, CommentLocation.BEGINNING); methodBuilder.setCommentStructure(comment); return methodBuilder; }
/** * Obtains a method annotated with @After for doing the test class teardown * phase after finishing each test. * * @return {@link MethodMetadataBuilder} */ private MethodMetadataBuilder getCleanMethod() { final InvocableMemberBodyBuilder bodyBuilder = new InvocableMemberBodyBuilder(); bodyBuilder.newLine(); bodyBuilder.appendFormalLine("// Clean needed after executing each test method"); bodyBuilder.appendFormalLine("// To be implemented by developer"); bodyBuilder.newLine(); // Use the MethodMetadataBuilder for easy creation of MethodMetadata MethodMetadataBuilder methodBuilder = new MethodMetadataBuilder(getId(), Modifier.PUBLIC, new JavaSymbolName("clean"), JavaType.VOID_PRIMITIVE, bodyBuilder); // Add @After methodBuilder.addAnnotation(new AnnotationMetadataBuilder(AFTER).build()); // Add comment CommentStructure comment = new CommentStructure(); JavadocComment javaDocComment = new JavadocComment( "This method will be automatically executed after each test method for freeing resources allocated with @Before annotated method."); comment.addComment(javaDocComment, CommentLocation.BEGINNING); methodBuilder.setCommentStructure(comment); return methodBuilder; }