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

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


    Node parent = node.getParentNode();
    String contextString = node.getNodeName();
    StringBuffer info = new StringBuffer(" "); //$NON-NLS-1$
    if ((parent != null) && (parent.getNodeType() == Node.ELEMENT_NODE)) {
      CMElementDeclaration decl = fModelUtil.getModelQuery().getCMElementDeclaration((Element) parent);
      CMContent content = decl.getContent();
      if (content instanceof CMGroup) {
        CMGroup cmGroup = (CMGroup) content;
        CMNodeList children = cmGroup.getChildNodes();
        CMNode cmNode = null;
        for (int i = 0; i < children.getLength(); i++) {
View Full Code Here


  public static boolean isValidChild(CMElementDeclaration parent, CMElementDeclaration child) {
    if (parent == null || child == null)
      return false;
    if (isHTML(parent) && (!isHTML(child)))
      return true;
    CMContent content = parent.getContent();
    if (content == null)
      return false;
    return isChild(content, child);
  }
View Full Code Here

    Collection inclusions = gatherInclusions(getAncestorDeclarations(target));

    Hashtable availables = new Hashtable();
    Iterator iter = inclusions.iterator();
    while (iter.hasNext()) {
      CMContent inclusion = (CMContent) iter.next();
      switch (inclusion.getNodeType()) {
        case CMNode.GROUP :
          extractDeclarations(availables, (CMGroup) inclusion);
          break;
        case CMNode.ELEMENT_DECLARATION :
          addInclusion(availables, (CMElementDeclaration) inclusion);
View Full Code Here

    Vector inclusions = new Vector();
    Iterator iter = ancestors.iterator();
    while (iter.hasNext()) {
      CMElementDeclaration decl = (CMElementDeclaration) iter.next();
      if (decl.supports(HTMLCMProperties.INCLUSION)) {
        CMContent inclusion = (CMContent) decl.getProperty(HTMLCMProperties.INCLUSION);
        if (inclusion != null)
          inclusions.add(inclusion);
      }
    }
    return inclusions;
View Full Code Here

   * Returns the root node of this element's content model.
   * This can be an CMElementDeclaration or a CMGroup
   */
  public CMContent getContent() {
    if (fCMContent == null) {
      CMContent content = fElementDecl.getContent();
      if (content == null)
        return null;
      if (content instanceof CMGroup)
        fCMContent = new CMGroupWrapperImpl(fPrefix, (CMGroup) content);
      else
View Full Code Here

  }

  private static boolean isValidChild(CMElementDeclaration parent, CMElementDeclaration child) {
    if (parent == null || child == null)
      return false;
    CMContent content = parent.getContent();
    if (content == null)
      return false;
    return isChild(content, child);
  }
View Full Code Here

      {       
        if (arc.kind == Arc.REPEAT)
        {         
          if (arc.cmNode instanceof CMContent)
          {
            CMContent content = (CMContent)arc.cmNode;
           
            // we only need to do 'special' facet checking if the maxOccurs is > 1
            // values of '0' and '-1' (unbounded) work 'for free' without any special checking
            //
            if (content.getMaxOccur() > 1)
            { 
              ItemCount itemCount = (ItemCount)activeItemCountList.get(activeItemCountList.size() - 1);
             
              // here we need to compute if we can do another repeat
              // if we increase the repeat count by '1' will this violate the maxOccurs
              //
              if (itemCount.count + 1 >= content.getMaxOccur())
              {
                result = false;
              }
            }
            //System.out.println("canPush REPEAT (" + itemCount.count + ")" + content.getNodeName() + " result= " + result);           
View Full Code Here

     
          boolean isGraphValidationNeeded = !(elementList == null && contentType == CMElementDeclaration.MIXED);
                     
          // explicitly handle 'All' groups
          //
          CMContent content = ed.getContent();
          if (content != null && content.getNodeType() == CMNode.GROUP)
          {
            CMGroup group = (CMGroup)content;
            if (group.getOperator() == CMGroup.ALL)
            {
              isGraphValidationNeeded = false;
View Full Code Here

      for (int j = list.getLength() - 1; j >= 0; j--)
      {
        CMNode node = list.item(j);     
        if (node.getNodeType() == CMNode.ELEMENT_DECLARATION)
        { 
          CMContent content = (CMContent)node;
          ItemCount itemCount = (ItemCount)map.get(node);
//          System.out.print("content " + content.getNodeName() + " " + content.getMinOccur());
          if (itemCount.count < content.getMinOccur())
          { 
            isValid = false;
            break;
         
        } 
View Full Code Here

            nextSiblingList.add(arc.cmNode);
            if (arc.cmNode.getNodeType() == CMNode.ELEMENT_DECLARATION ||
                arc.cmNode.getNodeType() == CMNode.ANY_ELEMENT)
            {             
              namedArcList.add(arc);
              CMContent cmNode = (CMContent)arc.cmNode;
              if (cmNode.getMinOccur() == 0)
              {
                unamedArcList = new ArrayList();
                collectNextSiblings(arc.node, nextSiblingList, namedArcList, unamedArcList, indent + 2);
              }
            }           
View Full Code Here

TOP

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

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.