@Test public void testWithFlagAndEmbeddedNameStringNode() throws IOException { byte token = (byte) (0x04 << 4 | getToken()); stringOffset = 5; tagName = "teststring"; testBinaryReaderBuilder = new TestBinaryReaderBuilder(); testBinaryReaderBuilder.put(token); testBinaryReaderBuilder.putWord(unknown); testBinaryReaderBuilder.putDWord(size); testBinaryReaderBuilder.putDWord(stringOffset); testBinaryReaderBuilder.putDWord(0); testBinaryReaderBuilder.putWord(0); testBinaryReaderBuilder.putWord(tagName.length()); testBinaryReaderBuilder.putWString(tagName); testBinaryReaderBuilder.putWord(0); testBinaryReaderBuilder.put(new byte[5]); testBinaryReaderBuilder.put((byte) BxmlNode.CLOSE_EMPTY_ELEMENT_TOKEN); BinaryReader binaryReader = testBinaryReaderBuilder.build(); NameStringNode nameStringNode = mock(NameStringNode.class); when(nameStringNode.getString()).thenReturn(tagName); when(chunkHeader.addNameStringNode(stringOffset, binaryReader)).thenAnswer(invocation -> new NameStringNode(binaryReader, chunkHeader)); openStartElementNode = new OpenStartElementNode(binaryReader, chunkHeader, parent); assertEquals(getToken(), openStartElementNode.getToken() & 0x0F); assertTrue((openStartElementNode.getFlags() & 0x04) > 0); assertEquals(tagName, openStartElementNode.getTagName()); }
public String getTagName() { return tagName; }
OpenStartElementNode extends BxmlNodeWithToken { public String getTagName() { return tagName; } }
OpenStartElementNode extends BxmlNodeWithToken { public String getTagName() { return tagName; } OpenStartElementNode(BinaryReader binaryReader, ChunkHeader chunkHeader, BxmlNode parent); }
OpenStartElementNode extends BxmlNodeWithToken { public String getTagName() { return tagName; } OpenStartElementNode(BinaryReader binaryReader, ChunkHeader chunkHeader, BxmlNode parent); String getTagName(); @Override void accept(BxmlNodeVisitor bxmlNodeVisitor); }
OpenStartElementNode extends BxmlNodeWithToken { public String getTagName() { return tagName; } OpenStartElementNode(BinaryReader binaryReader, ChunkHeader chunkHeader, BxmlNode parent); String getTagName(); @Override void accept(BxmlNodeVisitor bxmlNodeVisitor);  }