Exemple #1
0
 /**
  * Gets the appropriateSibling attribute of the Selector object
  *
  * @param e PARAM
  * @param treeRes
  * @return The appropriateSibling value
  */
 Object getAppropriateSibling(Object e, TreeResolver treeRes) {
   Object sibling = null;
   switch (_axis) {
     case IMMEDIATE_SIBLING_AXIS:
       sibling = treeRes.getPreviousSiblingElement(e);
       break;
     default:
       XRLog.exception("Bad sibling axis");
   }
   return sibling;
 }
Exemple #2
0
 /** Check if the given Element matches this selector. Note: the parser should give all class */
 public boolean matches(Object e, AttributeResolver attRes, TreeResolver treeRes) {
   if (siblingSelector != null) {
     Object sib = siblingSelector.getAppropriateSibling(e, treeRes);
     if (sib == null) {
       return false;
     }
     if (!siblingSelector.matches(sib, attRes, treeRes)) {
       return false;
     }
   }
   if (_name == null || treeRes.matchesElement(e, _namespaceURI, _name)) {
     if (conditions != null) {
       // all conditions need to be true
       for (java.util.Iterator i = conditions.iterator(); i.hasNext(); ) {
         Condition c = (Condition) i.next();
         if (!c.matches(e, attRes, treeRes)) {
           return false;
         }
       }
     }
     return true;
   }
   return false;
 }
Exemple #3
0
 boolean matches(Object e, AttributeResolver attRes, TreeResolver treeRes) {
   return treeRes.isLastChildElement(e);
 }