Gets the data or creates an empty list if it does not exist yet.
@param el the element
@param pseudo a pseudo-element or null, if no pseudo-element is required
@return the stored data
554344
public D getOrCreate(E el, P pseudo)
    {
        D ret;
        if (pseudo == null)
        {
            ret = mainMap.get(el);
            if (ret == null)
            {
                ret = createDataInstance();
                mainMap.put(el, ret);
            }
        }
        else
        {
            HashMap<P, D> map = pseudoMaps.get(el);
            if (map == null)
            {
                map = new HashMap<P, D>();
                pseudoMaps.put(el, map);
            }
            ret = map.get(pseudo);
            if (ret == null)
            {
                ret = createDataInstance();
                map.put(pseudo, ret);
            }
        }
        return ret;
    }
901988
public void put(E el, P pseudo, D data)
    {
        if (pseudo == null)
            mainMap.put(el, data);
        else
        {
            HashMap<P, D> map = pseudoMaps.get(el);
            if (map == null)
            {
                map = new HashMap<P, D>();
                pseudoMaps.put(el, map);
            }
            map.put(pseudo, data);
        }
    }
341294
@SuppressWarnings("unchecked")
    public Map<String, V> getData() {
        final TreeMap<String, V> result = new TreeMap<>(); // returned map must be sorted
        for (int i = 0; i < data.size(); i++) {
            // The Eclipse compiler does not need the typecast to V, but the Oracle compiler sure does.
            result.put(data.getKeyAt(i), (V) data.getValueAt(i));
        }
        return Collections.unmodifiableMap(result);
    }
730274
private Node createPseudoElement(ElementBox box, PseudoElementType pseudo) 
    {
        Element n = box.getElement();
        //New box style
        NodeData style = decoder.getElementStyleInherited(n, pseudo);
        if (style != null)
        {
            TermList cont = style.getValue(TermList.class, "content");
            if (cont != null && cont.size() > 0)
            {
                //create the DOM tree for the pseudo element
                //parent
                Element pelem = createAnonymousElement(n.getOwnerDocument(), "XPspan", "inline"); 
                //content elements
                for (Term<?> c : cont)
                {
                    if (c instanceof TermIdent)
                    {
                    }
                    else if (c instanceof TermString)
                    {
                        Text txt = n.getOwnerDocument().createTextNode(((TermString) c).getValue());
                        pelem.appendChild(txt);
                    }
                    else if (c instanceof TermURI)
                    {
                    }
                    else if (c instanceof TermFunction.Attr)
                    {
                        TermFunction.Attr f = (TermFunction.Attr) c;
                        String val = HTMLNorm.getAttribute(n, f.getName());
                        Text txt = n.getOwnerDocument().createTextNode(val);
                        pelem.appendChild(txt);
                    }
                }

                //use the pseudo element style for the new (main) element
                decoder.useStyle(pelem, null, style);

                return pelem;
            }
            else
                return null; //no contents
        }
        else
            return null; //no pseudo declaration
    }
1214328
private void add(Iterable<?> data) {

    for (Object el : data) {
      try {
        add(SoyData.createFromExistingData(el));

      } catch (SoyDataException sde) {
        sde.prependIndexToDataPath(list.size());
        throw sde;
      }
    }
  }
823841
public static Element dataElement(Element context, String name) {
        return context != null ? context.querySelector("[data-element=" + name + "]") : null;
    }
432704
int insertElement(int list, int beforeNode, int data) {
		int node = newNode_();
		int prev = -1;
		if (beforeNode != nullNode()) {
			prev = getPrev(beforeNode);
			setPrev_(beforeNode, node);
		}

		setNext_(node, beforeNode);
		if (prev != nullNode())
			setNext_(prev, node);

		int head = m_lists.getField(list, 0);

		if (beforeNode == head)
			m_lists.setField(list, 0, node);
		if (beforeNode == nullNode()) {
			int tail = m_lists.getField(list, 1);
			setPrev_(node, tail);
			if (tail != -1)
				setNext_(tail, node);

			m_lists.setField(list, 1, node);
		}

		setData(node, data);
		setListSize_(list, getListSize(list) + 1);

		if (m_b_store_list_index_with_node)
			setList_(node, list);

		return node;
	}
600811
public void addDeclaration(Element el, PseudoElementType pseudo, Declaration decl)
    {
        List<Declaration> list = getOrCreate(el, pseudo);
        list.add(decl);
    }
1163078
protected static CannotParseException missingXmlElements(ICalDataType... dataTypes) {
		String[] elements = new String[dataTypes.length];
		for (int i = 0; i < dataTypes.length; i++) {
			ICalDataType dataType = dataTypes[i];
			elements[i] = (dataType == null) ? "unknown" : dataType.getName().toLowerCase();
		}
		return missingXmlElements(elements);
	}
