Parses all mapping definitions and adds those to the bean definition
builder as property value.
@param builder the target bean definition builder.
@param element the source element.
516338
private void parseMappingDefinitions(BeanDefinitionBuilder builder, Element element) {
        HashMap<String, String> mappings = new HashMap<String, String>();
        for (Element matcher : DomUtils.getChildElementsByTagName(element, "mapping")) {
            mappings.put(matcher.getAttribute("path"), matcher.getAttribute("value"));
        }

        if (!mappings.isEmpty()) {
            builder.addPropertyValue("mappings", mappings);
        }
    }
1050977
private void parseVariableDefinitions(BeanDefinitionBuilder builder, Element element) {
        Map<String, String> testVariables = new LinkedHashMap<String, String>();
        List<Element> variableElements = DomUtils.getChildElementsByTagName(element, "variable");
        for (Element variableDefinition : variableElements) {
            testVariables.put(variableDefinition.getAttribute("name"), variableDefinition.getAttribute("value"));
        }

        if (!testVariables.isEmpty()) {
            builder.addPropertyValue("variables", testVariables);
        }
    }
135824
public static Element parse(InputStream xmlStream, DocumentBuilder builder) throws IOException
   {
      try
      {
         Document doc;
         synchronized (builder) //synchronize to prevent concurrent parsing on the same DocumentBuilder
         {
            doc = builder.parse(xmlStream);
         }
         return doc.getDocumentElement();
      }
      catch (SAXException se)
      {
         throw new IOException(se.toString());
      }
      finally
      {
         xmlStream.close();
      }
   }
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);
        }
    }
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);
    }
1091295
public void setPropertyElementType (Class type, String propertyName, Class elementType) {
		if (type == null) throw new IllegalArgumentException("type cannot be null.");
		if (propertyName == null) throw new IllegalArgumentException("propertyName cannot be null.");
		if (elementType == null) throw new IllegalArgumentException("propertyType cannot be null.");
		Property property = Beans.getProperty(type, propertyName, beanProperties, privateFields, this);
		if (property == null)
			throw new IllegalArgumentException("The class " + type.getName() + " does not have a property named: " + propertyName);
		if (!Collection.class.isAssignableFrom(property.getType()) && !Map.class.isAssignableFrom(property.getType())) {
			throw new IllegalArgumentException("The '" + propertyName + "' property on the " + type.getName()
				+ " class must be a Collection or Map: " + property.getType());
		}
		propertyToElementType.put(property, elementType);
	}
954751
private void init(AnnotatedElement element) {
		Annotation[] declaredAnnotations = element.getDeclaredAnnotations();
		this.declaredAnnotationMap = new HashMap<>();
		parseDeclared(declaredAnnotations);
		
		Annotation[] annotations = element.getAnnotations();
		if(declaredAnnotations == annotations) {
			this.annotationMap = this.declaredAnnotationMap;
		}else {
			this.annotationMap = new HashMap<>();
			parse(annotations);
		}
	}
2545
public Datatype.Builder addValueTypeAnnotations(Excerpt element) {
    if (valueTypeAnnotations instanceof ImmutableList) {
      valueTypeAnnotations = new ArrayList<>(valueTypeAnnotations);
    }
    valueTypeAnnotations.add(Objects.requireNonNull(element));
    return (Datatype.Builder) this;
  }
942248
private void parseFault(BeanDefinitionBuilder builder, Element faultElement) {
        if (faultElement != null) {
            Element faultCodeElement = DomUtils.getChildElementByTagName(faultElement, "fault-code");
            if (faultCodeElement != null) {
                builder.addPropertyValue("faultCode", DomUtils.getTextValue(faultCodeElement).trim());
            }

            Element faultStringElement = DomUtils.getChildElementByTagName(faultElement, "fault-string");
            if (faultStringElement != null) {
                builder.addPropertyValue("faultString", DomUtils.getTextValue(faultStringElement).trim());
            }

            Element faultActorElement = DomUtils.getChildElementByTagName(faultElement, "fault-actor");
            if (faultActorElement != null) {
                builder.addPropertyValue("faultActor", DomUtils.getTextValue(faultActorElement).trim());
            }

            parseFaultDetail(builder, faultElement);
        }
    }
