Skip to content

Commit

Permalink
deprecate remaining classes of shared XML (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
elharo committed Jan 7, 2024
1 parent 578cfe6 commit 4c4f9ed
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@
/**
* XMLWriter with nice indentation.
*
* @deprecated this class swallows and ignores IOExceptions. It is dangerous to use when writing
* to anything other than a StringWriter.
* @author kama
*/
@Deprecated
public class PrettyPrintXMLWriter implements XMLWriter {
private static final char[] CLOSE_1 = "/>".toCharArray();

Expand Down Expand Up @@ -158,6 +161,7 @@ private PrettyPrintXMLWriter(
}

/** {@inheritDoc} */
@Override
public void addAttribute(String key, String value) throws IOException {
if (!processingElement) {
throw new IllegalStateException("currently processing no element");
Expand All @@ -173,6 +177,7 @@ public void addAttribute(String key, String value) throws IOException {
}

/** {@inheritDoc} */
@Override
public void setEncoding(String encoding) {
if (documentStarted) {
throw new IllegalStateException("Document headers already written!");
Expand All @@ -182,6 +187,7 @@ public void setEncoding(String encoding) {
}

/** {@inheritDoc} */
@Override
public void setDocType(String docType) {
if (documentStarted) {
throw new IllegalStateException("Document headers already written!");
Expand Down Expand Up @@ -213,6 +219,7 @@ public void setLineIndenter(String lineIndentParameter) {
}

/** {@inheritDoc} */
@Override
public void startElement(String elementName) throws IOException {

if (elementName.isEmpty()) {
Expand All @@ -239,6 +246,7 @@ public void startElement(String elementName) throws IOException {
}

/** {@inheritDoc} */
@Override
public void writeText(String text) throws IOException {
ensureDocumentStarted();

Expand All @@ -254,6 +262,7 @@ public void writeText(String text) throws IOException {
}

/** {@inheritDoc} */
@Override
public void writeMarkup(String markup) throws IOException {
ensureDocumentStarted();

Expand All @@ -267,6 +276,7 @@ public void writeMarkup(String markup) throws IOException {
}

/** {@inheritDoc} */
@Override
public void endElement() throws IOException {
String chars = elementStack.get(--depth);
if (processingElement) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* Interface for tools writing XML files.
* XMLWriters are not thread safe and must not be accessed concurrently.
*/
@Deprecated
public interface XMLWriter {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
*
*/
@Deprecated
public class XmlWriterUtil {
/** The vm line separator */
public static final String LS = System.getProperty("line.separator");
Expand Down

0 comments on commit 4c4f9ed

Please sign in to comment.