test_class.file: fx-onscreen-keyboard/src/test/java/org/comtel2000/keyboard/xml/XmlHelperTest.java
test_class.identifier: XmlHelperTest
test_case.body: @Test
    public void readIntAttribute() throws XMLStreamException, FactoryConfigurationError, IOException {
      URL url = XmlHelperTest.class.getResource("/xml/default/kb-layout.xml");
      XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(url.openStream());
      reader.next();
      reader.require(XMLStreamConstants.START_ELEMENT, null, XmlHelper.KEYBOARD);
  
      assertEquals(Integer.valueOf(40),
          XmlHelper.readIntAttribute(reader, XmlHelper.ATTR_KEY_WIDTH).orElse(-1));
      assertEquals(Integer.valueOf(30),
          XmlHelper.readIntAttribute(reader, XmlHelper.ATTR_KEY_HEIGHT).orElse(-1));
      assertEquals(Integer.valueOf(0),
          XmlHelper.readIntAttribute(reader, XmlHelper.ATTR_H_GAP).orElse(-1));
      assertEquals(Integer.valueOf(0),
          XmlHelper.readIntAttribute(reader, XmlHelper.ATTR_V_GAP).orElse(-1));
      assertNull(XmlHelper.readIntAttribute(reader, "verticalGapX").orElse(null));
  
      assertEquals(40, XmlHelper.readIntAttribute(reader, XmlHelper.ATTR_KEY_WIDTH, 1));
      assertEquals(30, XmlHelper.readIntAttribute(reader, XmlHelper.ATTR_KEY_HEIGHT, 1));
      assertEquals(0, XmlHelper.readIntAttribute(reader, XmlHelper.ATTR_H_GAP, 1));
      assertEquals(0, XmlHelper.readIntAttribute(reader, XmlHelper.ATTR_V_GAP, 1));
      assertEquals(1, XmlHelper.readIntAttribute(reader, "verticalGapX", 1));
      assertEquals(1, XmlHelper.readIntAttribute(reader, "", 1));
      assertEquals(1, XmlHelper.readIntAttribute(reader, null, 1));
    }
