Here you can find the source of toReadableEvent(XMLStreamReader r)
Parameter | Description |
---|---|
r | The XML stream reader whose current event is to be converted to a readable string. |
public static final String toReadableEvent(XMLStreamReader r)
//package com.java2s; // * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * import javax.xml.stream.*; public class Main { /**/*from w w w . ja v a 2 s .co m*/ * Utility method that converts the current event on the XML stream to something human-readable for debug purposes. * * @param r The XML stream reader whose current event is to be converted to a readable string. * @return The event in human-readable form. */ public static final String toReadableEvent(XMLStreamReader r) { int t = r.getEventType(); if (t == 1) return "<" + r.getLocalName() + ">"; if (t == 2) return "</" + r.getLocalName() + ">"; if (t == 3) return "PROCESSING_INSTRUCTION"; if (t == 4) return "CHARACTERS=[" + r.getText() + "]"; if (t == 5) return "COMMENTS=[" + r.getText() + "]"; if (t == 6) return "SPACE=[" + r.getText() + "]"; if (t == 7) return "START_DOCUMENT"; if (t == 8) return "END_DOCUMENT"; if (t == 9) return "ENTITY_REFERENCE"; if (t == 10) return "ATTRIBUTE"; if (t == 11) return "DTD"; if (t == 12) return "CDATA=[" + r.getText() + "]"; if (t == 13) return "NAMESPACE"; if (t == 14) return "NOTATION_DECLARATION"; if (t == 15) return "ENTITY_DECLARATION"; return "UNKNOWN"; } }