private Formatter(Builder builder) { this.builder = new Builder(builder); // take a copy to avoid after creation side effects this.options = new DataSet(builder); this.formatterOptions = new FormatterOptions(this.options); this.nodeFormatterFactories = new ArrayList<NodeFormatterFactory>(builder.nodeFormatterFactories.size() + 1); this.nodeFormatterFactories.addAll(builder.nodeFormatterFactories); // Add as last. This means clients can override the rendering of core nodes if they want. this.nodeFormatterFactories.add(new NodeFormatterFactory() { @Override public NodeFormatter create(DataHolder options) { return new CoreNodeFormatter(options); } }); }
private Formatter(Builder builder) { this.builder = new Builder(builder); // take a copy to avoid after creation side effects this.options = new DataSet(builder); this.formatterOptions = new FormatterOptions(this.options); this.nodeFormatterFactories = new ArrayList<NodeFormatterFactory>(builder.nodeFormatterFactories.size() + 1); this.nodeFormatterFactories.addAll(builder.nodeFormatterFactories); // Add as last. This means clients can override the rendering of core nodes if they want. this.nodeFormatterFactories.add(new NodeFormatterFactory() { @Override public NodeFormatter create(DataHolder options) { return new CoreNodeFormatter(options); } }); }
public Formatter withOptions(DataHolder options) { return options == null ? this : new Formatter(new Builder(builder, options)); }
/** * Create a new builder for configuring an {@link Formatter}. * * @param options initialization options * @return a builder */ public static Builder builder(DataHolder options) { return new Builder(options); }
/** * Create a new builder for configuring an {@link Formatter}. * * @return a builder */ public static Builder builder() { return new Builder(); }
public Formatter withOptions(DataHolder options) { return options == null ? this : new Formatter(new Builder(builder, options)); }
/** * Create a new builder for configuring an {@link Formatter}. * * @param options initialization options * @return a builder */ public static Builder builder(DataHolder options) { return new Builder(options); }
/** * Create a new builder for configuring an {@link Formatter}. * * @return a builder */ public static Builder builder() { return new Builder(); }