/*
This method processes the elementNameRef and return all the properties

@param props

@param elementNameRef

@return
761725
public Properties processProps(Map<String, Object> props, String elementNameRef) {
        final Properties properties = new Properties();
        String pid = (String) props.get(elementNameRef);

        if (pid == null) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "pid null");
            }
        } else {
            ConfigurationAdmin configAdmin = configAdminRef.getServiceWithException();
            Configuration config = null;
            try {
                // We do not want to create a missing pid, only find one that we were told exists
                Configuration[] configList = configAdmin.listConfigurations(FilterUtils.createPropertyFilter("service.pid", pid));
                if (configList != null && configList.length > 0) {
                    //bind the config to this bundle so no one else can steal it
                    config = configAdmin.getConfiguration(pid, configAdminRef.getReference().getBundle().getLocation());
                }
            } catch (Exception e) {
                //do nothing
            }
            if (config != null) {
                // Just get the first one (there should only ever be one.. )
                Dictionary<String, ?> cProps = config.getProperties();
                Enumeration<String> keys = cProps.keys();
                while (keys.hasMoreElements()) {
                    String key = keys.nextElement();
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "found key: " + key);
                    }
                    // Skip certain keys
                    if (key.startsWith(".")
                            || key.startsWith("config.")
                            || key.startsWith("service.")
                            || key.equals("id")) {
                        continue;
                    }
                    Object value = cProps.get(key);
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "key: " + key + " value: " + value);
                    }
                    // For scope to claims map generate String array from comma delimited string
                    value = getValue(value);
                    properties.put(key, value);
                }
            }
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, elementNameRef + ": " + properties.toString());
        }
        return properties;
    }
1363353
@SuppressWarnings("unchecked")
	public <T> T getPropertyValue(ElementDescriptor<T> property)
	{
		if (mProperties == null)
		{
			return null;
		}
		return (T) mProperties.get(property);
	}
1051068
function transformElement({ name: type, attribs: props, children: childElements }) {
  transformStyle(props);
  rename(props, 'for', 'htmlFor');
  rename(props, 'class', 'className');
  if ('input' === type) {
    rename(props, 'checked', 'defaultChecked');
    rename(props, 'value', 'defaultValue');
  }
  let children = transformElements(childElements);

  if ('textarea' === type && children.length) {
    props.defaultValue = children[0];
    children = [];
  }

  return { type, props, children };
}
167623
@Requires({
    "processingEnv != null",
    "element != null"
  })
  @Ensures("result != null")
  public static Set<String> getImportNames(ProcessingEnvironment processingEnv,
      Element element) {
    Trees treeUtils = Trees.instance(processingEnv);
    if (treeUtils == null) {
      return Collections.emptySet();
    }

    TreePath path = treeUtils.getPath(element);
    if (path == null) {
      return Collections.emptySet();
    }

    CompilationUnitTree unitTree = path.getCompilationUnit();

    HashSet<String> importNames = new HashSet<String>();
    for (ImportTree importTree : unitTree.getImports()) {
      StringBuilder buffer = new StringBuilder();
      if (importTree.isStatic()) {
        buffer.append("static ");
      }
      /* TODO(lenh): Roll our own toString()? */
      buffer.append(importTree.getQualifiedIdentifier().toString());
      importNames.add(buffer.toString());
    }

    return importNames;
  }
1031450
protected Map<String, String> attributesByBeanRef(String beanRef) {
      Map<String, String> result = null;
      for (Entry<String, String> e : map.entrySet()) {
         final String k = e.getKey();
         if (k.startsWith(beanRef) && k.startsWith(DOT, beanRef.length())) {
            if (result == null) {
               result = new HashMap<String,String>();
            }
            result.put(k.substring(beanRef.length() + DOT.length()), e.getValue());
         }
      }
      if (result == null) {
         return Collections.emptyMap();
      } else {
         return result;
      }
   }
