/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @author Suresh Kumar
* @author Sunitha Reddy
* @since 1.6
*/
//private final static String EMPTYSTRING = "";
//private static final String XMLNS_PREFIX = "xmlns";
// StAX event source
//private Node _dom = null;
//private Hashtable _nsPrefixes = new Hashtable();
}
return _sax;
}
{
if (handler instanceof LexicalHandler) {
}
}
}
try {
bridge();
} catch (XMLStreamException e) {
throw new SAXException(e);
}
}
//Main Work Starts Here.
bridge();
}
/* public void parse() throws IOException, SAXException {
if (_dom != null) {
boolean isIncomplete =
(_dom.getNodeType() != org.w3c.dom.Node.DOCUMENT_NODE);
if (isIncomplete) {
_sax.startDocument();
parse(_dom);
_sax.endDocument();
}
else {
parse(_dom);
}
}
}
*/
/*
* @see StAXReaderToContentHandler#bridge()
*/
try {
// remembers the nest level of elements to know when we are done.
int depth=0;
boolean startedAtDocument = false;
throw new IllegalStateException();
}
startedAtDocument = true;
}
// Handle the prolog: http://www.w3.org/TR/REC-xml/#NT-prolog
switch (event.getEventType()) {
case XMLStreamConstants.CHARACTERS :
break;
break;
case XMLStreamConstants.COMMENT :
break;
case XMLStreamConstants.DTD :
handleDTD();
break;
case XMLStreamConstants.SPACE :
handleSpace();
break;
default :
}
}
// Process the (document) element
do {
// These are all of the events listed in the javadoc for
// XMLEvent.
// The spec only really describes 11 of them.
switch (event.getEventType()) {
case XMLStreamConstants.START_ELEMENT :
depth++;
break;
case XMLStreamConstants.END_ELEMENT :
depth--;
break;
case XMLStreamConstants.CHARACTERS :
break;
break;
break;
case XMLStreamConstants.COMMENT :
break;
case XMLStreamConstants.DTD :
handleDTD();
break;
case XMLStreamConstants.ATTRIBUTE :
break;
case XMLStreamConstants.NAMESPACE :
break;
case XMLStreamConstants.CDATA :
handleCDATA();
break;
break;
break;
case XMLStreamConstants.SPACE :
handleSpace();
break;
default :
}
} while (depth!=0);
if (startedAtDocument) {
// Handle the Misc (http://www.w3.org/TR/REC-xml/#NT-Misc) that can follow the document element
switch (event.getEventType()) {
case XMLStreamConstants.CHARACTERS :
break;
break;
case XMLStreamConstants.COMMENT :
break;
case XMLStreamConstants.SPACE :
handleSpace();
break;
default :
}
}
}
} catch (SAXException e) {
throw new XMLStreamException(e);
}
}
_sax.endDocument();
}
public int getColumnNumber() {
}
public int getLineNumber() {
}
public String getPublicId() {
}
public String getSystemId() {
}
public String getXMLVersion(){
return version;
}
public String getEncoding(){
return encoding;
}
});
}
throws XMLStreamException {
try {
} catch (SAXException e) {
throw new XMLStreamException(e);
}
}
try {
0,
} catch (SAXException e) {
throw new XMLStreamException(e);
}
}
//construct prefix:localName from qName
}
try {
// fire endElement
qname);
// end namespace bindings
prefix = "";
}
}
} catch (SAXException e) {
throw new XMLStreamException(e);
}
}
throws XMLStreamException {
try {
// start namespace bindings
prefix = "";
}
}
// fire startElement
} else {
}
saxAttrs);
} catch (SAXException e) {
throw new XMLStreamException(e);
}
}
/**
* Get the attributes associated with the given START_ELEMENT StAXevent.
*
* @return the StAX attributes converted to an org.xml.sax.Attributes
*/
if ( !event.isStartElement() ) {
throw new InternalError(
"getAttributes() attempting to process: " + event);
}
// in SAX, namespace declarations are not part of attributes by default.
// (there's a property to control that, but as far as we are concerned
// we don't use it.) So don't add xmlns:* to attributes.
// gather non-namespace attrs
uri = "";
}
} else {
}
}
return attrs;
}
private void handleNamespace() {
// no-op ???
// namespace events don't normally occur outside of a startElement
// or endElement
}
private void handleAttribute() {
// no-op ???
// attribute events don't normally occur outside of a startElement
// or endElement
}
private void handleDTD() {
// no-op ???
// it seems like we need to pass this info along, but how?
}
private void handleComment() {
// no-op ???
}
private void handleEntityReference() {
// no-op ???
}
private void handleSpace() {
// no-op ???
// this event is listed in the javadoc, but not in the spec.
}
private void handleNotationDecl() {
// no-op ???
// this event is listed in the javadoc, but not in the spec.
}
private void handleEntityDecl() {
// no-op ???
// this event is listed in the javadoc, but not in the spec.
}
private void handleCDATA() {
// no-op ???
// this event is listed in the javadoc, but not in the spec.
}
/**
* This class is only used internally so this method should never
* be called.
*/
return null;
}
/**
* This class is only used internally so this method should never
* be called.
*/
return null;
}
/**
* This class is only used internally so this method should never
* be called.
*/
{
return false;
}
/**
* This class is only used internally so this method should never
* be called.
*/
{
}
/**
* This class is only used internally so this method should never
* be called.
*/
throw new IOException("This method is not yet implemented.");
}
/**
* This class is only used internally so this method should never
* be called.
*/
}
/**
* This class is only used internally so this method should never
* be called.
*/
{
}
/**
* This class is only used internally so this method should never
* be called.
*/
return null;
}
/**
* This class is only used internally so this method should never
* be called.
*/
{
}
/**
* This class is only used internally so this method should never
* be called.
*/
}
/**
* This class is only used internally so this method should never
* be called.
*/
{
return null;
}
/**
* This class is only used internally so this method should never
* be called.
*/
public int getColumnNumber() {
return 0;
}
/**
* This class is only used internally so this method should never
* be called.
*/
public int getLineNumber() {
return 0;
}
/**
* This class is only used internally so this method should never
* be called.
*/
return null;
}
/**
* This class is only used internally so this method should never
* be called.
*/
return null;
}
}