ValueAnalysis renamed to ValueConverter

This commit is contained in:
moandji.ezana 2014-08-12 17:30:44 +02:00
parent e2a085d310
commit 0a4ac0d875
6 changed files with 9 additions and 9 deletions

View file

@ -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();

View file

@ -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) {

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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) {