311490
private void putElement(final String elemName, final Attributes atts, final boolean removeConref) throws SAXException {
        //parameter boolean removeConref specifies whether to remove
        //conref information like @conref @conaction in current element
        //when copying it to pushcontent. True means remove and false means
        //not remove.
        final Set<String> namespaces = new HashSet<>();
        try {
            pushcontentWriter.writeStartElement(elemName);
            for (int index = 0; index < atts.getLength(); index++) {
                final String name = atts.getQName(index);
                if (!removeConref ||
                        !ATTRIBUTE_NAME_CONREF.equals(name) && !ATTRIBUTE_NAME_CONACTION.equals(name)) {
                    String value = atts.getValue(index);
                    if (ATTRIBUTE_NAME_HREF.equals(name) || ATTRIBUTE_NAME_CONREF.equals(name)) {
                        // adjust href for pushbefore and replace
                        value = replaceURL(value);
                    }
                    final int offset = atts.getQName(index).indexOf(":");
                    final String prefix = offset != -1 ? atts.getQName(index).substring(0, offset) : "";
                    if (!namespaces.contains(prefix)) {
                        namespaces.add(prefix);
                        if (!prefix.isEmpty()) {
                            pushcontentWriter.writeNamespace(prefix, atts.getURI(index));
                        }
                    }
                    pushcontentWriter.writeAttribute(prefix, atts.getURI(index), atts.getLocalName(index), value);
                }
            }
            //id attribute should only be added to the starting element
            //which dosen't have id attribute set
            if (ATTR_CONACTION_VALUE_PUSHREPLACE.equals(pushType) &&
                    atts.getValue(ATTRIBUTE_NAME_ID) == null &&
                    level == 1) {
                final String fragment = target.getFragment();
                if (fragment == null) {
                    //if there is no '#' in target string, report error
                    logger.error(MessageUtils.getMessage("DOTJ041E", target.toString()).toString());
                } else {
                    String id;
                    //has element id
                    if (fragment.contains(SLASH)) {
                        id = fragment.substring(fragment.lastIndexOf(SLASH) + 1);
                    } else {
                        id = fragment;
                    }
                    //add id attribute
                    pushcontentWriter.writeAttribute(ATTRIBUTE_NAME_ID, id);
                }
            }
        } catch (final XMLStreamException e) {
            throw new SAXException(e);
        }
    }
165383
private boolean processElementAttributes(Element element) {
    Attributes attributes = element.getAttributes();
    if (attributes == null) {
      return false;
    }

    boolean shouldPopContext = false;
    registerMandatoryAttributes(attributes);

    Attribute vForAttribute = attributes.get("v-for");
    Attribute slotScopeAttribute = attributes.get("slot-scope");
    if (vForAttribute != null || slotScopeAttribute != null) {
      // Add a context layer
      shouldPopContext = true;
      context.addContextLayer(vForAttribute != null);
    }

    if (vForAttribute != null) {
      String processedVForValue = processVForValue(vForAttribute.getValue());
      outputDocument.replace(vForAttribute.getValueSegment(), processedVForValue);
    }

    if (slotScopeAttribute != null) {
      String processedScopedSlotValue = processSlotScopeValue(slotScopeAttribute.getValue());
      outputDocument.replace(slotScopeAttribute.getValueSegment(), processedScopedSlotValue);
    }

    Optional<LocalComponent> localComponent = getLocalComponentForElement(element);

    Attribute refAttribute = attributes.get("ref");
    if (refAttribute != null) {
      result.addRef(
          refAttribute.getValue(),
          localComponent.map(LocalComponent::getComponentType)
              .orElse(getTypeFromDOMElement(element)),
          context.isInVFor()
      );
    }

    Map<String, Class<?>> elementPropertiesType = getPropertiesForDOMElement(element)
        .orElse(new HashMap<>());

    // Iterate on element attributes
    Set<LocalComponentProp> foundProps = new HashSet<>();
    for (Attribute attribute : element.getAttributes()) {
      String key = attribute.getKey();
      if ("v-for".equals(key) || "slot-scope".equals(key)) {
        continue;
      }

      if ("v-model".equals(key)) {
        processVModel(attribute);
        continue;
      }

      Optional<LocalComponentProp> optionalProp =
          localComponent.flatMap(lc -> lc.getPropForAttribute(attribute.getName()));
      optionalProp.ifPresent(foundProps::add);

      if (!VUE_ATTR_PATTERN.matcher(key).matches()) {
        optionalProp.ifPresent(this::validateStringPropBinding);
        continue;
      }

      context.setCurrentSegment(attribute);

      currentAttribute = attribute;
      currentProp = optionalProp.orElse(null);
      currentExpressionReturnType = getExpressionReturnTypeForAttribute(attribute,
          elementPropertiesType);
      String processedExpression = processExpression(attribute.getValue());

      if (attribute.getValueSegment() != null) {
        outputDocument.replace(attribute.getValueSegment(), processedExpression);
      }
    }

    localComponent.ifPresent(lc -> validateRequiredProps(lc, foundProps));

    return shouldPopContext;
  }