test_case.class_method_signature: XmlHelperTest.readIntAttribute()
test_case.full_signature: @Test public void readIntAttribute()
test_case.identifier: readIntAttribute
test_case.invocations: getResource createXMLStreamReader newInstance openStream next require assertEquals valueOf orElse readIntAttribute assertEquals valueOf orElse readIntAttribute assertEquals valueOf orElse readIntAttribute assertEquals valueOf orElse readIntAttribute assertNull orElse readIntAttribute assertEquals readIntAttribute assertEquals readIntAttribute assertEquals readIntAttribute assertEquals readIntAttribute assertEquals readIntAttribute assertEquals readIntAttribute assertEquals readIntAttribute
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void readIntAttribute()
focal_class.declarator: KEYBOARD = "Keyboard"
focal_class.modifier: public static final
focal_class.original_string: public static final String KEYBOARD = "Keyboard";
focal_class.type: String
focal_class.var_name: KEYBOARD
focal_class.declarator: ROW = "Row"
focal_class.modifier: public static final
focal_class.original_string: public static final String ROW = "Row";
focal_class.type: String
focal_class.var_name: ROW
focal_class.declarator: KEY = "Key"
focal_class.modifier: public static final
focal_class.original_string: public static final String KEY = "Key";
focal_class.type: String
focal_class.var_name: KEY
focal_class.declarator: ATTR_KEY_WIDTH = "keyWidth"
focal_class.modifier: public static final
focal_class.original_string: public static final String ATTR_KEY_WIDTH = "keyWidth";
focal_class.type: String
focal_class.var_name: ATTR_KEY_WIDTH
focal_class.declarator: ATTR_KEY_HEIGHT = "keyHeight"
focal_class.modifier: public static final
focal_class.original_string: public static final String ATTR_KEY_HEIGHT = "keyHeight";
focal_class.type: String
focal_class.var_name: ATTR_KEY_HEIGHT
focal_class.declarator: ATTR_H_GAP = "horizontalGap"
focal_class.modifier: public static final
focal_class.original_string: public static final String ATTR_H_GAP = "horizontalGap";
focal_class.type: String
focal_class.var_name: ATTR_H_GAP
focal_class.declarator: ATTR_V_GAP = "verticalGap"
focal_class.modifier: public static final
focal_class.original_string: public static final String ATTR_V_GAP = "verticalGap";
focal_class.type: String
focal_class.var_name: ATTR_V_GAP
focal_class.declarator: ATTR_ROW_EDGE_FLAGS = "rowEdgeFlags"
focal_class.modifier: public static final
focal_class.original_string: public static final String ATTR_ROW_EDGE_FLAGS = "rowEdgeFlags";
focal_class.type: String
focal_class.var_name: ATTR_ROW_EDGE_FLAGS
focal_class.declarator: ATTR_KEY_EDGE_FLAGS = "keyEdgeFlags"
focal_class.modifier: public static final
focal_class.original_string: public static final String ATTR_KEY_EDGE_FLAGS = "keyEdgeFlags";
focal_class.type: String
focal_class.var_name: ATTR_KEY_EDGE_FLAGS
focal_class.declarator: ATTR_KEY_LABEL = "keyLabel"
focal_class.modifier: public static final
focal_class.original_string: public static final String ATTR_KEY_LABEL = "keyLabel";
focal_class.type: String
focal_class.var_name: ATTR_KEY_LABEL
focal_class.declarator: ATTR_KEY_LABEL_STYLE = "keyLabelStyle"
focal_class.modifier: public static final
focal_class.original_string: public static final String ATTR_KEY_LABEL_STYLE = "keyLabelStyle";
focal_class.type: String
focal_class.var_name: ATTR_KEY_LABEL_STYLE
focal_class.declarator: ATTR_KEY_ICON_STYLE = "keyIconStyle"
focal_class.modifier: public static final
focal_class.original_string: public static final String ATTR_KEY_ICON_STYLE = "keyIconStyle";
focal_class.type: String
focal_class.var_name: ATTR_KEY_ICON_STYLE
focal_class.declarator: ATTR_KEY_OUTPUT_TEXT = "keyOutputText"
focal_class.modifier: public static final
focal_class.original_string: public static final String ATTR_KEY_OUTPUT_TEXT = "keyOutputText";
focal_class.type: String
focal_class.var_name: ATTR_KEY_OUTPUT_TEXT
focal_class.declarator: ATTR_CODES = "codes"
focal_class.modifier: public static final
focal_class.original_string: public static final String ATTR_CODES = "codes";
focal_class.type: String
focal_class.var_name: ATTR_CODES
focal_class.declarator: ATTR_MOVABLE = "movable"
focal_class.modifier: public static final
focal_class.original_string: public static final String ATTR_MOVABLE = "movable";
focal_class.type: String
focal_class.var_name: ATTR_MOVABLE
focal_class.declarator: ATTR_REPEATABLE = "repeatable"
focal_class.modifier: public static final
focal_class.original_string: public static final String ATTR_REPEATABLE = "repeatable";
focal_class.type: String
focal_class.var_name: ATTR_REPEATABLE
focal_class.declarator: ATTR_STICKY = "sticky"
focal_class.modifier: public static final
focal_class.original_string: public static final String ATTR_STICKY = "sticky";
focal_class.type: String
focal_class.var_name: ATTR_STICKY
focal_class.declarator: FLAG_RIGHT = "right"
focal_class.modifier: public static final
focal_class.original_string: public static final String FLAG_RIGHT = "right";
focal_class.type: String
focal_class.var_name: FLAG_RIGHT
focal_class.declarator: FLAG_LEFT = "left"
focal_class.modifier: public static final
focal_class.original_string: public static final String FLAG_LEFT = "left";
focal_class.type: String
focal_class.var_name: FLAG_LEFT
focal_class.file: fx-onscreen-keyboard/src/main/java/org/comtel2000/keyboard/xml/XmlHelper.java
focal_class.identifier: XmlHelper
focal_class.class_method_signature: XmlHelper.XmlHelper()
focal_class.full_signature: private  XmlHelper()
focal_class.identifier: XmlHelper
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  XmlHelper()
focal_class.class_method_signature: XmlHelper.readAttribute(XMLStreamReader reader, String attr)
focal_class.full_signature: public static Optional<String> readAttribute(XMLStreamReader reader, String attr)
focal_class.identifier: readAttribute
focal_class.modifiers: public static
focal_class.parameters: (XMLStreamReader reader, String attr)
focal_class.return: Optional<String>
focal_class.signature: Optional<String> readAttribute(XMLStreamReader reader, String attr)
focal_class.class_method_signature: XmlHelper.readIntAttribute(XMLStreamReader reader, String attr)
focal_class.full_signature: public static Optional<Integer> readIntAttribute(XMLStreamReader reader, String attr)
focal_class.identifier: readIntAttribute
focal_class.modifiers: public static
focal_class.parameters: (XMLStreamReader reader, String attr)
focal_class.return: Optional<Integer>
focal_class.signature: Optional<Integer> readIntAttribute(XMLStreamReader reader, String attr)
focal_class.class_method_signature: XmlHelper.readDoubleAttribute(XMLStreamReader reader, String attr)
focal_class.full_signature: public static Optional<Double> readDoubleAttribute(XMLStreamReader reader, String attr)
focal_class.identifier: readDoubleAttribute
focal_class.modifiers: public static
focal_class.parameters: (XMLStreamReader reader, String attr)
focal_class.return: Optional<Double>
focal_class.signature: Optional<Double> readDoubleAttribute(XMLStreamReader reader, String attr)
focal_class.class_method_signature: XmlHelper.readIntAttribute(XMLStreamReader reader, String attr, int defaultValue)
focal_class.full_signature: public static int readIntAttribute(XMLStreamReader reader, String attr, int defaultValue)
focal_class.identifier: readIntAttribute
focal_class.modifiers: public static
focal_class.parameters: (XMLStreamReader reader, String attr, int defaultValue)
focal_class.return: int
focal_class.signature: int readIntAttribute(XMLStreamReader reader, String attr, int defaultValue)
focal_class.class_method_signature: XmlHelper.readDoubleAttribute(XMLStreamReader reader, String attr, double defaultValue)
focal_class.full_signature: public static double readDoubleAttribute(XMLStreamReader reader, String attr, double defaultValue)
focal_class.identifier: readDoubleAttribute
focal_class.modifiers: public static
focal_class.parameters: (XMLStreamReader reader, String attr, double defaultValue)
focal_class.return: double
focal_class.signature: double readDoubleAttribute(XMLStreamReader reader, String attr, double defaultValue)
focal_class.class_method_signature: XmlHelper.readBooleanAttribute(XMLStreamReader reader, String attr,
        boolean defaultValue)
