@Test public void mapToFlexDirection_unsupported_flex_direction() { tag.setAttribute("flex-direction", "does-not-exist"); try { mapToFlexDirection(tag); fail(); } catch (InvalidFlexDirectionException e) { assertTrue(e.getMessage().startsWith("tag-name has an invalid value: does-not-exist")); } }
public static FlexDirection mapToFlexDirection(XmlReader.Element element) { String value = element.getAttribute("flex-direction"); try { return FlexDirection.valueOf(value.toUpperCase()); } catch (IllegalArgumentException e) { throw new InvalidFlexDirectionException(element, value); } }
XmlAttributeMapper { public static FlexDirection mapToFlexDirection(XmlReader.Element element) { String value = element.getAttribute("flex-direction"); try { return FlexDirection.valueOf(value.toUpperCase()); } catch (IllegalArgumentException e) { throw new InvalidFlexDirectionException(element, value); } } }
XmlAttributeMapper { public static FlexDirection mapToFlexDirection(XmlReader.Element element) { String value = element.getAttribute("flex-direction"); try { return FlexDirection.valueOf(value.toUpperCase()); } catch (IllegalArgumentException e) { throw new InvalidFlexDirectionException(element, value); } }  }
XmlAttributeMapper { public static FlexDirection mapToFlexDirection(XmlReader.Element element) { String value = element.getAttribute("flex-direction"); try { return FlexDirection.valueOf(value.toUpperCase()); } catch (IllegalArgumentException e) { throw new InvalidFlexDirectionException(element, value); } }  static FlexDirection mapToFlexDirection(XmlReader.Element element); static Visibility mapToVisibility(XmlReader.Element element, String attributeName); }
XmlAttributeMapper { public static FlexDirection mapToFlexDirection(XmlReader.Element element) { String value = element.getAttribute("flex-direction"); try { return FlexDirection.valueOf(value.toUpperCase()); } catch (IllegalArgumentException e) { throw new InvalidFlexDirectionException(element, value); } }  static FlexDirection mapToFlexDirection(XmlReader.Element element); static Visibility mapToVisibility(XmlReader.Element element, String attributeName);  }