Class BaseXMLWriter

java.lang.Object
org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter
All Implemented Interfaces:
RDFWriterI, RDFXMLWriterI
Direct Known Subclasses:
RDFXML_Abbrev, RDFXML_Basic

public abstract class BaseXMLWriter extends Object implements RDFXMLWriterI
This is not part of the public API. Base class for XML serializers. All methods with side-effects should be synchronized in this class and its subclasses. (i. e. XMLWriters assume that the world is not changing around them while they are writing). Functionality:
  • setProperty etc
  • namespace prefixes
  • xmlbase
  • relative URIs
  • encoding issues
  • anonymous node presentational
  • errorHandler
  • Constructor Details

    • BaseXMLWriter

      public BaseXMLWriter()
  • Method Details

    • setLogger

      public static SimpleLogger setLogger(SimpleLogger lg)
    • setNsPrefix

      public final void setNsPrefix(String prefix, String ns)
    • getPrefixFor

      public final String getPrefixFor(String uri)
    • write

      public final void write(Model model, OutputStream out, String base)
      Write out an XML serialization of a model.
      Specified by:
      write in interface RDFWriterI
      Parameters:
      model - the model to be serialized
      out - the OutputStream to receive the serialization
      base - The URL at which the file will be placed.
    • write

      public void write(Model model, Writer out, String base)
      Serialize Model model to Writer out.
      Specified by:
      write in interface RDFWriterI
      Parameters:
      model - The model to be written.
      out - The Writer to which the serialization should be sent.
      base - the base URI for relative URI calculations. null means use only absolute URI's.
    • isPredefinedEntityName

      public boolean isPredefinedEntityName(String name)
    • setErrorHandler

      public RDFErrorHandler setErrorHandler(RDFErrorHandler errHandler)
      Set an error handler.
      Specified by:
      setErrorHandler in interface RDFWriterI
      Parameters:
      errHandler - The new error handler to be used, or null for the default handler.
      Returns:
      the old error handler
    • setProperty

      public final Object setProperty(String propName, Object propValue)
      Set the writer property propName to the value obtained from propValue. Return an Object representation of the original value.
      Specified by:
      setProperty in interface RDFWriterI
      Specified by:
      setProperty in interface RDFXMLWriterI
      Parameters:
      propName - One of "xmlBase", "longId", "allowBadURIs", "relativeURIs","showXMLDeclaration", "tab", "attributeQuoteChar", "blockRules", "prettyTypes", "showDoctypeDeclaration", "width"
      propValue - A String, Boolean, Integer, Resource[] as appropriate.
      Returns:
      the old value for this property, or null if no value was set.
      See Also:
    • str2flags

      public static int str2flags(String pv)