1 /* 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 /* this file is generated by RelaxNGCC */ 27 package com.sun.tools.internal.jxc.gen.config; 28 import org.xml.sax.SAXException; 29 import org.xml.sax.XMLReader; 30 import org.xml.sax.Attributes; 31 import com.sun.tools.internal.jxc.NGCCRuntimeEx; 32 33 import java.util.List; 34 import java.util.ArrayList; 35 36 37 public class Classes extends NGCCHandler { 38 private String __text; 39 private String exclude_content; 40 private String include_content; 41 protected final NGCCRuntimeEx $runtime; 42 private int $_ngcc_current_state; 43 protected String $uri; 44 protected String $localName; 45 protected String $qname; 46 47 public final NGCCRuntime getRuntime() { 48 return($runtime); 49 } 50 51 public Classes(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie) { 52 super(source, parent, cookie); 53 $runtime = runtime; 54 $_ngcc_current_state = 12; 55 } 56 57 public Classes(NGCCRuntimeEx runtime) { 58 this(null, runtime, runtime, -1); 59 } 60 61 private void action0()throws SAXException { 62 this.excludes.add(exclude_content); 63 } 64 65 private void action1()throws SAXException { 66 $runtime.processList(__text);} 67 68 private void action2()throws SAXException { 69 this.includes.add(include_content); 70 } 71 72 private void action3()throws SAXException { 73 $runtime.processList(__text);} 74 75 public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException { 76 int $ai; 77 $uri = $__uri; 78 $localName = $__local; 79 $qname = $__qname; 80 switch($_ngcc_current_state) { 81 case 4: 82 { 83 $_ngcc_current_state = 3; 84 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); 85 } 86 break; 87 case 11: 88 { 89 if(($__uri.equals("") && $__local.equals("includes"))) { 90 $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs); 91 $_ngcc_current_state = 10; 92 } 93 else { 94 unexpectedEnterElement($__qname); 95 } 96 } 97 break; 98 case 2: 99 { 100 if(($__uri.equals("") && $__local.equals("excludes"))) { 101 $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs); 102 $_ngcc_current_state = 6; 103 } 104 else { 105 $_ngcc_current_state = 1; 106 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs); 107 } 108 } 109 break; 110 case 0: 111 { 112 revertToParentFromEnterElement(this, super._cookie, $__uri, $__local, $__qname, $attrs); 113 } 114 break; 115 case 12: 116 { 117 if(($__uri.equals("") && $__local.equals("classes"))) { 118 $runtime.onEnterElementConsumed($__uri, $__local, $__qname, $attrs); 119 $_ngcc_current_state = 11; 120 } 121 else { 122 unexpectedEnterElement($__qname); 123 } 124 } 125 break; 126 default: 127 { 128 unexpectedEnterElement($__qname); 129 } 130 break; 131 } 132 } 133 134 public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException { 135 int $ai; 136 $uri = $__uri; 137 $localName = $__local; 138 $qname = $__qname; 139 switch($_ngcc_current_state) { 140 case 4: 141 { 142 $_ngcc_current_state = 3; 143 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); 144 } 145 break; 146 case 3: 147 { 148 if(($__uri.equals("") && $__local.equals("excludes"))) { 149 $runtime.onLeaveElementConsumed($__uri, $__local, $__qname); 150 $_ngcc_current_state = 1; 151 } 152 else { 153 unexpectedLeaveElement($__qname); 154 } 155 } 156 break; 157 case 1: 158 { 159 if(($__uri.equals("") && $__local.equals("classes"))) { 160 $runtime.onLeaveElementConsumed($__uri, $__local, $__qname); 161 $_ngcc_current_state = 0; 162 } 163 else { 164 unexpectedLeaveElement($__qname); 165 } 166 } 167 break; 168 case 8: 169 { 170 if(($__uri.equals("") && $__local.equals("includes"))) { 171 $runtime.onLeaveElementConsumed($__uri, $__local, $__qname); 172 $_ngcc_current_state = 2; 173 } 174 else { 175 unexpectedLeaveElement($__qname); 176 } 177 } 178 break; 179 case 2: 180 { 181 $_ngcc_current_state = 1; 182 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname); 183 } 184 break; 185 case 0: 186 { 187 revertToParentFromLeaveElement(this, super._cookie, $__uri, $__local, $__qname); 188 } 189 break; 190 default: 191 { 192 unexpectedLeaveElement($__qname); 193 } 194 break; 195 } 196 } 197 198 public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException { 199 int $ai; 200 $uri = $__uri; 201 $localName = $__local; 202 $qname = $__qname; 203 switch($_ngcc_current_state) { 204 case 4: 205 { 206 $_ngcc_current_state = 3; 207 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); 208 } 209 break; 210 case 2: 211 { 212 $_ngcc_current_state = 1; 213 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname); 214 } 215 break; 216 case 0: 217 { 218 revertToParentFromEnterAttribute(this, super._cookie, $__uri, $__local, $__qname); 219 } 220 break; 221 default: 222 { 223 unexpectedEnterAttribute($__qname); 224 } 225 break; 226 } 227 } 228 229 public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException { 230 int $ai; 231 $uri = $__uri; 232 $localName = $__local; 233 $qname = $__qname; 234 switch($_ngcc_current_state) { 235 case 4: 236 { 237 $_ngcc_current_state = 3; 238 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); 239 } 240 break; 241 case 2: 242 { 243 $_ngcc_current_state = 1; 244 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname); 245 } 246 break; 247 case 0: 248 { 249 revertToParentFromLeaveAttribute(this, super._cookie, $__uri, $__local, $__qname); 250 } 251 break; 252 default: 253 { 254 unexpectedLeaveAttribute($__qname); 255 } 256 break; 257 } 258 } 259 260 public void text(String $value) throws SAXException { 261 int $ai; 262 switch($_ngcc_current_state) { 263 case 4: 264 { 265 exclude_content = $value; 266 $_ngcc_current_state = 3; 267 action0(); 268 } 269 break; 270 case 3: 271 { 272 exclude_content = $value; 273 $_ngcc_current_state = 3; 274 action0(); 275 } 276 break; 277 case 9: 278 { 279 include_content = $value; 280 $_ngcc_current_state = 8; 281 action2(); 282 } 283 break; 284 case 10: 285 { 286 __text = $value; 287 $_ngcc_current_state = 9; 288 action3(); 289 } 290 break; 291 case 6: 292 { 293 __text = $value; 294 $_ngcc_current_state = 4; 295 action1(); 296 } 297 break; 298 case 8: 299 { 300 include_content = $value; 301 $_ngcc_current_state = 8; 302 action2(); 303 } 304 break; 305 case 2: 306 { 307 $_ngcc_current_state = 1; 308 $runtime.sendText(super._cookie, $value); 309 } 310 break; 311 case 0: 312 { 313 revertToParentFromText(this, super._cookie, $value); 314 } 315 break; 316 } 317 } 318 319 public void onChildCompleted(Object result, int cookie, boolean needAttCheck)throws SAXException { 320 switch(cookie) { 321 } 322 } 323 324 public boolean accepted() { 325 return(($_ngcc_current_state == 0)); 326 } 327 328 329 private List includes = new ArrayList(); 330 public List getIncludes() { return $runtime.getIncludePatterns(this.includes);} 331 private List excludes = new ArrayList(); 332 public List getExcludes() { return $runtime.getExcludePatterns(this.excludes);} 333 334 }