protected void addAccept(JavaInterfaceSource type, ClassPlan plan) { final MethodSource<JavaInterfaceSource> method = type.addMethod(); method.getJavaDoc() .setText("Configure a pre-constructed instance of " + plan.getClassName() + " resource") .addTagValue("@parameter", "Instance of " + plan.getClassName() + " to configure") .addTagValue("@return", "nothing"); method.addParameter("T", "value"); method.setName("accept") .setReturnType("void"); }
protected void addAccept(JavaInterfaceSource type, ClassPlan plan) { final MethodSource<JavaInterfaceSource> method = type.addMethod(); method.getJavaDoc() .setText("Configure a pre-constructed instance of " + plan.getClassName() + " resource") .addTagValue("@parameter", "Instance of " + plan.getClassName() + " to configure") .addTagValue("@return", "nothing"); method.addParameter("T", "value"); method.setName("accept") .setReturnType("void"); }
private void writeCreator(final JavaClassSource javaClass, final Class beanDef) { if (!beanDef.isAbstract() && !javaClass.hasMethodSignature("create")) { final StringBuilder javadoc = new StringBuilder(); javadoc .append("Build a new instance of {@link ").append(beanDef.name()).append("}."); final String body = Templates.use(TemplateName.Creator, beanDef); final MethodSource<?> method = javaClass.addMethod() .setName("of") .setPublic() .setStatic(true) .setBody(body) .setReturnType(beanDef.qualifiedName()); method.getJavaDoc().setFullText(javadoc.toString()) .addTagValue("@return", "a fresh instance"); } else { // javaClass.getMethod(propDef.getName()).setBody(javaClass.getMethod(propDef.getName()).getBody() // + body.toString()); } }
protected void addGet(JavaInterfaceSource type, ClassPlan plan) { final MethodSource<JavaInterfaceSource> method = type.addMethod(); method.getJavaDoc() .setText("Constructed instance of " + plan.getClassName() + " resource") .addTagValue("@return", "The instance"); method.setPublic() .setName("get") .setReturnType(plan.getClassName()); }
protected void addGet(JavaInterfaceSource type, ClassPlan plan) { final MethodSource<JavaInterfaceSource> method = type.addMethod(); method.getJavaDoc() .setText("Constructed instance of " + plan.getClassName() + " resource") .addTagValue("@return", "The instance"); method.setPublic() .setName("get") .setReturnType(plan.getClassName()); }
.getJavaDoc() .setText("Returns the allowed value for the management model.") .addTagValue("@return", "the allowed model value");
.getJavaDoc() .setText("Returns the allowed value for the management model.") .addTagValue("@return", "the allowed model value");
accessor.getJavaDoc() .setText("Get the list of " + childClassName + " resources") .addTagValue("@return", "the list of resources"); accessor.setPublic() .setName(propName) listMutator.getJavaDoc() .setText("Add all " + childClassName + " objects to this subresource") .addTagValue("@return", "this") .addTagValue("@param", "value List of " + childClassName + " objects."); listMutator.addParameter(propType, "value"); listMutator.setPublic() mutator.getJavaDoc() .setText("Add the " + childClassName + " object to the list of subresources") .addTagValue("@param", "value The " + childClassName + " to add") .addTagValue("@return", "this"); mutator.addParameter(childClassName, "value"); mutator.setPublic() configurator.getJavaDoc() .setText("Create and configure a " + childClassName + " object to the list of subresources") .addTagValue("@param", "key The key for the " + childClassName + " resource") .addTagValue("@param", "config The " + childClassName + "Consumer to use") .addTagValue("@return", "this"); configurator.addParameter(String.class, "childKey"); configurator.addParameter(childClassName + "Consumer", "consumer"); nonConfigurator.getJavaDoc()
accessor.getJavaDoc() .setText("Get the list of " + childClassName + " resources") .addTagValue("@return", "the list of resources"); accessor.setPublic() .setName(propName) listMutator.getJavaDoc() .setText("Add all " + childClassName + " objects to this subresource") .addTagValue("@return", "this") .addTagValue("@param", "value List of " + childClassName + " objects."); listMutator.addParameter(propType, "value"); listMutator.setPublic() mutator.getJavaDoc() .setText("Add the " + childClassName + " object to the list of subresources") .addTagValue("@param", "value The " + childClassName + " to add") .addTagValue("@return", "this"); mutator.addParameter(childClassName, "value"); mutator.setPublic() configurator.getJavaDoc() .setText("Create and configure a " + childClassName + " object to the list of subresources") .addTagValue("@param", "key The key for the " + childClassName + " resource") .addTagValue("@param", "config The " + childClassName + "Consumer to use") .addTagValue("@return", "this"); configurator.addParameter(String.class, "childKey"); configurator.addParameter(childClassName + "Consumer", "consumer"); nonConfigurator.getJavaDoc()