mirror of
https://github.com/plexusorg/toml4j.git
synced 2024-06-01 01:11:36 +00:00
ValueAnalysis renamed to ValueConverter
This commit is contained in:
parent
e2a085d310
commit
0a4ac0d875
|
@ -1,6 +1,6 @@
|
|||
package com.moandjiezana.toml;
|
||||
|
||||
import static com.moandjiezana.toml.values.ValueAnalysis.INVALID;
|
||||
import static com.moandjiezana.toml.values.ValueConverter.INVALID;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
@ -9,12 +9,12 @@ import org.parboiled.Parboiled;
|
|||
import org.parboiled.parserunners.BasicParseRunner;
|
||||
import org.parboiled.support.ParsingResult;
|
||||
|
||||
import com.moandjiezana.toml.values.ValueAnalysis;
|
||||
import com.moandjiezana.toml.values.ValueConverter;
|
||||
|
||||
public class TomlParser {
|
||||
private static final Pattern MULTILINE_ARRAY_REGEX = Pattern.compile("\\s*\\[([^\\]]*)");
|
||||
private static final Pattern MULTILINE_ARRAY_REGEX_END = Pattern.compile("\\s*\\]");
|
||||
private static final ValueAnalysis VALUE_ANALYSIS = new ValueAnalysis();
|
||||
private static final ValueConverter VALUE_ANALYSIS = new ValueConverter();
|
||||
|
||||
private final Results results = new Results();
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.moandjiezana.toml.values;
|
||||
|
||||
import static com.moandjiezana.toml.values.ValueAnalysis.INVALID;
|
||||
import static com.moandjiezana.toml.values.ValueConverter.INVALID;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -16,7 +16,7 @@ class ArrayParser implements ValueParser {
|
|||
static final ArrayParser ARRAY_PARSER = new ArrayParser();
|
||||
|
||||
private static final List<Object> INVALID_ARRAY = new ArrayList<Object>();
|
||||
private static final ValueAnalysis VALUE_ANALYSIS = new ValueAnalysis();
|
||||
private static final ValueConverter VALUE_ANALYSIS = new ValueConverter();
|
||||
|
||||
@Override
|
||||
public boolean canParse(String s) {
|
||||
|
|
|
@ -13,7 +13,7 @@ class BooleanParser implements ValueParser {
|
|||
public Object parse(String s) {
|
||||
if (s.startsWith("true") && !ValueParserUtils.isComment(s.substring(4)) ||
|
||||
s.startsWith("false") && !ValueParserUtils.isComment(s.substring(5))) {
|
||||
return ValueAnalysis.INVALID;
|
||||
return ValueConverter.INVALID;
|
||||
}
|
||||
|
||||
return s.startsWith("true") ? Boolean.TRUE : Boolean.FALSE;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.moandjiezana.toml.values;
|
||||
|
||||
import static com.moandjiezana.toml.values.ValueAnalysis.INVALID;
|
||||
import static com.moandjiezana.toml.values.ValueConverter.INVALID;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.regex.Matcher;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.moandjiezana.toml.values;
|
||||
|
||||
import static com.moandjiezana.toml.values.ValueAnalysis.INVALID;
|
||||
import static com.moandjiezana.toml.values.ValueConverter.INVALID;
|
||||
import static com.moandjiezana.toml.values.ValueParserUtils.isComment;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
|
|
|
@ -7,7 +7,7 @@ import static com.moandjiezana.toml.values.FloatParser.FLOAT_PARSER;
|
|||
import static com.moandjiezana.toml.values.IntegerParser.INTEGER_PARSER;
|
||||
import static com.moandjiezana.toml.values.StringParser.STRING_PARSER;
|
||||
|
||||
public class ValueAnalysis {
|
||||
public class ValueConverter {
|
||||
public static final Object INVALID = new Object();
|
||||
|
||||
public Object convert(String value) {
|
Loading…
Reference in a new issue