/** * Generates getters, setters and adders for the fields in the specified * model and sets the fields to private. Method signatures that has been * excluded in the construction of this control will be excluded from the * generation. * <p> * For fields of a subtype to {@link Collection}, an 'adder' will be * generated instead of a 'setter'. * <p> * For fields of type {@link Optional}, the inner type will be used in the * setter parameter but the wrapped type will be used as output for the * getter. * * @param file the model to generate for */ @Override public void accept(File file) { file.getClasses().stream() .filter(Class.class::isInstance) .map(Class.class::cast) .forEach(c -> accept(file, c)); }
/** * Copy constructor. * * @param prototype the prototype */ protected FileImpl(File prototype) { this.name = requireNonNull(prototype).getName(); this.doc = prototype.getJavadoc().map(Copier::copy).orElse(null); this.imports = Copier.copy(prototype.getImports()); this.classes = Copier.copy(prototype.getClasses(), c -> c.copy()); }
/** * Generates getters, setters and adders for the fields in the specified * model and sets the fields to private. Method signatures that has been * excluded in the construction of this control will be excluded from the * generation. * <p> * For fields of a subtype to {@link Collection}, an 'adder' will be * generated instead of a 'setter'. * <p> * For fields of type {@link Optional}, the inner type will be used in the * setter parameter but the wrapped type will be used as output for the * getter. * * @param file the model to generate for */ @Override public void accept(File file) { file.getClasses().stream() .filter(Class.class::isInstance) .map(Class.class::cast) .forEach(c -> accept(file, c)); }
/** * Generates getters, setters and adders for the fields in the specified * model and sets the fields to private. Method signatures that has been * excluded in the construction of this control will be excluded from the * generation. * <p> * For fields of a subtype to {@link Collection}, an 'adder' will be * generated instead of a 'setter'. * <p> * For fields of type {@link Optional}, the inner type will be used in the * setter parameter but the wrapped type will be used as output for the * getter. * * @param file the model to generate for */ @Override public void accept(File file) { file.getClasses().stream() .filter(Class.class::isInstance) .map(Class.class::cast) .forEach(c -> accept(file, c)); }
/** * Copy constructor. * * @param prototype the prototype */ protected FileImpl(File prototype) { this.name = requireNonNull(prototype).getName(); this.doc = prototype.getJavadoc().map(Copier::copy).orElse(null); this.imports = Copier.copy(prototype.getImports()); this.classes = Copier.copy(prototype.getClasses(), c -> c.copy()); }
/** * Copy constructor. * * @param prototype the prototype */ protected FileImpl(File prototype) { this.name = requireNonNull(prototype).getName(); this.doc = prototype.getJavadoc().map(Copier::copy).orElse(null); this.imports = Copier.copy(prototype.getImports()); this.classes = Copier.copy(prototype.getClasses(), c -> c.copy()); }