1 61 62 package org.jaxen.pattern; 63 64 import org.jaxen.Context; 65 66 71 public class AnyChildNodeTest extends NodeTest { 72 73 private static AnyChildNodeTest instance = new AnyChildNodeTest(); 74 75 public static AnyChildNodeTest getInstance() 76 { 77 return instance; 78 } 79 80 public AnyChildNodeTest() 81 { 82 } 83 84 86 public boolean matches( Object node, Context context ) 87 { 88 short type = context.getNavigator().getNodeType( node ); 89 return type == ELEMENT_NODE || type == TEXT_NODE 90 || type == COMMENT_NODE || type == PROCESSING_INSTRUCTION_NODE; 91 } 92 93 public double getPriority() 94 { 95 return -0.5; 96 } 97 98 public short getMatchType() 99 { 100 return ANY_NODE; 101 } 102 103 public String getText() 104 { 105 return "*"; 106 } 107 108 } 109 | Popular Tags |