focal_class.full_signature: public static boolean readBooleanAttribute(XMLStreamReader reader, String attr,
        boolean defaultValue)
focal_class.identifier: readBooleanAttribute
focal_class.modifiers: public static
focal_class.parameters: (XMLStreamReader reader, String attr,
        boolean defaultValue)
focal_class.return: boolean
focal_class.signature: boolean readBooleanAttribute(XMLStreamReader reader, String attr,
        boolean defaultValue)
focal_class.class_method_signature: XmlHelper.parseInt(String i)
focal_class.full_signature: public static int parseInt(String i)
focal_class.identifier: parseInt
focal_class.modifiers: public static
focal_class.parameters: (String i)
focal_class.return: int
focal_class.signature: int parseInt(String i)
focal_class.class_method_signature: XmlHelper.close(XMLStreamReader reader)
focal_class.full_signature: public static void close(XMLStreamReader reader)
focal_class.identifier: close
focal_class.modifiers: public static
focal_class.parameters: (XMLStreamReader reader)
focal_class.return: void
focal_class.signature: void close(XMLStreamReader reader)
focal_method.body: public static Optional<Integer> readIntAttribute(XMLStreamReader reader, String attr) {
      return Optional.ofNullable(reader.getAttributeValue(null, attr)).flatMap(s -> {
        try {
          return Optional.of(Integer.valueOf(s));
        } catch (NumberFormatException e) {
          return Optional.empty();
        }
      });
    }
focal_method.class_method_signature: XmlHelper.readIntAttribute(XMLStreamReader reader, String attr)
focal_method.full_signature: public static Optional<Integer> readIntAttribute(XMLStreamReader reader, String attr)
focal_method.identifier: readIntAttribute
focal_method.invocations: flatMap ofNullable getAttributeValue of valueOf empty
focal_method.modifiers: public static
focal_method.parameters: (XMLStreamReader reader, String attr)
focal_method.return: Optional<Integer>
focal_method.signature: Optional<Integer> readIntAttribute(XMLStreamReader reader, String attr)