private GroovyMethodDoc createMainMethod(SimpleGroovyClassDoc currentClassDoc) { SimpleGroovyMethodDoc mainMethod = new SimpleGroovyMethodDoc("main", currentClassDoc); mainMethod.setPublic(true); mainMethod.setStatic(true); mainMethod.setCommentText("Implicit main method for Groovy Scripts"); mainMethod.setFirstSentenceCommentText(mainMethod.commentText()); SimpleGroovyParameter args = new SimpleGroovyParameter("args"); GroovyType argsType = new SimpleGroovyType("java.lang.String[]"); args.setType(argsType); mainMethod.add(args); GroovyType returnType = new SimpleGroovyType("void"); mainMethod.setReturnType(returnType); return mainMethod; }
private void adjustForAutomaticEnumMethods(SimpleGroovyClassDoc currentClassDoc) { SimpleGroovyMethodDoc valueOf = new SimpleGroovyMethodDoc("valueOf", currentClassDoc); valueOf.setRawCommentText("Returns the enum constant of this type with the specified name."); SimpleGroovyParameter parameter = new SimpleGroovyParameter("name"); parameter.setTypeName("String"); valueOf.add(parameter); valueOf.setReturnType(new SimpleGroovyType(currentClassDoc.name())); currentClassDoc.add(valueOf); SimpleGroovyMethodDoc values = new SimpleGroovyMethodDoc("values", currentClassDoc); values.setRawCommentText("Returns an array containing the constants of this enum type, in the order they are declared."); values.setReturnType(new SimpleGroovyType(currentClassDoc.name() + "[]")); currentClassDoc.add(values); }
private static GroovyMethodDoc createMainMethod(SimpleGroovyClassDoc currentClassDoc) { SimpleGroovyMethodDoc mainMethod = new SimpleGroovyMethodDoc("main", currentClassDoc); mainMethod.setPublic(true); mainMethod.setStatic(true); mainMethod.setCommentText("Implicit main method for Groovy Scripts"); mainMethod.setFirstSentenceCommentText(mainMethod.commentText()); SimpleGroovyParameter args = new SimpleGroovyParameter("args"); GroovyType argsType = new SimpleGroovyType("java.lang.String[]"); args.setType(argsType); mainMethod.add(args); GroovyType returnType = new SimpleGroovyType("void"); mainMethod.setReturnType(returnType); return mainMethod; }
private GroovyMethodDoc createMainMethod(SimpleGroovyClassDoc currentClassDoc) { SimpleGroovyMethodDoc mainMethod = new SimpleGroovyMethodDoc("main", currentClassDoc); mainMethod.setPublic(true); mainMethod.setStatic(true); mainMethod.setCommentText("Implicit main method for Groovy Scripts"); mainMethod.setFirstSentenceCommentText(mainMethod.commentText()); SimpleGroovyParameter args = new SimpleGroovyParameter("args"); GroovyType argsType = new SimpleGroovyType("java.lang.String[]"); args.setType(argsType); mainMethod.add(args); GroovyType returnType = new SimpleGroovyType("void"); mainMethod.setReturnType(returnType); return mainMethod; }
private void adjustForAutomaticEnumMethods(SimpleGroovyClassDoc currentClassDoc) { SimpleGroovyMethodDoc valueOf = new SimpleGroovyMethodDoc("valueOf", currentClassDoc); valueOf.setRawCommentText("Returns the enum constant of this type with the specified name."); SimpleGroovyParameter parameter = new SimpleGroovyParameter("name"); parameter.setTypeName("String"); valueOf.add(parameter); valueOf.setReturnType(new SimpleGroovyType(currentClassDoc.name())); currentClassDoc.add(valueOf); SimpleGroovyMethodDoc values = new SimpleGroovyMethodDoc("values", currentClassDoc); values.setRawCommentText("Returns an array containing the constants of this enum type, in the order they are declared."); values.setReturnType(new SimpleGroovyType(currentClassDoc.name() + "[]")); currentClassDoc.add(values); }
private void adjustForAutomaticEnumMethods(SimpleGroovyClassDoc currentClassDoc) { SimpleGroovyMethodDoc valueOf = new SimpleGroovyMethodDoc("valueOf", currentClassDoc); valueOf.setRawCommentText("Returns the enum constant of this type with the specified name."); SimpleGroovyParameter parameter = new SimpleGroovyParameter("name"); parameter.setTypeName("String"); valueOf.add(parameter); valueOf.setReturnType(new SimpleGroovyType(currentClassDoc.name())); currentClassDoc.add(valueOf); SimpleGroovyMethodDoc values = new SimpleGroovyMethodDoc("values", currentClassDoc); values.setRawCommentText("Returns an array containing the constants of this enum type, in the order they are declared."); values.setReturnType(new SimpleGroovyType(currentClassDoc.name() + "[]")); currentClassDoc.add(values); }
private static void adjustForAutomaticEnumMethods(SimpleGroovyClassDoc currentClassDoc) { SimpleGroovyMethodDoc valueOf = new SimpleGroovyMethodDoc("valueOf", currentClassDoc); valueOf.setRawCommentText("Returns the enum constant of this type with the specified name."); SimpleGroovyParameter parameter = new SimpleGroovyParameter("name"); parameter.setTypeName("String"); valueOf.add(parameter); valueOf.setReturnType(new SimpleGroovyType(currentClassDoc.name())); currentClassDoc.add(valueOf); SimpleGroovyMethodDoc values = new SimpleGroovyMethodDoc("values", currentClassDoc); values.setRawCommentText("Returns an array containing the constants of this enum type, in the order they are declared."); values.setReturnType(new SimpleGroovyType(currentClassDoc.name() + "[]")); currentClassDoc.add(values); }
private void adjustForAutomaticEnumMethods(SimpleGroovyClassDoc currentClassDoc) { SimpleGroovyMethodDoc valueOf = new SimpleGroovyMethodDoc("valueOf", currentClassDoc); valueOf.setRawCommentText("Returns the enum constant of this type with the specified name."); SimpleGroovyParameter parameter = new SimpleGroovyParameter("name"); parameter.setTypeName("String"); valueOf.add(parameter); valueOf.setReturnType(new SimpleGroovyType(currentClassDoc.name())); currentClassDoc.add(valueOf); SimpleGroovyMethodDoc values = new SimpleGroovyMethodDoc("values", currentClassDoc); values.setRawCommentText("Returns an array containing the constants of this enum type, in the order they are declared."); values.setReturnType(new SimpleGroovyType(currentClassDoc.name() + "[]")); currentClassDoc.add(values); }