public Body(Element parent, HtmlAttributeToken[] attrs){ super(parent, attrs); for(HtmlAttributeToken attr:attrs){ String v = attr.getValue(); switch(attr.getName()){ case "alink": alink = Alink.parse(this, v); break; case "background": background = Background.parse(this, v); break; case "bgcolor": bgcolor = Bgcolor.parse(this, v); break; case "link": link = Link.parse(this, v); break; case "text": text = Text.parse(this, v); break; case "vlink": vlink = Vlink.parse(this, v); break; } } }
public HtmlElement(HtmlElement parent, HtmlAttributeToken[] attrs) { children = new ArrayList<>(); this.parent = parent; if (parent != null) parent.children.add(this); for (HtmlAttributeToken attr : attrs) { String v = attr.getValue(); switch (attr.getName()) { case "accesskey": accesskey = Accesskey.parse(this, v); break; case "contenteditable": contenteditable = Contenteditable.parse(this, v); break; case "contextmenu": contextmenu = Contextmenu.parse(this, v); break; case "dir": dir = Dir.parse(this, v); break; case "draggable": draggable = Draggable.parse(this, v); break; case "dropzone": dropzone = Dropzone.parse(this, v); break; case "hidden": hidden = Hidden.parse(this, v); break; case "id": id = Id.parse(this, v); break; case "lang": lang = Lang.parse(this, v); break; case "spellcheck": spellcheck = Spellcheck.parse(this, v); break; case "style": style = Style.parse(this, v); break; case "tabindex": tabindex = Tabindex.parse(this, v); break; case "title": title = Title.parse(this, v); break; case "translate": translate = Translate.parse(this, v); break; default: break; } } }