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

Examples of org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl


      if (query != null) {
        CMElementDeclaration cmElement = query.getCMElementDeclaration(element);
        if (cmElement != null) {
          CMNamedNodeMap cmAttributes = null;

          CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl();
          List nodes = query.getAvailableContent(element, cmElement, ModelQuery.INCLUDE_ATTRIBUTES);
          for (int k = 0; k < nodes.size(); k++) {
            CMNode cmnode = (CMNode) nodes.get(k);
            if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
              allAttributes.put(cmnode);
            }
          }
          cmAttributes = allAttributes;

          boolean foundjspattribute = checkUnknownAttributes(element, cmElement, cmAttributes, reporter, file, model.getStructuredDocument(), documentRegion);
View Full Code Here


  private IPropertyDescriptor[] createPropertyDescriptors() {
    CMNamedNodeMap attrMap = null;
    CMElementDeclaration ed = getDeclaration();
    if (ed != null) {
      attrMap = ed.getAttributes();
      CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(attrMap);
      List nodes = ModelQueryUtil.getModelQuery(fNode.getOwnerDocument()).getAvailableContent((Element) fNode, ed, ModelQuery.INCLUDE_ATTRIBUTES);
      for (int k = 0; k < nodes.size(); k++) {
        CMNode cmnode = (CMNode) nodes.get(k);
        if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
          allAttributes.put(cmnode);
        }
      }
      attrMap = allAttributes;
    }
View Full Code Here

    CMNamedNodeMap attrDecls = null;

    CMElementDeclaration ed = getDeclaration();
    if (ed != null) {
      attrDecls = ed.getAttributes();
      CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(attrDecls);
      List nodes = ModelQueryUtil.getModelQuery(fNode.getOwnerDocument()).getAvailableContent((Element) fNode, ed, ModelQuery.INCLUDE_ATTRIBUTES);
      for (int k = 0; k < nodes.size(); k++) {
        CMNode cmnode = (CMNode) nodes.get(k);
        if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
          allAttributes.put(cmnode);
        }
      }
      attrDecls = allAttributes;
    }
View Full Code Here

    // Update any descriptors derived from the metainfo
    CMElementDeclaration ed = getDeclaration();
    CMNamedNodeMap attrMap = null;
    if (ed != null) {
      attrMap = ed.getAttributes();
      CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(attrMap);
      ModelQuery modelQuery = ModelQueryUtil.getModelQuery(fNode.getOwnerDocument());
      if(modelQuery != null) {
      List nodes = modelQuery.getAvailableContent((Element) fNode, ed, ModelQuery.INCLUDE_ATTRIBUTES);
        for (int k = 0; k < nodes.size(); k++) {
          CMNode cmnode = (CMNode) nodes.get(k);
          if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
            allAttributes.put(cmnode);
          }
        }
      }
      attrMap = allAttributes;
    }
View Full Code Here

    }

    // determine if attribute value is of type URI
    if (cmElement != null) {
      CMNamedNodeMap attrDecls = cmElement.getAttributes();
      CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(attrDecls);
      List nodes = ModelQueryUtil.getModelQuery(attr.getOwnerDocument()).getAvailableContent(attr.getOwnerElement(), cmElement, ModelQuery.INCLUDE_ATTRIBUTES);
      for (int k = 0; k < nodes.size(); k++) {
        CMNode cmnode = (CMNode) nodes.get(k);
        if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
          allAttributes.put(cmnode);
        }
      }
      attrDecls = allAttributes;

      CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) attrDecls.getNamedItem(attrName);
View Full Code Here

    CMAttributeDeclaration attrDecl = null;

    if (elementDecl != null) {
      CMNamedNodeMap attributes = elementDecl.getAttributes();
     
      CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(attributes);
      List nodes = ModelQueryUtil.getModelQuery(node.getOwnerDocument()).getAvailableContent((Element) node, elementDecl, ModelQuery.INCLUDE_ATTRIBUTES);
      for (int k = 0; k < nodes.size(); k++) {
        CMNode cmnode = (CMNode) nodes.get(k);
        if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
          allAttributes.put(cmnode);
        }
      }
      attributes = allAttributes;

      String noprefixName = DOMNamespaceHelper.getUnprefixedName(attName);
