Class BaseXMLWriter
- java.lang.Object
-
- org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter
-
- All Implemented Interfaces:
RDFWriterI
,RDFXMLWriterI
- Direct Known Subclasses:
Abbreviated
,Basic
public abstract class BaseXMLWriter extends java.lang.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
-
-
Field Summary
-
Fields inherited from interface org.apache.jena.rdf.model.RDFWriterI
NSPREFIXPROPBASE
-
Fields inherited from interface org.apache.jena.rdfxml.xmloutput.RDFXMLWriterI
_NotInteresting
-
-
Constructor Summary
Constructors Constructor Description BaseXMLWriter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getPrefixFor(java.lang.String uri)
boolean
isPredefinedEntityName(java.lang.String name)
RDFErrorHandler
setErrorHandler(RDFErrorHandler errHandler)
Set an error handler.static SimpleLogger
setLogger(SimpleLogger lg)
void
setNsPrefix(java.lang.String prefix, java.lang.String ns)
java.lang.Object
setProperty(java.lang.String propName, java.lang.Object propValue)
Set the writer property propName to the value obtained from propValue.static int
str2flags(java.lang.String pv)
void
write(Model model, java.io.OutputStream out, java.lang.String base)
Write out an XML serialization of a model.void
write(Model model, java.io.Writer out, java.lang.String base)
Serialize Modelmodel
to Writerout.
-
-
-
Method Detail
-
setLogger
public static SimpleLogger setLogger(SimpleLogger lg)
-
setNsPrefix
public final void setNsPrefix(java.lang.String prefix, java.lang.String ns)
-
getPrefixFor
public final java.lang.String getPrefixFor(java.lang.String uri)
-
write
public final void write(Model model, java.io.OutputStream out, java.lang.String base)
Write out an XML serialization of a model.- Specified by:
write
in interfaceRDFWriterI
- Parameters:
model
- the model to be serializedout
- the OutputStream to receive the serializationbase
- The URL at which the file will be placed.
-
write
public void write(Model model, java.io.Writer out, java.lang.String base)
Serialize Modelmodel
to Writerout.
- Specified by:
write
in interfaceRDFWriterI
- 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(java.lang.String name)
-
setErrorHandler
public RDFErrorHandler setErrorHandler(RDFErrorHandler errHandler)
Set an error handler.- Specified by:
setErrorHandler
in interfaceRDFWriterI
- Parameters:
errHandler
- The new error handler to be used, or null for the default handler.- Returns:
- the old error handler
-
setProperty
public final java.lang.Object setProperty(java.lang.String propName, java.lang.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 interfaceRDFWriterI
- Specified by:
setProperty
in interfaceRDFXMLWriterI
- 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:
RDFWriterI.setProperty(java.lang.String, java.lang.Object)
-
str2flags
public static int str2flags(java.lang.String pv)
-
-