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