Generates an element class based on the received {@link XsdElement} object.
@param element The {@link XsdElement} containing information needed for the class creation.
@param apiName The name of the resulting fluent interface.
966196
void generateClassFromElement(XsdElement element, String apiName){
        XsdAsmElements.generateClassFromElement(interfaceGenerator, createdAttributes, element, apiName);
    }
459079
def createElement(self, token):
        """"""
        name = token["name"]
        namespace = token.get("namespace", self.defaultNamespace)
        element = self.elementClass(name, namespace)
        element.attributes = token["data"]
        return element
237170
@SuppressWarnings("unchecked")
	private static BindingConfigurationEntry parseBindingConfigurationEntryElement(Element element) {

    	Class<?> bindingClass = null;
    	Class<?> sourceClass = null;
    	Class<?> targetClass = null;
        Method toMethod = null;
        Method fromMethod = null;
        Constructor<?> fromConstructor = null;
        Class<? extends Annotation> qualifier = DefaultBinding.class;
        
        if (element.getAttribute("class").length() > 0) {
        	bindingClass = lookupClass(element.getAttribute("class"));
        }
        
        if (element.getAttribute("sourceClass").length() > 0) {
            sourceClass = lookupClass(element.getAttribute("sourceClass"));
        }
        if (element.getAttribute("targetClass").length() > 0) {
        	targetClass = lookupClass(element.getAttribute("targetClass"));
        }

        if (element.getAttribute("qualifier").length() > 0) {
        	
            qualifier = (Class<? extends Annotation>) lookupClass(element.getAttribute("qualifier"));

            if (qualifier.getAnnotation(BindingScope.class) == null) {
                    throw new IllegalStateException("Qualifier class {" + element.getAttribute("qualifier")
                            + "} was not marked as BindingScope");
            }
        }

        if (bindingClass != null) {
	        for (Node next : new IterableNodeList(element.getChildNodes())) {
	            if (Node.ELEMENT_NODE == next.getNodeType()) {
	                Element childElement = (Element) next;
	                if (BINDINGS_NAMESPACE.equals(element.getNamespaceURI())
	                        && "toMethod".equals(element.getLocalName())) {
	
	                    String toMethodName = childElement.getTextContent();
	
	                    try {
	                        toMethod = bindingClass.getMethod(toMethodName, new Class[] { targetClass });
	                    } catch (SecurityException e) {
	                    } catch (NoSuchMethodException e) {
	                    }
	                    if (toMethod != null && (!String.class.equals(toMethod.getReturnType())
	                            || !Modifier.isStatic(toMethod.getModifiers()))) {
	                        toMethod = null;
	                    }
	                    if (toMethod == null && bindingClass.equals(targetClass)) {
	                        try {
	                            toMethod = bindingClass.getMethod(toMethodName, new Class[] {});
	                        } catch (SecurityException e) {
	                        } catch (NoSuchMethodException e) {
	                        }
	                        if (toMethod != null && Modifier.isStatic(toMethod.getModifiers())) {
	                            toMethod = null;
	                        }
	                    }
	
	                } else if (BINDINGS_NAMESPACE.equals(element.getNamespaceURI())
	                        && "fromMethod".equals(element.getLocalName())) {
	
	                    String fromMethodName = childElement.getTextContent();
	
	                    try {
	                        fromMethod = bindingClass.getMethod(fromMethodName, new Class[] { String.class });
	                    } catch (SecurityException e) {
	                    } catch (NoSuchMethodException e) {
	                    }
	                    if (fromMethod != null && ((targetClass != null && !targetClass.isAssignableFrom(fromMethod.getReturnType()))
	                    	|| !Modifier.isStatic(fromMethod.getModifiers()))) {
	                    	fromMethod = null;
	                    }
	
	                } else if (BINDINGS_NAMESPACE.equals(element.getNamespaceURI())
	                        && "fromConstructor".equals(element.getLocalName())) {
	
	                    try {
	                        fromConstructor = bindingClass.getConstructor(new Class[] { String.class });
	                    } catch (SecurityException e) {
	                    } catch (NoSuchMethodException e) {
	                    }
	                }
	            }
	        }
        }

        if (bindingClass == null) {

        	if (sourceClass == null) {
        		throw new IllegalStateException("If bindingClass is not populated, sourceClass must be present");
        	}
        	if (targetClass == null) {
        		throw new IllegalStateException("If bindingClass is not populated, targetClass must be present");
        	}
        	if (fromMethod != null && fromConstructor != null) {
        		throw new IllegalStateException("If fromMethod is populated, fromConstructor must not be present");
        	}

        	if (fromMethod == null) {
        	
        		return new BindingConfigurationEntry(sourceClass, targetClass, qualifier, toMethod, fromConstructor);
        	} else {
        		
        		return new BindingConfigurationEntry(sourceClass, targetClass, qualifier, toMethod, fromMethod);
        	}
        } else {
        	if (sourceClass != null) {
        		throw new IllegalStateException("If bindingClass is populated, sourceClass must not be present");
        	}
        	if (targetClass != null) {
        		throw new IllegalStateException("If bindingClass is populated, targetClass must not be present");
        	}
        	if (toMethod != null) {
        		throw new IllegalStateException("If bindingClass is populated, toMethod must not be present");
        	}
        	if (fromMethod != null) {
        		throw new IllegalStateException("If bindingClass is populated, fromMethod must not be present");
        	}
        	if (fromConstructor != null) {
        		throw new IllegalStateException("If bindingClass is populated, fromConstructor must not be present");
        	}
        	
        	return new BindingConfigurationEntry(bindingClass, qualifier);
        }
    }