View Full Code Here

    // retrieve the list of attributes
    CMElementDeclaration elementDecl = getCMElementDeclaration(node);
    if (elementDecl != null) {
      CMNamedNodeMap attributes = elementDecl.getAttributes();
     
      CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(attributes);
      if (node.getNodeType() == Node.ELEMENT_NODE) {
        List nodes = ModelQueryUtil.getModelQuery(node.getOwnerDocument()).getAvailableContent((Element) node, elementDecl, ModelQuery.INCLUDE_ATTRIBUTES);
        for (int k = 0; k < nodes.size(); k++) {
          CMNode cmnode = (CMNode) nodes.get(k);
          if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
            allAttributes.put(cmnode);
          }
        }
      }
      attributes = allAttributes;
View Full Code Here

      // retrieve the
      // declaration for the attribute otherwise
      if (elementDecl != null) {
        CMNamedNodeMap attributes = elementDecl.getAttributes();

        CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(attributes) {
          private Map caseInsensitive;
         
          private Map getCaseInsensitiveMap() {
            if(caseInsensitive == null)
              caseInsensitive = new HashMap();
            return caseInsensitive;
          }

          public CMNode getNamedItem(String name) {
            CMNode node = super.getNamedItem(name);
            if (node == null) {
              node = (CMNode) getCaseInsensitiveMap().get(name.toLowerCase(Locale.US));
            }
            return node;
          }

          public void put(CMNode cmNode) {
            super.put(cmNode);
            getCaseInsensitiveMap().put(cmNode.getNodeName().toLowerCase(Locale.US), cmNode);
          }
        };
        if (node.getNodeType() == Node.ELEMENT_NODE) {
          List nodes = ModelQueryUtil.getModelQuery(node.getOwnerDocument()).getAvailableContent((Element) node, elementDecl, ModelQuery.INCLUDE_ATTRIBUTES);
          for (int k = 0; k < nodes.size(); k++) {
            CMNode cmnode = (CMNode) nodes.get(k);
            if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
              allAttributes.put(cmnode);
            }
          }
        }
        attributes = allAttributes;
View Full Code Here

        // filter on whatever user typed for element name already
        if (beginsWith(cmnodeName, elementMatchString)) {
          if (cmnode.getNodeType() == CMNode.ELEMENT_DECLARATION) {
            cmattrMap = ((CMElementDeclaration) cmnode).getAttributes();

            CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(cmattrMap);
            List nodes = ModelQueryUtil.getModelQuery(node.getOwnerDocument()).getAvailableContent((Element) node, (CMElementDeclaration) cmnode, ModelQuery.INCLUDE_ATTRIBUTES);
            for (int k = 0; k < nodes.size(); k++) {
              CMNode adnode = (CMNode) nodes.get(k);
              if (adnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
                allAttributes.put(adnode);
              }
            }
            cmattrMap = allAttributes;
           
            // iterate possible attributes from a cmnode in
View Full Code Here

              while ((i < attributes.getLength()) && (idTypedAttribute == null)) {
                Node attr = attributes.item(i);
                String attrName = attr.getNodeName();
                CMNamedNodeMap attributeDeclarationMap = elementDecl.getAttributes();
               
                CMNamedNodeMapImpl allAttributes = new CMNamedNodeMapImpl(attributeDeclarationMap);
                List nodes = ModelQueryUtil.getModelQuery(node.getOwnerDocument()).getAvailableContent(element, elementDecl, ModelQuery.INCLUDE_ATTRIBUTES);
                for (int k = 0; k < nodes.size(); k++) {
                  CMNode cmnode = (CMNode) nodes.get(k);
                  if (cmnode.getNodeType() == CMNode.ATTRIBUTE_DECLARATION) {
                    allAttributes.put(cmnode);
                  }
                }
                attributeDeclarationMap = allAttributes;

                CMAttributeDeclaration attrDecl = (CMAttributeDeclaration) attributeDeclarationMap.getNamedItem(attrName);
View Full Code Here

TOP

Related Classes of org.eclipse.wst.xml.core.internal.contentmodel.basic.CMNamedNodeMapImpl

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.