Class XmlWriter

java.lang.Object
java.io.Writer
java.io.StringWriter
org.ctan.site.resources.catalogue.api.XmlWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable

public class XmlWriter extends StringWriter
The class XmlWriter contains the specialised writer for XML files. It collects the data in memory.
  • Constructor Details

    • XmlWriter

      public XmlWriter()
  • Method Details

    • out

      public XmlWriter out(String... args)
      The method out provides means to write some arguments to the writer.
      Parameters:
      args - the arguments to append
      Returns:
      this
    • outFullTag

      public XmlWriter outFullTag(String tag, String value)
      The method outFullTag provides means to generate a full tag.
      Parameters:
      tag - the tag
      value - the value
      Returns:
      this
    • outIf

      public XmlWriter outIf(boolean cond, String attr, String value)
      The method outIf provides means to write a parameter if a condition is met and the value is not empty.
      Parameters:
      cond - the condition to check
      attr - the attribute
      value - the value
      Returns:
      this
    • outIf

      public XmlWriter outIf(String attr, String value)
      The method outIf provides means to write a parameter if a condition is met and the value is not empty.
      Parameters:
      attr - the attribute
      value - the value
      Returns:
      this
    • outIf

      public XmlWriter outIf(String tag, String attr, String value)
      The method outIf provides means to write a parameter if a condition is met and the value is not empty.
      Parameters:
      tag - the tag
      attr - the attribute
      value - the value
      Returns:
      this
    • outName

      public XmlWriter outName(boolean cond, String tag, String value)
      The method outName provides means to write out a parameter.
      Parameters:
      cond - check for a condition
      tag - the tag
      value - the value
      Returns:
      this
    • outNl

      public XmlWriter outNl(String... args)
      The method out provides means to write some arguments to the writer followed by a newline character.
      Parameters:
      args - the arguments to append
      Returns:
      this
    • outTagWithAttribute

      public XmlWriter outTagWithAttribute(String tag, String attribute, String value)
      The method outTag provides means to add a tag with an attribute value.
      Parameters:
      tag - the name of the tag
      attribute - the name of the attribute
      value - the value of the attribute
      Returns:
      this