/** * Creates a new instance implementing this interface by using the default * implementation. * * @param text the documentation * @return the new instance */ static Javadoc of(String text) { return of().setText(text); } }
protected Javadoc getJavaDoc() { final String owner; final String message; if (isInGeneratedPackage()) { owner = infoComponent.getTitle(); message = getGeneratedJavadocMessage(); } else { owner = project().orElseThrow(NoSuchElementException::new).getCompanyName(); message = JAVADOC_MESSAGE; } return Javadoc.of(getJavadocRepresentText() + message) .add(AUTHOR.setValue(owner)); }
/** * The <code>hashCode()</code>-part of the <code>accept</code> method. * * @param model the model */ protected void acceptHashcode(T model) { requireNonNull(model); model.add(Method.of(HASHCODE, int.class) .set( Javadoc.of( "Generates a hashCode for this object. If any field is " + "changed to another value, the hashCode may be different. " + "Two objects with the same values are guaranteed to have " + "the same hashCode. Two objects with the same hashCode are " + "not guaranteed to have the same hashCode." ) .add(RETURN.setText("The hash code.")) ).public_() .add(OVERRIDE) .add("int hash = 7;") .add(model.getFields().stream() .map(this::hash) .collect(Collectors.joining(nl())) ) .add("return hash;") ); }
private static <T extends HasJavadoc<?>> void createJavadoc(T model) { final Javadoc doc = requireNonNull(model).getJavadoc().orElse(Javadoc.of(DEFAULT_TEXT)); model.set(doc);
Javadoc.of( "Compares this object with the specified one for equality. " + "The other object must be of the same type and not null for " +
.set(Javadoc.of() .setText("Adds the specified " + lcfirst(shortName(param.getType().getTypeName())) + " to this " + shortName(model.getName()) + ".") .add(JavadocTag.of("param", param.getName(), "the new value")) .set(Javadoc.of() .setText("Sets the " + f.getName() + " of this " + shortName(model.getName()) + ".") .add(JavadocTag.of("param", f.getName(), "the new value")) .set(Javadoc.of() .setText("Gets the " + f.getName() + " of this " + shortName(model.getName()) + ".") .add(JavadocTag.of("return", "the " + f.getName()))
.set(Javadoc.of( "Returns the " + getSupport().variableName(col) + " of this " + getSupport().entityName() intrf.add(Method.of(SETTER_METHOD_PREFIX + getSupport().typeName(col), getSupport().entityType()) .add(Field.of(getSupport().variableName(col), typeMappers.get(col).getJavaType(col))) .set(Javadoc.of( "Sets the " + getSupport().variableName(col) + " of this " + getSupport().entityName() : fuSupport.entityType() .set(Javadoc.of( "Queries the specified manager for the referenced " + fuSupport.entityName() + ". If no such " fieldParams.toArray(new Value<?>[0]) )) .set(Javadoc.of( "This Field corresponds to the {@link " + shortEntityName + "} field that can be obtained using the " + "{@link " + shortEntityName + "#get" + getSupport().typeName(col) + "()} method."
/** * Creates a new instance implementing this interface by using the default * implementation. * * @param text the documentation * @return the new instance */ static Javadoc of(String text) { return of().setText(text); } }
/** * Creates a new instance implementing this interface by using the default * implementation. * * @param text the documentation * @return the new instance */ static Javadoc of(String text) { return of().setText(text); } }
/** * The <code>hashCode()</code>-part of the <code>accept</code> method. * * @param model the model */ protected void acceptHashcode(T model) { requireNonNull(model); model.add(Method.of(HASHCODE, int.class) .set( Javadoc.of( "Generates a hashCode for this object. If any field is " + "changed to another value, the hashCode may be different. " + "Two objects with the same values are guaranteed to have " + "the same hashCode. Two objects with the same hashCode are " + "not guaranteed to have the same hashCode." ) .add(RETURN.setText("The hash code.")) ).public_() .add(OVERRIDE) .add("int hash = 7;") .add(model.getFields().stream() .map(this::hash) .collect(Collectors.joining(nl())) ) .add("return hash;") ); }
/** * The <code>hashCode()</code>-part of the <code>accept</code> method. * * @param model the model */ protected void acceptHashcode(T model) { requireNonNull(model); model.add(Method.of(HASHCODE, int.class) .set( Javadoc.of( "Generates a hashCode for this object. If any field is " + "changed to another value, the hashCode may be different. " + "Two objects with the same values are guaranteed to have " + "the same hashCode. Two objects with the same hashCode are " + "not guaranteed to have the same hashCode." ) .add(RETURN.setText("The hash code.")) ).public_() .add(OVERRIDE) .add("int hash = 7;") .add(model.getFields().stream() .map(this::hash) .collect(Collectors.joining(nl())) ) .add("return hash;") ); }
private static <T extends HasJavadoc<?>> void createJavadoc(T model) { final Javadoc doc = requireNonNull(model).getJavadoc().orElse(Javadoc.of(DEFAULT_TEXT)); model.set(doc);
private static <T extends HasJavadoc<?>> void createJavadoc(T model) { final Javadoc doc = requireNonNull(model).getJavadoc().orElse(Javadoc.of(DEFAULT_TEXT)); model.set(doc);
Javadoc.of( "Compares this object with the specified one for equality. " + "The other object must be of the same type and not null for " +
Javadoc.of( "Compares this object with the specified one for equality. " + "The other object must be of the same type and not null for " +
.set(Javadoc.of() .setText("Adds the specified " + lcfirst(shortName(param.getType().getTypeName())) + " to this " + shortName(model.getName()) + ".") .add(JavadocTag.of("param", param.getName(), "the new value")) .set(Javadoc.of() .setText("Sets the " + f.getName() + " of this " + shortName(model.getName()) + ".") .add(JavadocTag.of("param", f.getName(), "the new value")) .set(Javadoc.of() .setText("Gets the " + f.getName() + " of this " + shortName(model.getName()) + ".") .add(JavadocTag.of("return", "the " + f.getName()))
.set(Javadoc.of() .setText("Adds the specified " + lcfirst(shortName(param.getType().getTypeName())) + " to this " + shortName(model.getName()) + ".") .add(JavadocTag.of("param", param.getName(), "the new value")) .set(Javadoc.of() .setText("Sets the " + f.getName() + " of this " + shortName(model.getName()) + ".") .add(JavadocTag.of("param", f.getName(), "the new value")) .set(Javadoc.of() .setText("Gets the " + f.getName() + " of this " + shortName(model.getName()) + ".") .add(JavadocTag.of("return", "the " + f.getName()))
.set(Javadoc.of( "Returns the " + getSupport().variableName(col) + " of this " + getSupport().entityName() intrf.add(Method.of(SETTER_METHOD_PREFIX + getSupport().typeName(col), getSupport().entityType()) .add(Field.of(getSupport().variableName(col), typeMappers.get(col).getJavaType(col))) .set(Javadoc.of( "Sets the " + getSupport().variableName(col) + " of this " + getSupport().entityName() : fuSupport.entityType() .set(Javadoc.of( "Queries the specified manager for the referenced " + fuSupport.entityName() + ". If no such " fieldParams.toArray(new Value<?>[0]) )) .set(Javadoc.of( "This Field corresponds to the {@link " + shortEntityName + "} field that can be obtained using the " + "{@link " + shortEntityName + "#get" + getSupport().typeName(col) + "()} method."