< prev index next >
src/java.xml/share/classes/javax/xml/stream/XMLStreamWriter.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 190,200 ****
/**
* Writes a start tag to the output. All writeStartElement methods
* open a new scope in the internal namespace context. Writing the
* corresponding EndElement causes the scope to be closed.
* @param localName local name of the tag, may not be null
! * @throws XMLStreamException
*/
public void writeStartElement(String localName)
throws XMLStreamException;
/**
--- 190,200 ----
/**
* Writes a start tag to the output. All writeStartElement methods
* open a new scope in the internal namespace context. Writing the
* corresponding EndElement causes the scope to be closed.
* @param localName local name of the tag, may not be null
! * @throws XMLStreamException if an error occurs
*/
public void writeStartElement(String localName)
throws XMLStreamException;
/**
*** 210,220 ****
/**
* Writes a start tag to the output
* @param localName local name of the tag, may not be null
* @param prefix the prefix of the tag, may not be null
* @param namespaceURI the uri to bind the prefix to, may not be null
! * @throws XMLStreamException
*/
public void writeStartElement(String prefix,
String localName,
String namespaceURI)
throws XMLStreamException;
--- 210,220 ----
/**
* Writes a start tag to the output
* @param localName local name of the tag, may not be null
* @param prefix the prefix of the tag, may not be null
* @param namespaceURI the uri to bind the prefix to, may not be null
! * @throws XMLStreamException if an error occurs
*/
public void writeStartElement(String prefix,
String localName,
String namespaceURI)
throws XMLStreamException;
*** 232,250 ****
/**
* Writes an empty element tag to the output
* @param prefix the prefix of the tag, may not be null
* @param localName local name of the tag, may not be null
* @param namespaceURI the uri to bind the tag to, may not be null
! * @throws XMLStreamException
*/
public void writeEmptyElement(String prefix, String localName, String namespaceURI)
throws XMLStreamException;
/**
* Writes an empty element tag to the output
* @param localName local name of the tag, may not be null
! * @throws XMLStreamException
*/
public void writeEmptyElement(String localName)
throws XMLStreamException;
/**
--- 232,250 ----
/**
* Writes an empty element tag to the output
* @param prefix the prefix of the tag, may not be null
* @param localName local name of the tag, may not be null
* @param namespaceURI the uri to bind the tag to, may not be null
! * @throws XMLStreamException if an error occurs
*/
public void writeEmptyElement(String prefix, String localName, String namespaceURI)
throws XMLStreamException;
/**
* Writes an empty element tag to the output
* @param localName local name of the tag, may not be null
! * @throws XMLStreamException if an error occurs
*/
public void writeEmptyElement(String localName)
throws XMLStreamException;
/**
*** 262,305 ****
/**
* Writes an end tag to the output relying on the internal
* state of the writer to determine the prefix and local name
* of the event.
! * @throws XMLStreamException
*/
public void writeEndElement()
throws XMLStreamException;
/**
* Closes any start tags and writes corresponding end tags.
! * @throws XMLStreamException
*/
public void writeEndDocument()
throws XMLStreamException;
/**
* Close this writer and free any resources associated with the
* writer. This must not close the underlying output stream.
! * @throws XMLStreamException
*/
public void close()
throws XMLStreamException;
/**
* Write any cached data to the underlying output mechanism.
! * @throws XMLStreamException
*/
public void flush()
throws XMLStreamException;
/**
* Writes an attribute to the output stream without
* a prefix.
* @param localName the local name of the attribute
* @param value the value of the attribute
* @throws IllegalStateException if the current state does not allow Attribute writing
! * @throws XMLStreamException
*/
public void writeAttribute(String localName, String value)
throws XMLStreamException;
/**
--- 262,305 ----
/**
* Writes an end tag to the output relying on the internal
* state of the writer to determine the prefix and local name
* of the event.
! * @throws XMLStreamException if an error occurs
*/
public void writeEndElement()
throws XMLStreamException;
/**
* Closes any start tags and writes corresponding end tags.
! * @throws XMLStreamException if an error occurs
*/
public void writeEndDocument()
throws XMLStreamException;
/**
* Close this writer and free any resources associated with the
* writer. This must not close the underlying output stream.
! * @throws XMLStreamException if an error occurs
*/
public void close()
throws XMLStreamException;
/**
* Write any cached data to the underlying output mechanism.
! * @throws XMLStreamException if an error occurs
*/
public void flush()
throws XMLStreamException;
/**
* Writes an attribute to the output stream without
* a prefix.
* @param localName the local name of the attribute
* @param value the value of the attribute
* @throws IllegalStateException if the current state does not allow Attribute writing
! * @throws XMLStreamException if an error occurs
*/
public void writeAttribute(String localName, String value)
throws XMLStreamException;
/**
*** 339,425 ****
* "xmlns", or null this method will delegate to writeDefaultNamespace
*
* @param prefix the prefix to bind this namespace to
* @param namespaceURI the uri to bind the prefix to
* @throws IllegalStateException if the current state does not allow Namespace writing
! * @throws XMLStreamException
*/
public void writeNamespace(String prefix, String namespaceURI)
throws XMLStreamException;
/**
* Writes the default namespace to the stream
* @param namespaceURI the uri to bind the default namespace to
* @throws IllegalStateException if the current state does not allow Namespace writing
! * @throws XMLStreamException
*/
public void writeDefaultNamespace(String namespaceURI)
throws XMLStreamException;
/**
* Writes an xml comment with the data enclosed
* @param data the data contained in the comment, may be null
! * @throws XMLStreamException
*/
public void writeComment(String data)
throws XMLStreamException;
/**
* Writes a processing instruction
* @param target the target of the processing instruction, may not be null
! * @throws XMLStreamException
*/
public void writeProcessingInstruction(String target)
throws XMLStreamException;
/**
* Writes a processing instruction
* @param target the target of the processing instruction, may not be null
* @param data the data contained in the processing instruction, may not be null
! * @throws XMLStreamException
*/
public void writeProcessingInstruction(String target,
String data)
throws XMLStreamException;
/**
* Writes a CData section
* @param data the data contained in the CData Section, may not be null
! * @throws XMLStreamException
*/
public void writeCData(String data)
throws XMLStreamException;
/**
* Write a DTD section. This string represents the entire doctypedecl production
* from the XML 1.0 specification.
*
* @param dtd the DTD to be written
! * @throws XMLStreamException
*/
public void writeDTD(String dtd)
throws XMLStreamException;
/**
* Writes an entity reference
* @param name the name of the entity
! * @throws XMLStreamException
*/
public void writeEntityRef(String name)
throws XMLStreamException;
/**
* Write the XML Declaration. Defaults the XML version to 1.0, and the encoding to utf-8
! * @throws XMLStreamException
*/
public void writeStartDocument()
throws XMLStreamException;
/**
* Write the XML Declaration. Defaults the XML version to 1.0
* @param version version of the xml document
! * @throws XMLStreamException
*/
public void writeStartDocument(String version)
throws XMLStreamException;
/**
--- 339,425 ----
* "xmlns", or null this method will delegate to writeDefaultNamespace
*
* @param prefix the prefix to bind this namespace to
* @param namespaceURI the uri to bind the prefix to
* @throws IllegalStateException if the current state does not allow Namespace writing
! * @throws XMLStreamException if an error occurs
*/
public void writeNamespace(String prefix, String namespaceURI)
throws XMLStreamException;
/**
* Writes the default namespace to the stream
* @param namespaceURI the uri to bind the default namespace to
* @throws IllegalStateException if the current state does not allow Namespace writing
! * @throws XMLStreamException if an error occurs
*/
public void writeDefaultNamespace(String namespaceURI)
throws XMLStreamException;
/**
* Writes an xml comment with the data enclosed
* @param data the data contained in the comment, may be null
! * @throws XMLStreamException if an error occurs
*/
public void writeComment(String data)
throws XMLStreamException;
/**
* Writes a processing instruction
* @param target the target of the processing instruction, may not be null
! * @throws XMLStreamException if an error occurs
*/
public void writeProcessingInstruction(String target)
throws XMLStreamException;
/**
* Writes a processing instruction
* @param target the target of the processing instruction, may not be null
* @param data the data contained in the processing instruction, may not be null
! * @throws XMLStreamException if an error occurs
*/
public void writeProcessingInstruction(String target,
String data)
throws XMLStreamException;
/**
* Writes a CData section
* @param data the data contained in the CData Section, may not be null
! * @throws XMLStreamException if an error occurs
*/
public void writeCData(String data)
throws XMLStreamException;
/**
* Write a DTD section. This string represents the entire doctypedecl production
* from the XML 1.0 specification.
*
* @param dtd the DTD to be written
! * @throws XMLStreamException if an error occurs
*/
public void writeDTD(String dtd)
throws XMLStreamException;
/**
* Writes an entity reference
* @param name the name of the entity
! * @throws XMLStreamException if an error occurs
*/
public void writeEntityRef(String name)
throws XMLStreamException;
/**
* Write the XML Declaration. Defaults the XML version to 1.0, and the encoding to utf-8
! * @throws XMLStreamException if an error occurs
*/
public void writeStartDocument()
throws XMLStreamException;
/**
* Write the XML Declaration. Defaults the XML version to 1.0
* @param version version of the xml document
! * @throws XMLStreamException if an error occurs
*/
public void writeStartDocument(String version)
throws XMLStreamException;
/**
*** 437,465 ****
throws XMLStreamException;
/**
* Write text to the output
* @param text the value to write
! * @throws XMLStreamException
*/
public void writeCharacters(String text)
throws XMLStreamException;
/**
* Write text to the output
* @param text the value to write
* @param start the starting position in the array
* @param len the number of characters to write
! * @throws XMLStreamException
*/
public void writeCharacters(char[] text, int start, int len)
throws XMLStreamException;
/**
! * Gets the prefix the uri is bound to
* @return the prefix or null
! * @throws XMLStreamException
*/
public String getPrefix(String uri)
throws XMLStreamException;
/**
--- 437,466 ----
throws XMLStreamException;
/**
* Write text to the output
* @param text the value to write
! * @throws XMLStreamException if an error occurs
*/
public void writeCharacters(String text)
throws XMLStreamException;
/**
* Write text to the output
* @param text the value to write
* @param start the starting position in the array
* @param len the number of characters to write
! * @throws XMLStreamException if an error occurs
*/
public void writeCharacters(char[] text, int start, int len)
throws XMLStreamException;
/**
! * Gets the prefix the uri is bound to.
! * @param uri the uri the prefix is bound to
* @return the prefix or null
! * @throws XMLStreamException if an error occurs
*/
public String getPrefix(String uri)
throws XMLStreamException;
/**
*** 467,477 ****
* in the scope of the current START_ELEMENT / END_ELEMENT pair.
* If this method is called before a START_ELEMENT has been written
* the prefix is bound in the root scope.
* @param prefix the prefix to bind to the uri, may not be null
* @param uri the uri to bind to the prefix, may be null
! * @throws XMLStreamException
*/
public void setPrefix(String prefix, String uri)
throws XMLStreamException;
--- 468,478 ----
* in the scope of the current START_ELEMENT / END_ELEMENT pair.
* If this method is called before a START_ELEMENT has been written
* the prefix is bound in the root scope.
* @param prefix the prefix to bind to the uri, may not be null
* @param uri the uri to bind to the prefix, may be null
! * @throws XMLStreamException if an error occurs
*/
public void setPrefix(String prefix, String uri)
throws XMLStreamException;
*** 480,490 ****
* This URI is bound
* in the scope of the current START_ELEMENT / END_ELEMENT pair.
* If this method is called before a START_ELEMENT has been written
* the uri is bound in the root scope.
* @param uri the uri to bind to the default namespace, may be null
! * @throws XMLStreamException
*/
public void setDefaultNamespace(String uri)
throws XMLStreamException;
/**
--- 481,491 ----
* This URI is bound
* in the scope of the current START_ELEMENT / END_ELEMENT pair.
* If this method is called before a START_ELEMENT has been written
* the uri is bound in the root scope.
* @param uri the uri to bind to the default namespace, may be null
! * @throws XMLStreamException if an error occurs
*/
public void setDefaultNamespace(String uri)
throws XMLStreamException;
/**
*** 497,507 ****
* the document. It does not cause the namespaces to be declared.
* If a namespace URI to prefix mapping is found in the namespace
* context it is treated as declared and the prefix may be used
* by the StreamWriter.
* @param context the namespace context to use for this writer, may not be null
! * @throws XMLStreamException
*/
public void setNamespaceContext(NamespaceContext context)
throws XMLStreamException;
/**
--- 498,508 ----
* the document. It does not cause the namespaces to be declared.
* If a namespace URI to prefix mapping is found in the namespace
* context it is treated as declared and the prefix may be used
* by the StreamWriter.
* @param context the namespace context to use for this writer, may not be null
! * @throws XMLStreamException if an error occurs
*/
public void setNamespaceContext(NamespaceContext context)
throws XMLStreamException;
/**
< prev index next >