mirror of
https://github.com/plexusorg/Plex.git
synced 2025-07-04 16:56:40 +00:00
move this back
This commit is contained in:
@ -1,33 +0,0 @@
|
||||
package dev.plex.toml;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import static dev.plex.toml.ValueWriters.WRITERS;
|
||||
|
||||
class TableArrayValueWriter extends dev.plex.toml.ArrayValueWriter
|
||||
{
|
||||
static final dev.plex.toml.ValueWriter TABLE_ARRAY_VALUE_WRITER = new TableArrayValueWriter();
|
||||
|
||||
@Override
|
||||
public boolean canWrite(Object value) {
|
||||
return isArrayish(value) && !isArrayOfPrimitive(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(Object from, dev.plex.toml.WriterContext context) {
|
||||
Collection<?> values = normalize(from);
|
||||
|
||||
dev.plex.toml.WriterContext subContext = context.pushTableFromArray();
|
||||
|
||||
for (Object value : values) {
|
||||
WRITERS.findWriterFor(value).write(value, subContext);
|
||||
}
|
||||
}
|
||||
|
||||
private TableArrayValueWriter() {}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "table-array";
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user