Set an annotation element of this instance.
If there is a preexisting element with the same name, it will be
replaced by this method.

@param element {@code non-null;} the annotation element to be set.
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);
    }
1365278
public void addTo(String section, Object element)
    {
        Composite s = (Composite)sections.get(section);
        if (s==null)
            add(element);
        else
            s.add(element);
    }
355911
protected void replaceWithChildren(Element element)
    {
        Element parent = (Element) element.getParentNode();
        while (element.getFirstChild() != null) {
            parent.insertBefore(element.removeChild(element.getFirstChild()), element);
        }
        parent.removeChild(element);
    }
95239
void setAnnotation(String key, Object object) {
    checkArgument(object != null, "The stored annotation value cannot be null.");
    Preconditions.checkArgument(
        !annotationMap.containsKey(key), "Cannot overwrite the existing annotation '%s'.", key);
    annotationMap.put(key, object);
  }
994325
public void setElements(List<ObjectProperty> elements) {
        if (elements == null) {
            this.elements = null;
        } else {
            if (this.elements != null)
                this.elements.clear();
            for (ObjectProperty o : elements)
                addElement(o);
        }
    }
275831
@SuppressWarnings("unchecked")
  public static boolean suppressesWarning(String warning, Element element) {
    if (element == null || isPackage(element)) {
      return false;
    }
    AnnotationMirror annotation = getAnnotation(element, SuppressWarnings.class);
    if (annotation != null) {
      for (AnnotationValue elem
           : (List<? extends AnnotationValue>) getAnnotationValue(annotation, "value")) {
        if (warning.equals(elem.getValue())) {
          return true;
        }
      }
    }
    return suppressesWarning(warning, element.getEnclosingElement());
  }
698205
protected boolean addElem(final T element) {
    // validate element
    if (element == null) {
      throw new IllegalArgumentException("Null element is not supported.");
    }
    // find hashCode & index
    final int hashCode = element.hashCode();
    final int index = getIndex(hashCode);
    // return false if already present
    if (containsElem(index, element, hashCode)) {
      return false;
    }

    modification++;
    size++;

    // update bucket linked list
    LinkedElement<T> le = new LinkedElement<T>(element, hashCode);
    le.next = entries[index];
    entries[index] = le;
    return true;
  }
350843
public void assignName(XAttributable element, String name) {
		if (name != null && name.trim().length() > 0) {
			XAttributeLiteral attr = (XAttributeLiteral) ATTR_NAME.clone();
			attr.setValue(name);
			element.getAttributes().put(KEY_NAME, attr);
		}
	}
1232018
public T addElement(T element) {
		// make sure that elements are initialized
		getElements();
		if (!containsElement(this.elements, element)) {
			this.elements.add(element);
			element.addChangeListener(this.elementChangeListener);
			element.notifyState();
			return element;
		}
		throw new RuntimeException(element.toString() + " already exists");
	}
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);
			}
		}
	}
1311101
public static boolean isAnnotated(AnnotatedElement element, Class<? extends Annotation> annotationType) {
        return findAnnotation(element, annotationType) != null;
    }
1316802
private void initialize(final Element element) {

		String _id = getAttribute(element, "rdf:about");
		if (_id != null) {

			setId(_id);
		}

		initializeRDFSLabels(element.getElementsByTagName("rdfs:label"));

		internalName = getValue(getFirstElement(getElement(), "krdf:internalName"));

		// detect inheritance
		for (final String inheritanceIdentifier : getInheritanceIdentifiers()) {

			initializeSuperclass(element.getElementsByTagName(inheritanceIdentifier));

			if (superclassId != null) {
				break;
			}
		}

		// extract and parse creation and modification dates
		createdAt  = getValue(getFirstElement(getElement(), "createdAt"));
		modifiedAt = getValue(getFirstElement(getElement(), "modifiedAt"));

		rdfReferenceId = getAttribute(getElement(), "rdf:ID");

	}
1173781
protected String getPropertyDefaultValue(AnnotatedElement element) {
        if (element.isAnnotationPresent(DefaultValue.class)) {
            return element.getAnnotation(DefaultValue.class).value();
        }
        return null;
    }
694153
public void addAnnotationInfo(Element element, Content htmltree) {
        addAnnotationInfo(element, element.getAnnotationMirrors(), htmltree);
    }
2055
public void setValue(E element) {
        if(element == null)
            throw new NullPointerException("cannot set a null element");
        if(_lastId == VStack.NULL_ID)
            throw new IllegalStateException("neither next() nor previous() has been called");

        _stack.setById(_lastId, element);

        afterSet(element);
    }
494542
public boolean add(Object element) {

//        reporter.updateCounter++;
        if (elementCount >= elementData.length) {
            increaseCapacity();
        }

        elementData[elementCount] = element;

        elementCount++;

        return true;
    }
769578
protected void setInputElementValue(Node element, FormInput input) {

		LOGGER.debug("INPUTFIELD: {} ({})", input.getIdentification(), input.getType());
		if (element == null || input.getInputValues().isEmpty()) {
			return;
		}
		try {

			switch (input.getType()) {
				case TEXT:
				case TEXTAREA:
				case PASSWORD:
					handleText(input);
					break;
				case HIDDEN:
					handleHidden(input);
					break;
				case CHECKBOX:
					handleCheckBoxes(input);
					break;
				case RADIO:
					handleRadioSwitches(input);
					break;
				case SELECT:
					handleSelectBoxes(input);
			}

		} catch (ElementNotVisibleException e) {
			LOGGER.warn("Element not visible, input not completed.");
		} catch (BrowserConnectionException e) {
			throw e;
		} catch (RuntimeException e) {
			LOGGER.error("Could not input element values", e);
		}
	}