406886
public Element toElement(JdbcDatastore datastore) {
        final Element ds = getDocument().createElement("jdbc-datastore");
        ds.setAttribute("name", datastore.getName());
        if (!StringUtils.isNullOrEmpty(datastore.getDescription())) {
            ds.setAttribute("description", datastore.getDescription());
        }

        String jndiUrl = datastore.getDatasourceJndiUrl();
        if (Strings.isNullOrEmpty(jndiUrl)) {
            appendElement(ds, "url", datastore.getJdbcUrl());
            appendElement(ds, "driver", datastore.getDriverClass());
            appendElement(ds, "username", datastore.getUsername());
            appendElement(ds, "password", datastore.getPassword());
            appendElement(ds, "multiple-connections", datastore.isMultipleConnections() + "");
        } else {
            appendElement(ds, "datasource-jndi-url", jndiUrl);
        }

        final TableType[] tableTypes = datastore.getTableTypes();
        if (tableTypes != null && tableTypes.length != 0 && !Arrays.equals(TableType.DEFAULT_TABLE_TYPES, tableTypes)) {
            final Element tableTypesElement = getDocument().createElement("table-types");
            ds.appendChild(tableTypesElement);

            for (final TableType tableType : tableTypes) {
                appendElement(tableTypesElement, "table-type", tableType.name());
            }
        }

        final String catalogName = datastore.getCatalogName();
        if (!Strings.isNullOrEmpty(catalogName)) {
            appendElement(ds, "catalog-name", catalogName);
        }

        return ds;
    }
551769
function getData(el, attr, isInt, prefix) {
    if (prefix === undefined) {
      prefix = 'wookmark-';
    }
    var val = el.getAttribute('data-' + prefix + attr);
    if (isInt === true) {
      return parseInt(val, 10);
    }
    return val;
  }
706587
@Override
    public final DataSource getNonJtaDataSource() {
        if (ivNonJtaDataSource == null || ivNonJtaDataSource instanceof GenericDataSource) { // d455055
            ivNonJtaDataSource = getJPADataSource(ivNonJtaDataSourceJNDIName);
        }
        return ivNonJtaDataSource;
    }
988967
public CmsContainerElement getSerializedElement(String data) throws SerializationException {

        return (CmsContainerElement)CmsRpcPrefetcher.getSerializedObjectFromString(getContainerpageService(), data);
    }
