1 23 24 package org.xquark.xpath; 25 26 27 28 public final class Axis 29 { 30 31 34 public static final byte NONE = 0x00; 35 36 39 public static final byte SELF = 0x01; 40 41 44 public static final byte CHILD = 0x02; 45 46 51 public static final byte PARENT = 0x03; 52 53 58 public static final byte ANCESTOR = 0x04; 59 60 65 public static final byte ANCESTOR_OR_SELF = 0x05; 66 67 72 public static final byte DESCENDANT = 0x06; 73 74 78 public static final byte DESCENDANT_OR_SELF = 0x07; 79 80 85 public static final byte PRECEDING = 0x08; 86 87 92 public static final byte PRECEDING_SIBLING = 0x09; 93 94 100 public static final byte FOLLOWING = 0x0a; 101 102 107 public static final byte FOLLOWING_SIBLING = 0x0b; 108 109 113 public static final byte ATTRIBUTE = 0x0c; 114 115 119 public static final byte NAMESPACE = 0x0d; 120 121 124 static public final String [] AXISSTRINGS = { 125 "", 126 "self::", 127 "child::", 128 "parent::", 129 "ancestor::", 130 "ancestor-or-self::", 131 "descendant::", 132 "descendant-or-self::", 133 "preceding::", 134 "preceding-sibling::", 135 "following::", 136 "following-sibling::", 137 "attribute::", 138 "namespace::" 139 }; 140 141 public static String stringValue(byte axis) 142 { 143 switch(axis) 144 { 145 case SELF: 146 return "self::"; 147 case CHILD: 148 return "child::"; 149 case PARENT: 150 return "parent::"; 151 case ANCESTOR: 152 return "ancestor::"; 153 case ANCESTOR_OR_SELF: 154 return "ancestor-or-self::"; 155 case DESCENDANT: 156 return "descendant::"; 157 case DESCENDANT_OR_SELF: 158 return "descendant-or-self::"; 159 case PRECEDING: 160 return "preceding::"; 161 case PRECEDING_SIBLING: 162 return "preceding-sibling::"; 163 case FOLLOWING: 164 return "following::"; 165 case FOLLOWING_SIBLING: 166 return "following-sibling::"; 167 case ATTRIBUTE: 168 return "attribute::"; 169 case NAMESPACE: 170 return "namespace::"; 171 default: 172 return "unknown-axis::"; 173 } 174 } 175 176 } 177 | Popular Tags |