4120
function(el, name) {
  var readAll = arguments.length === 1;
  var domNames, domName, jsNames, jsName, value, idx, length;

  if (readAll) {
    domNames = Object.keys(el.attribs).filter(function(attrName) {
      return attrName.slice(0, dataAttrPrefix.length) === dataAttrPrefix;
    });
    jsNames = domNames.map(function(_domName) {
      return camelCase(_domName.slice(dataAttrPrefix.length));
    });
  } else {
    domNames = [dataAttrPrefix + cssCase(name)];
    jsNames = [name];
  }

  for (idx = 0, length = domNames.length; idx < length; ++idx) {
    domName = domNames[idx];
    jsName = jsNames[idx];
    if (hasOwn.call(el.attribs, domName)) {
      value = el.attribs[domName];

      if (hasOwn.call(primitives, value)) {
        value = primitives[value];
      } else if (value === String(Number(value))) {
        value = Number(value);
      } else if (rbrace.test(value)) {
        try {
          value = JSON.parse(value);
        } catch(e){ }
      }

      el.data[jsName] = value;
    }
  }

  return readAll ? el.data : value;
}
188845
def collect_properties(klass_name, element, doc)
    props = element.xpath(".//edm:Property", @ds_namespaces)
    key_elemnts = element.xpath(".//edm:Key//edm:PropertyRef", @ds_namespaces)
    keys = key_elemnts.collect { |k| k['Name'] }
    @class_metadata[klass_name] = build_property_metadata(props, keys)
    methods = props.collect { |p| p['Name'] }
    unless element["BaseType"].nil?
      base = element["BaseType"].split(".").last()
      baseType = doc.xpath("//edm:EntityType[@Name=\"#{base}\"]", @ds_namespaces).first()
      props = baseType.xpath(".//edm:Property", @ds_namespaces)
      @class_metadata[klass_name].merge!(build_property_metadata(props))
      methods = methods.concat(props.collect { |p| p['Name']})
    end
    methods
  end
237207
public static final ElemDesc getElemDesc(String name)
    {
        /* this method used to return m_dummy  when name was null
         * but now it doesn't check and and requires non-null name.
         */
        Object obj = m_elementFlags.get(name);
        if (null != obj)
            return (ElemDesc)obj;
        return m_dummy;
    }
918109
@Override
    public String elementAsString(Properties outputProperties) {
        try {
            return super.elementAsString(outputProperties);
        } catch (TransformerException e) {
            throw wrapExceptionAsRuntimeException(e);
        }
    }
242592
protected void parseProperties(Element element, Map<String, String> properties) {

    for (Element childElement : element.elements()) {
      if(PROPERTY.equals(childElement.getTagName())) {
        String resolved = PropertyHelper.resolveProperty(System.getProperties(), childElement.getText());
        properties.put(childElement.attribute(NAME), resolved);
      }
    }

  }
972334
protected <T extends AnnotatedElement> Map<T, PropertyInfo> resolve(String keyPrefix, T[] elements, Set<Class> resolvedConfigs) {
        Map<T, PropertyInfo> result = new HashMap<>();
        for (T element : elements) {
            try {
                result.putAll(resolveProperty(keyPrefix, element));
                result.putAll(resolveConfig(keyPrefix, element, resolvedConfigs));
            } catch (PropertyLoaderException e) {
                throw new PropertyLoaderException(String.format("Error while process %s", element), e);
            }
        }
        return result;
    }
867943
function Element (tagName, props, children) {
  if (!(this instanceof Element)) {
    if (!_.isArray(children) && children != null) {
      children = _.slice(arguments, 2).filter(_.truthy)
    }
    return new Element(tagName, props, children)
  }

  if (_.isArray(props)) {
    children = props
    props = {}
  }

  this.tagName = tagName
  this.props = props || {}
  this.children = children || []
  this.key = props
    ? props.key
    : void 666

  var count = 0

  _.each(this.children, function (child, i) {
    if (child instanceof Element) {
      count += child.count
    } else {
      children[i] = '' + child
    }
    count++
  })

  this.count = count
}
952636
@Override
    public BaseNode visitNameRef(FEEL_1_1Parser.NameRefContext ctx) {
        return ASTBuilderFactory.newNameRefNode( ctx, BuiltInType.UNKNOWN );
    }
480202
public PRIndirectReference getRefByName(String name) {
        FieldInformation fi = (FieldInformation)fieldByName.get(name);
        if (fi == null) return null;
        return fi.getRef();
    }
1203464
private static Map<String, String> getNamespaceBindings(Element element) {
    Map<String, String> namespaceMap = new HashMap<String, String>();
    getNamespaceBindings(element, namespaceMap);
    return namespaceMap;
  }