1099982
public CmsContainerElementData getElementData(
        CmsResource page,
        CmsContainerElementBean element,
        Collection<CmsContainer> containers)
    throws CmsException {

        Locale requestLocale = m_cms.getRequestContext().getLocale();
        m_cms.getRequestContext().setLocale(m_locale);
        element.initResource(m_cms);
        if (element.getResource().isFolder()) {
            return null;
        }
        CmsContainerElementData elementData = getBaseElementData(page, element);
        CmsFormatterConfiguration formatterConfiguraton = getFormatterConfiguration(element.getResource());
        Map<String, String> contents = new HashMap<String, String>();
        if (element.isGroupContainer(m_cms)) {
            Map<String, CmsContainer> containersByName = new HashMap<String, CmsContainer>();
            for (CmsContainer container : containers) {
                containersByName.put(container.getName(), container);
            }
            CmsXmlGroupContainer xmlGroupContainer = CmsXmlGroupContainerFactory.unmarshal(
                m_cms,
                element.getResource(),
                m_req);
            CmsGroupContainerBean groupContainer = xmlGroupContainer.getGroupContainer(m_cms);
            // make sure to use the content title and not the property title
            elementData.setTitle(groupContainer.getTitle());
            elementData.setTypes(groupContainer.getTypes());
            elementData.setDescription(groupContainer.getDescription());
            if (groupContainer.getTypes().isEmpty()) {
                if (groupContainer.getElements().isEmpty()) {
                    String emptySub = "<div>NEW AND EMPTY</div>";
                    for (CmsContainer cont : containersByName.values()) {
                        if (formatterConfiguraton.hasFormatter(cont.getType(), cont.getWidth())) {
                            contents.put(cont.getName(), emptySub);
                        }
                    }
                } else {
                    // TODO: throw appropriate exception
                    return null;
                }
            } else {

                // add formatter and content entries for the supported types
                for (CmsContainer cnt : containersByName.values()) {

                    String type = cnt.getType();
                    if (checkGroupAllowed(type, groupContainer)) {
                        contents.put(cnt.getName(), "<div>should not be used</div>");
                    }
                }
            }
            // add subitems
            List<String> subItems = new ArrayList<String>();

            for (CmsContainerElementBean subElement : groupContainer.getElements()) {
                // collect ids
                subItems.add(subElement.editorHash());
            }
            elementData.setSubItems(subItems);
        } else if (element.isInheritedContainer(m_cms)) {
            CmsInheritanceReferenceParser parser = new CmsInheritanceReferenceParser(m_cms);
            parser.parse(element.getResource());
            CmsInheritanceReference ref = parser.getReference(m_locale);
            String name = null;
            // check for new inheritance reference
            if (ref != null) {
                name = ref.getName();
                elementData.setDescription(ref.getDescription());
                elementData.setTitle(ref.getTitle());
            }
            for (CmsContainer container : containers) {
                if (formatterConfiguraton.hasFormatter(container.getType(), container.getWidth())) {
                    contents.put(container.getName(), "<div>should not be used</div>");
                }
            }

            List<CmsInheritanceInfo> inheritanceInfos = new ArrayList<CmsInheritanceInfo>();
            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(name)) {
                CmsInheritedContainerState result = OpenCms.getADEManager().getInheritedContainerState(
                    m_cms,
                    m_cms.addSiteRoot(m_currentPageUri),
                    name);
                for (CmsContainerElementBean subElement : result.getElements(true)) {
                    CmsInheritanceInfo inheritanceInfo = subElement.getInheritanceInfo();
                    inheritanceInfo.setClientId(subElement.editorHash());
                    inheritanceInfos.add(inheritanceInfo);
                }
            } else {
                // setting a new id for name, will be persisted once the inheritance reference is edited and saved.
                // use the structure id so it will always be the same for the resource
                name = element.getResource().getStructureId().toString();
            }
            elementData.setInheritanceInfos(inheritanceInfos);
            elementData.setInheritanceName(name);
        } else {

            for (CmsContainer cnt : containers) {
                boolean missesFormatterSetting = !elementData.getSettings().containsKey(
                    CmsFormatterConfig.getSettingsKeyForContainer(cnt.getName()));
                if (missesFormatterSetting) {
                    if (element.getFormatterId() == null) {
                        I_CmsFormatterBean formatter = getStartFormatter(
                            m_cms,
                            cnt,
                            m_adeConfig,
                            element,
                            CmsADESessionCache.getCache(m_req, m_cms));
                        if (formatter != null) {
                            elementData.getSettings().put(
                                CmsFormatterConfig.getSettingsKeyForContainer(cnt.getName()),
                                formatter.getId());
                            element.addFormatterSetting(cnt.getName(), formatter.getId());
                        }
                    } else {
                        Map<String, I_CmsFormatterBean> formatterSelection = formatterConfiguraton.getFormatterSelection(
                            cnt.getType(),
                            cnt.getWidth());
                        for (Entry<String, I_CmsFormatterBean> formatterEntry : formatterSelection.entrySet()) {
                            I_CmsFormatterBean formatter = formatterEntry.getValue();
                            String id = formatterEntry.getKey();
                            if (element.getFormatterId().equals(formatter.getJspStructureId())) {
                                elementData.getSettings().put(
                                    CmsFormatterConfig.getSettingsKeyForContainer(cnt.getName()),
                                    id);
                                break;
                            }
                        }
                    }
                }
            }
            // get the formatter configuration
            Map<String, String> contentsByName = getContentsByContainerName(element, containers);
            contents = contentsByName;
        }
        elementData.setContents(contents);
        m_cms.getRequestContext().setLocale(requestLocale);
        return elementData;
    }
1215308
public V get(final int key) {
		final int index = (key & 0x7FFFFFFF) % elementData.length;

		IntEntry<V> m = elementData[index];
		while (m != null) {
			if (key == m.key) {
				return m.value;
			}
			m = m.nextInSlot;
		}
		return null;
	}
176644
String getRequiredElem()
  {
		if (m_requiredFound == null)
			return null;
		Enumeration elems = m_requiredFound.elements();
		String s = "";
		boolean first = true;
		while (elems.hasMoreElements())
		{
			if (first)
				first = false;
			else
			 s = s + ", ";
			s = s + (String)elems.nextElement();
		}
    return s;
  }
1013489
@Override
    public Object[][] getDataByIndex(String indexes) {
        validateResourceParams(resource);
        Preconditions.checkArgument(!StringUtils.isEmpty(indexes), "Indexes cannot be empty");
        logger.entering(indexes);
        Object[][] requestedData = getDataByIndex(DataProviderHelper.parseIndexString(indexes));
        logger.exiting((Object[]) requestedData);
        return requestedData;
    }