561669
private void buildConstructor( TypeSpec.Builder typeBuilder ) {
        MethodSpec.Builder constructorBuilder = MethodSpec.constructorBuilder().addModifiers( Modifier.PUBLIC );

        if ( !beanInfo.getParameterizedTypes().isEmpty() ) {
            Class mapperClass;
            String mapperNameFormat;
            if ( isSerializer() ) {
                mapperClass = Serializer.class;
                mapperNameFormat = TYPE_PARAMETER_SERIALIZER_FIELD_NAME;
            } else {
                mapperClass = Deserializer.class;
                mapperNameFormat = TYPE_PARAMETER_DESERIALIZER_FIELD_NAME;
            }

            for ( int i = 0; i < beanInfo.getParameterizedTypes().size(); i++ ) {
                JClassType argType = beanInfo.getParameterizedTypes().get( i );
                String mapperName = String.format( mapperNameFormat, i );
                TypeName mapperType = parameterizedName( mapperClass, argType );

                FieldSpec field = FieldSpec.builder( mapperType, mapperName, Modifier.PRIVATE, Modifier.FINAL ).build();
                typeBuilder.addField( field );

                ParameterSpec parameter = ParameterSpec.builder( mapperType, mapperName ).build();
                constructorBuilder.addParameter( parameter );
                constructorBuilder.addStatement( "this.$N = $N", field, parameter );
            }
        }

        typeBuilder.addMethod( constructorBuilder.build() );
    }
1109265
public Metadata parse(Element element, ParserContext context) throws Exception {
        MutableBeanMetadata beanMetadata = context.createMetadata(MutableBeanMetadata.class);
        beanMetadata.setRuntimeClass(getRuntimeClass());
        beanMetadata.setActivation(BeanMetadata.ACTIVATION_EAGER);
        beanMetadata.setScope(BeanMetadata.SCOPE_SINGLETON);
        beanMetadata.setId(getId(element));
        beanMetadata.setInitMethod("start");
        beanMetadata.setDestroyMethod("stop");
        beanMetadata.addProperty("bundleContext", createRef(context, "blueprintBundleContext"));
        extractRemainingMetaData(element, context, beanMetadata);
        return beanMetadata;
    }
347068
private void parseFunctionDefinitions(BeanDefinitionBuilder builder, Element element) {
        ManagedMap<String, Object> functions = new ManagedMap<String, Object>();
        for (Element function : DomUtils.getChildElementsByTagName(element, "function")) {
            if (function.hasAttribute("ref")) {
                functions.put(function.getAttribute("name"), new RuntimeBeanReference(function.getAttribute("ref")));
            } else {
                functions.put(function.getAttribute("name"), BeanDefinitionBuilder.rootBeanDefinition(function.getAttribute("class")).getBeanDefinition());
            }
        }

        if (!functions.isEmpty()) {
            builder.addPropertyValue("members", functions);
        }
    }
1172123
private ClassBuilder getClassBuilder(Element element) {
        ClassBuilder classBuilder = new ClassBuilder(messager, element);
        classBuilder.setBindingManager(this);
        return classBuilder;
    }
445882
protected void importXMLBuilderImpl(BaseXMLBuilder builder) {
        assertElementContainsNoOrWhitespaceOnlyTextNodes(this.xmlNode);
        Node importedNode = getDocument().importNode(
            builder.getDocument().getDocumentElement(), true);
        this.xmlNode.appendChild(importedNode);
    }
359694
protected function setDefaultElementValue(ElementInterface $element)
    {
        $propertyPath = $element->getPropertyPath();
        
        if ($propertyPath instanceof PropertyPathInterface) {
            if ($this->propertyAccessor->isReadable($this->data, $propertyPath)) {
                $value = $this->propertyAccessor->getValue($this->data, $propertyPath);
                if ($this->isEmptyValue($value)) {
                    $value = $element->getDefaultValue();
                }
                
                if ($element->hasTransformer() && is_object($value)) {
                    $transformer = $element->getTransformer();
                    $value       = $transformer->transform($value);
                }
                
                $element->setValue($value);
            }
        }
    }
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);
			}
		}
	}
1124261
public static void setPropertyReference(BeanDefinitionBuilder builder, String beanReference, String propertyName) {
        if (StringUtils.hasText(beanReference)) {
            builder.addPropertyReference(propertyName, beanReference);
        }
    }