Package org.eclipse.wst.xml.core.internal.contentmodel

Examples of org.eclipse.wst.xml.core.internal.contentmodel.CMNode


      return null;

    List nodes = ModelQueryUtil.getModelQuery(getOwnerDocument()).getAvailableContent(getOwnerElement(), elementDecl, ModelQuery.INCLUDE_ATTRIBUTES);
    String name = getName();
    for (int k = 0; k < nodes.size(); k++) {
      CMNode cmnode = (CMNode) nodes.get(k);
      if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION && name.equals(cmnode.getNodeName())) {
        return (CMAttributeDeclaration) cmnode;
      }
    }
    return null;
  }
View Full Code Here


   */
  public CMNamedNodeMap getDeclarations(String[] names) {
    CMNamedNodeMapImpl map = new CMNamedNodeMapImpl();
    for (int i = 0; i < names.length; i++) {
      String name = names[i];
      CMNode node = getNamedItem(name);
      if (node == null)
        continue;
      map.putNamedItem(name, node);
    }
    return map;
View Full Code Here

   * @param names java.util.Iterator
   */
  public void getDeclarations(CMGroupImpl group, Iterator names) {
    while (names.hasNext()) {
      String entityName = (String) names.next();
      CMNode dec = getNamedItem(entityName);
      if (dec != null)
        group.appendChild(dec);
    }
  }
View Full Code Here

   * @param index int
   */
  public CMNode item(int index) {
    if (!isValidID(index))
      return null;
    CMNode decl = fDecls[index];
    if (decl != null)
      return decl; // already exist.

    decl = create(getName(index));
    fDecls[index] = decl;
View Full Code Here

   *            int
   */
  public CMNode item(int index) {
    Iterator iter = iterator();
    while (iter.hasNext()) {
      CMNode node = (CMNode) iter.next();
      if (--index < 0)
        return node;
    }
    return null;
  }
View Full Code Here

  CMGroupImpl createContent(int eid) {
    if (eid == ID_UNKNOWN)
      return null;

    CMGroupImpl content = null;
    CMNode child = null;

    switch (eid) {
      //case Ids.ID_ACTIONLINK :
       
        //content = new CMGroupImpl(CMGroup.SEQUENCE, 0, CMContentImpl.UNBOUNDED);
View Full Code Here

  CMGroupImpl createContent(int eid) {
    if (eid == ID_UNKNOWN)
      return null;

    CMGroupImpl content = null;
    CMNode child = null;

    switch (eid) {
      case Ids.ID_ROOT :
        content = new CMGroupImpl(CMGroup.CHOICE, 0, CMContentImpl.UNBOUNDED);
        int validChildren[] = {
View Full Code Here

             * later.
             */
            int availableChildCount = availableChildElementDeclarations.size();
            String elementName = ced.getElementName().toLowerCase(Locale.US);
            for (int i = 0; i < availableChildCount; i++) {
              CMNode cmnode = (CMNode) availableChildElementDeclarations.get(i);
              if (cmnode.getNodeType() == CMNode.ELEMENT_DECLARATION && cmnode.getNodeName().toLowerCase(Locale.US).equals(elementName)) {
                return;
              }
            }
           
            error = ErrorState.INVALID_CONTENT_ERROR;
View Full Code Here

        if (modelQueryNodes == null)
          modelQueryNodes = ModelQueryUtil.getModelQuery(target.getOwnerDocument()).getAvailableContent((Element) node, edec, ModelQuery.INCLUDE_ATTRIBUTES);
       
       
        for (int k = 0; k < modelQueryNodes.size(); k++) {
          CMNode cmnode = (CMNode) modelQueryNodes.get(k);
          if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION && cmnode.getNodeName().toLowerCase(Locale.US).equals(attrName)) {
            adec = (CMAttributeDeclaration) cmnode;
            break;
          }
        }
      }
View Full Code Here

      return exclusion; // already created.
    if (elementCollection == null)
      return null;

    exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
    CMNode a = elementCollection.getNamedItem(CHTMLNamespace.ElementName.A);
    if (a != null)
      exclusion.appendChild(a);

    return exclusion;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.wst.xml.core.internal.contentmodel.CMNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.