1 61 62 package org.jaxen.pattern; 63 64 import org.jaxen.Context; 65 import org.jaxen.JaxenException; 66 67 73 public abstract class Pattern { 74 75 77 public static final short ELEMENT_NODE = 1; 78 79 public static final short ATTRIBUTE_NODE = 2; 80 81 public static final short TEXT_NODE = 3; 82 83 public static final short CDATA_SECTION_NODE = 4; 84 85 public static final short ENTITY_REFERENCE_NODE = 5; 86 87 89 public static final short PROCESSING_INSTRUCTION_NODE = 7; 90 91 public static final short COMMENT_NODE = 8; 92 93 public static final short DOCUMENT_NODE = 9; 94 95 public static final short DOCUMENT_TYPE_NODE = 10; 96 99 100 public static final short NAMESPACE_NODE = 13; 102 103 104 public static final short UNKNOWN_NODE = 14; 105 106 107 public static final short MAX_NODE_TYPE = 14; 108 109 110 public static final short ANY_NODE = 0; 111 112 113 public static final short NO_NODE = 14; 114 115 116 123 public abstract boolean matches( Object node, Context context ) throws JaxenException; 124 125 134 public double getPriority() 135 { 136 return 0.5; 137 } 138 139 147 public Pattern[] getUnionPatterns() 148 { 149 return null; 150 } 151 152 153 158 public short getMatchType() 159 { 160 return ANY_NODE; 161 } 162 163 164 173 public String getMatchesNodeName() 174 { 175 return null; 176 } 177 178 179 public Pattern simplify() 180 { 181 return this; 182 } 183 184 188 public abstract String getText(); 189 190 } 191 | Popular Tags |