1 38 package com.gargoylesoftware.htmlunit.html; 39 40 import org.xml.sax.Attributes ; 41 42 import java.util.Map ; 43 import java.util.HashMap ; 44 45 52 public final class UnknownElementFactory implements IElementFactory { 53 54 55 public static final UnknownElementFactory instance = new UnknownElementFactory(); 56 57 58 private UnknownElementFactory() { 59 } 60 61 64 public HtmlElement createElement( 65 final HtmlPage page, final String tagName, 66 final Attributes attributes) { 67 68 Map attributeMap = null; 69 if(attributes != null) { 70 attributeMap = new HashMap (attributes.getLength()); 71 for(int i=0; i < attributes.getLength(); i++) { 72 attributeMap.put(attributes.getLocalName(i), attributes.getValue(i)); 73 } 74 } 75 final HtmlElement newElement = new UnknownHtmlElement(page, tagName, attributeMap); 76 return newElement; 77 } 78 } 79 | Popular Tags |