private void skipNonStartElements() throws XMLStreamException, EndDocumentException { while (true) { int event = next(); if (event == START_ELEMENT) { return; } } }
private void skipNonStartElements() throws XMLStreamException, EndDocumentException { while (true) { int event = next(); if (event == START_ELEMENT) { return; } } }
private void skipNonStartElements() throws XMLStreamException, EndDocumentException { while (true) { int event = next(); if (event == START_ELEMENT) { return; } } }
private void skipTree(String name) throws XMLStreamException, EndDocumentException { // The cursor is pointing at the start-element of name. // throw everything in this element away and return with the cursor // pointing at its end-element. while (true) { int event = next(); if (event == END_ELEMENT && name.equals(parser.getLocalName())) { //System.out.println("END: " + parser.getLocalName()); return; } } }
private void skipTree(String name) throws XMLStreamException, EndDocumentException { // The cursor is pointing at the start-element of name. // throw everything in this element away and return with the cursor // pointing at its end-element. while (true) { int event = next(); if (event == END_ELEMENT && name.equals(parser.getLocalName())) { //System.out.println("END: " + parser.getLocalName()); return; } } }
private void skipToEnd(String name) throws XMLStreamException, EndDocumentException { // The cursor is pointing who-knows-where // throw everything away and return with the cursor // pointing at the end-element. while (true) { int event = next(); if (event == END_ELEMENT && name.equals(parser.getLocalName())) { return; } } }
private void skipTree(String name) throws XMLStreamException, EndDocumentException { // The cursor is pointing at the start-element of name. // throw everything in this element away and return with the cursor // pointing at its end-element. while (true) { int event = next(); if (event == END_ELEMENT && name.equals(parser.getLocalName())) { //System.out.println("END: " + parser.getLocalName()); return; } } }
private void skipToEnd(String name) throws XMLStreamException, EndDocumentException { // The cursor is pointing who-knows-where // throw everything away and return with the cursor // pointing at the end-element. while (true) { int event = next(); if (event == END_ELEMENT && name.equals(parser.getLocalName())) { return; } } }
private void skipToEnd(String name) throws XMLStreamException, EndDocumentException { // The cursor is pointing who-knows-where // throw everything away and return with the cursor // pointing at the end-element. while (true) { int event = next(); if (event == END_ELEMENT && name.equals(parser.getLocalName())) { return; } } }
private void skipRoot(String name) throws XMLStreamException, EndDocumentException { // The cursor is pointing at the start of the document // Move to the first 'top-level' element under name // Return with cursor pointing to first sub-element while (true) { int event = next(); if (event == START_ELEMENT) { if (!name.equals(parser.getLocalName())) { throw new XMLStreamException("Unknown Domain XML Layout"); } return; } } }
private void skipRoot(String name) throws XMLStreamException, EndDocumentException { // The cursor is pointing at the start of the document // Move to the first 'top-level' element under name // Return with cursor pointing to first sub-element while (true) { int event = next(); if (event == START_ELEMENT) { if (!name.equals(parser.getLocalName())) { throw new XMLStreamException("Unknown Domain XML Layout"); } return; } } }
private void skipRoot(String name) throws XMLStreamException, EndDocumentException { // The cursor is pointing at the start of the document // Move to the first 'top-level' element under name // Return with cursor pointing to first sub-element while (true) { int event = next(); if (event == START_ELEMENT) { if (!name.equals(parser.getLocalName())) { throw new XMLStreamException("Unknown Domain XML Layout"); } return; } } }
/** * The cursor will be pointing at the START_ELEMENT of name when it returns note that skipTree must be called. * Otherwise we could be fooled by a sub-element with the same name as an outer element Multiple startNames are * accepted. * * @param endName the Element to skip to * @throws XMLStreamException */ private boolean skipToButNotPast(String endName, String... startNames) throws XMLStreamException, EndDocumentException { while (true) { int event = next(); if (event == START_ELEMENT) { for (String s : startNames) { if (parser.getLocalName().equals(s)) { return true; } } } if (event == END_ELEMENT) { if (parser.getLocalName().equals(endName)) { return false; } } } }
/** * The cursor will be pointing at the START_ELEMENT of name when it returns note that skipTree must be called. * Otherwise we could be fooled by a sub-element with the same name as an outer element Multiple startNames are * accepted. * * @param endName the Element to skip to * @throws XMLStreamException */ private boolean skipToButNotPast(String endName, String... startNames) throws XMLStreamException, EndDocumentException { while (true) { int event = next(); if (event == START_ELEMENT) { for (String s : startNames) { if (parser.getLocalName().equals(s)) { return true; } } } if (event == END_ELEMENT) { if (parser.getLocalName().equals(endName)) { return false; } } } }
private void parseSysPropsFromServer() throws XMLStreamException, EndDocumentException { // cursor --> <server> // these are the system-properties that OVERRIDE the ones in the <config> while (true) { int event = next(); // return when we get to the </config> if (event == END_ELEMENT) { if ("server".equals(parser.getLocalName())) { return; } } else if (event == START_ELEMENT) { String name = parser.getLocalName(); if ("system-property".equals(name)) { parseSystemProperty(SysPropsHandler.Type.SERVER); } else { skipTree(name); } } } }
private void parseSysPropsFromServer() throws XMLStreamException, EndDocumentException { // cursor --> <server> // these are the system-properties that OVERRIDE the ones in the <config> while (true) { int event = next(); // return when we get to the </config> if (event == END_ELEMENT) { if ("server".equals(parser.getLocalName())) { return; } } else if (event == START_ELEMENT) { String name = parser.getLocalName(); if ("system-property".equals(name)) { parseSystemProperty(SysPropsHandler.Type.SERVER); } else { skipTree(name); } } } }
private void parseSysPropsFromServer() throws XMLStreamException, EndDocumentException { // cursor --> <server> // these are the system-properties that OVERRIDE the ones in the <config> while (true) { int event = next(); // return when we get to the </config> if (event == END_ELEMENT) { if ("server".equals(parser.getLocalName())) { return; } } else if (event == START_ELEMENT) { String name = parser.getLocalName(); if ("system-property".equals(name)) { parseSystemProperty(SysPropsHandler.Type.SERVER); } else { skipTree(name); } } } }
private void parseNetworkConfig() throws XMLStreamException, EndDocumentException { // cursor --> <network-config> while (true) { int event = next(); // return when we get to the </network-config> if (event == END_ELEMENT) { if ("network-config".equals(parser.getLocalName())) { return; } } else if (event == START_ELEMENT) { String name = parser.getLocalName(); if ("protocols".equals(name)) { parseProtocols(); } else if ("network-listeners".equals(name)) { parseListeners(); } else skipTree(name); } } }
private void parseNetworkConfig() throws XMLStreamException, EndDocumentException { // cursor --> <network-config> while (true) { int event = next(); // return when we get to the </network-config> if (event == END_ELEMENT) { if ("network-config".equals(parser.getLocalName())) { return; } } else if (event == START_ELEMENT) { String name = parser.getLocalName(); if ("protocols".equals(name)) { parseProtocols(); } else if ("network-listeners".equals(name)) { parseListeners(); } else skipTree(name); } } }
private void parseNetworkConfig() throws XMLStreamException, EndDocumentException { // cursor --> <network-config> while (true) { int event = next(); // return when we get to the </network-config> if (event == END_ELEMENT) { if ("network-config".equals(parser.getLocalName())) { return; } } else if (event == START_ELEMENT) { String name = parser.getLocalName(); if ("protocols".equals(name)) { parseProtocols(); } else if ("network-listeners".equals(name)) { parseListeners(); } else skipTree(name); } } }