@Test public void indentStyle() { Assert.assertEquals(PropertyValue.valid("space", IndentStyleValue.space), PropertyType.indent_style.parse("space")); Assert.assertEquals(PropertyValue.valid("SPACE", IndentStyleValue.space), PropertyType.indent_style.parse("SPACE")); Assert.assertEquals(PropertyValue.valid("SpAcE", IndentStyleValue.space), PropertyType.indent_style.parse("SpAcE")); Assert.assertEquals(PropertyValue.valid("tab", IndentStyleValue.tab), PropertyType.indent_style.parse("tab")); Assert.assertFalse(PropertyType.indent_style.parse("").isValid()); Assert.assertFalse(PropertyType.indent_style.parse("foo").isValid()); Assert.assertFalse(PropertyType.indent_style.parse(null).isValid()); }
public PropertyValue<T> parse(String value) { return parser.parse(name, value); }
PropertyType { public PropertyValue<T> parse(String value) { return parser.parse(name, value); } }
PropertyType { public PropertyValue<T> parse(String value) { return parser.parse(name, value); } PropertyType(String name, String description, PropertyValueParser<T> parser, Set<String> possibleValues);  PropertyType(String name, String description, PropertyValueParser<T> parser, String... possibleValues); }
PropertyType { public PropertyValue<T> parse(String value) { return parser.parse(name, value); } PropertyType(String name, String description, PropertyValueParser<T> parser, Set<String> possibleValues);  PropertyType(String name, String description, PropertyValueParser<T> parser, String... possibleValues); static Set<PropertyType<?>> standardTypes(); String getDescription(); String getName(); Set<String> getPossibleValues(); String normalizeIfNeeded(String value); PropertyValue<T> parse(String value); @Override String toString(); }
PropertyType { public PropertyValue<T> parse(String value) { return parser.parse(name, value); } PropertyType(String name, String description, PropertyValueParser<T> parser, Set<String> possibleValues);  PropertyType(String name, String description, PropertyValueParser<T> parser, String... possibleValues); static Set<PropertyType<?>> standardTypes(); String getDescription(); String getName(); Set<String> getPossibleValues(); String normalizeIfNeeded(String value); PropertyValue<T> parse(String value); @Override String toString(); static final PropertyType<String> charset; static final PropertyType<EndOfLineValue> end_of_line; static final PropertyType<Integer> indent_size; static final PropertyType<IndentStyleValue> indent_style; static final PropertyType<Boolean> insert_final_newline; static final PropertyType<Integer> max_line_length; static final PropertyType<Boolean> root; static final PropertyType<Integer> tab_width; static final PropertyType<Boolean> trim_trailing_whitespace; static final String unset; }