Examples of CFNodeList


Examples of org.cfeclipse.cfml.parser.CFNodeList

  {
    return false;
  }
 
  private CFNodeList selectNodes(XPathSearch search) {
    CFNodeList result = new CFNodeList();   
   
    if(docNodes == null) {
      docNodes = new CFNodeList();
    }

    for(int i = 0; i < docNodes.size(); i++)
    {
      DocItem currItem = (DocItem)docNodes.get(i);
      DocItem endItem = null;
      if (search.searchForEndTag
              && currItem.getMatchingItem() != null) {
          endItem = currItem.getMatchingItem();
      }

      int matches = 0;
      int endMatches = 0;
     
      if(search.doChildNodes)
        result.addAll(currItem.selectNodes(search));
     
      //r2 added simple * node selection
      if(search.searchForTag
        && (currItem.getName().compareToIgnoreCase(search.tagName) == 0
                || search.tagName.equals("*"))
      ) {
        matches++;
      }
      if (endItem != null
              && search.searchForTag
          && (endItem.getName().compareToIgnoreCase(search.tagName) == 0
                  || search.tagName.equals("*"))
        ) {
          endMatches++;
      }
     
  //System.out.print("DocItem::selectNodes() - Testing \'" + currItem.getName() + "\'");
      if(search.attrSearch.containsKey(XPathSearch.ATTR_STARTPOS)) {
        ComparisonType comp = (ComparisonType)search.attrSearch.get(XPathSearch.ATTR_STARTPOS);
    //System.out.println(XPathSearch.ATTR_STARTPOS + ": ");
        if(comp.performComparison(currItem.startPosition))
        {
          matches++;
          //System.out.print(" success ");
        }
        if (endItem != null
                && comp.performComparison(endItem.startPosition)) {
            endMatches++;
        }
         
      }
      if(search.attrSearch.containsKey(XPathSearch.ATTR_ENDPOS)) {
    //System.out.print(XPathSearch.ATTR_ENDPOS + ":");
        ComparisonType comp = (ComparisonType)search.attrSearch.get(XPathSearch.ATTR_ENDPOS);
        if(comp.performComparison(currItem.endPosition)) {
          matches++;
      //System.out.print(" success ");
        }
        if (endItem != null
                && comp.performComparison(endItem.endPosition)) {
            endMatches++;
      //System.out.println(" failed ");
        }
      }
     
      if(matches == search.getMatchesRequired())
      {
      //System.out.println("DocItem::selectNodes(XPathSearch) - Got match for " + currItem.itemName);
        result.add(currItem);
        //System.out.print(" name match success");
      }
      else if(endItem != null
              && endMatches == search.getMatchesRequired()){
          result.add(currItem);
          //System.out.println(" End matched " + endItem.getMatchingItem());
    //System.out.print(" name match failed with ");
      }
     
  //System.out.println("");
View Full Code Here

Examples of org.cfeclipse.cfml.parser.CFNodeList

      if(doc == null) {  // OBT: Added to handle when the parse fatally fails.
        return null;
      }
      DocItem rootItem = doc.getDocumentRoot();

      CFNodeList nodes = rootItem.selectNodes("//cffunction");
     
      Iterator i = nodes.iterator();
      CFCMethodViewItem[] methods = new CFCMethodViewItem[nodes.size()];
      int index = 0;
      while(i.hasNext())
      {
        try {
          TagItem thisTag = (TagItem)i.next();
View Full Code Here

Examples of org.cfeclipse.cfml.parser.CFNodeList

     
      CFDocument parseResult = cfDoc.getParser().parseDoc();
      if(parseResult == null)
        return;
     
      CFNodeList methods = parseResult.getDocumentRoot().selectNodes("//cffunction");
      Iterator methodIter = methods.iterator();
      while(methodIter.hasNext())
      {
        CfmlTagItem item = (CfmlTagItem)methodIter.next();
       
        String methodName = item.getAttributeValue("name");
View Full Code Here

Examples of org.cfeclipse.cfml.parser.CFNodeList

          //System.out.println("test");
          ICFDocument cfDoc = (ICFDocument)doc;
          CFDocument docRoot = cfDoc.getCFDocument();
          String attrString = "[#startpos<" + docOffset + " and #endpos>" + docOffset + "]";
         
          CFNodeList matchingNodes = docRoot.getDocumentRoot().selectNodes("//cfinclude" + attrString);
          Iterator nodeIter = matchingNodes.iterator();
         
          CfmlTagItem currItem = null;
         
          if(nodeIter.hasNext())
          {
            currItem = (CfmlTagItem)nodeIter.next();
          }
          else
          {
            matchingNodes = docRoot.getDocumentRoot().selectNodes("//cfmodule" + attrString);
            nodeIter = matchingNodes.iterator();
            if(nodeIter.hasNext()) {
              currItem = (CfmlTagItem)nodeIter.next();
            }
            else
              return;
View Full Code Here

Examples of org.cfeclipse.cfml.parser.CFNodeList

    //check what type of document this is
   
   
    DocItem docroot  = cfdocument.getCFDocument().getDocumentRoot();
   
    CFNodeList nodes = docroot.selectNodes("//cfproperty");
    
    Iterator nodeIter = nodes.iterator();
   
    while(nodeIter.hasNext()){
      TagItem property = (TagItem)nodeIter.next();
      StringBuffer sb = new StringBuffer();
     
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.