1217279
public Element createElement(String tagName, String id) {
		Element element = DOM.createElement(tagName).cast();
		DOM.setElementAttribute(element, "id", id);
		return element;
	}
334837
private static Element createResultElement(final Document document) {
        return document.createElementNS(JaxRxConstants.URL, JaxRxConstants.JAXRX + ":results");
    }
520913
public void generateProxy(Element element) {
        try {
            getClassBuilder(element)
                    .buildProxyClass()
                    .build()
                    .writeTo(filer);
        } catch (Exception ex) {
            messager.printMessage(Diagnostic.Kind.WARNING, "Error while generating Proxy " + ex.getMessage());
        }
    }
1100072
public static List<Element> getElements(Element element, String tagName) {
		final NodeList nodeList = StrUtil.isBlank(tagName) ? element.getChildNodes() : element.getElementsByTagName(tagName);
		return transElements(element, nodeList);
	}
93497
public static <E> void rootElement(WebElement root, E element) {
		if (element == null || root == null) return;
		if (element instanceof WebElement) return;
		
		for (Class<?> clazz = element.getClass(); !clazz.equals(Object.class);
				clazz = clazz.getSuperclass()) {
			
			if (Enhancer.isEnhanced(clazz)) continue;
			
			Field[] fields = clazz.getDeclaredFields();
			for (Field field : fields) {
				setRootElementField(root, element, field);
			}
		}
	}
554121
public void set(Element element) {
        if (element == null) {
            throw new NullPointerException("element == null");
        }

        CstString pairName = new CstString(element.getName());
        Constant pairValue = Element.toConstant(element.getValue());
        NameValuePair nameValuePair = new NameValuePair(pairName, pairValue);
        elements.put(element.getName(), nameValuePair);
    }
281285
protected final Element generateSimpleElement(final String name, final String value) {
        final Element element = new Element(name, getDCNamespace());
        element.addContent(value);
        return element;
    }
1310739
public void addElement(ObjectProperty element) {
        assertNotNull(element);
        if (elements == null) {
            elements = new ArrayList<ObjectProperty>();
        }
        elements.add(element);
        element.setParent(this);
    }
283642
static
  public
  void configure (Element element) {
    DOMConfigurator configurator = new DOMConfigurator();
    configurator.doConfigure(element,  LogManager.getLoggerRepository());
  }
1285046
public void add(JsonElement element) {
    if (element == null) {
      element = JsonNull.INSTANCE;
    }
    elements.add(element);
  }
714014
public void add(IRenderingElement element) {
        if (element != null) {
            if (element.getClass().equals(ElementGroup.class))
                elements.addAll(((ElementGroup) element).elements);
            else
                elements.add(element);
        }
    }
1059846
private Class<? extends Field> getClassObject(final Element element) {
		String className = element.getAttributeValue(XMLTags.CLASS);
		Class<? extends Field> classObject = null;
		try {
			className = className.indexOf('.') > 0 ? className : getClass().getPackage().getName() + '.' + className;
			classObject = Class.forName(className).asSubclass(Field.class);
		} catch (ClassNotFoundException e) {
			throw new IllegalStateException("could not get class " + className, e);
		}
		return classObject;
	}
846566
function createElement(nodeName) {
  var elem = document.createElement(nodeName);
  elem.className = [].join.call(arguments, ' ');
  return elem;
}
588871
function Element(doc, name, content) {
    if (!doc) {
        throw new Error('document argument required');
    } else if (! (doc instanceof bindings.Document)) {
        throw new Error('document argument must be an ' +
                        'instance of Document');
    } else if (!name) {
        throw new Error('name argument required');
    }

    return new bindings.Element(doc, name, content);
}