|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.hp.hpl.mesa.rdf.jena.common.prettywriter.PrettyWriter
Writes out RDF in the abbreviated syntax, for human consumption
not only machine readable.
It is not normal to call the constructor directly, but to use
the method RDFWriterF.getWriter("RDF/XML-ABBREV").
Does not support the NSPREFIXPROPBASE system properties.
Use setNsPrefix.
For best results it is necessary to set the property
"prettyTypes". See setProperty for information.
RDFWriterF.getWriter()| Field Summary |
| Fields inherited from interface com.hp.hpl.mesa.rdf.jena.model.RDFWriter |
NSPREFIXPROPBASE |
| Constructor Summary | |
PrettyWriter()
|
|
| Method Summary | |
void |
error(java.lang.Exception e)
report an error |
void |
fatalError(java.lang.Exception e)
report a catastrophic error. |
static void |
main(java.lang.String[] args)
|
RDFErrorHandler |
setErrorHandler(RDFErrorHandler errHandler)
Set an error handler. |
void |
setNsPrefix(java.lang.String prefix,
java.lang.String ns)
Set the the namespace prefix to be used for a particular namespace. |
java.lang.Object |
setProperty(java.lang.String propName,
java.lang.Object propValue)
Sets properties on this writer. |
void |
warning(java.lang.Exception e)
report a warning |
void |
write(Model model,
java.io.OutputStream out,
java.lang.String base)
|
void |
write(Model model,
java.io.Writer out,
java.lang.String base)
Serialize Model model to Writer out. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PrettyWriter()
| Method Detail |
public RDFErrorHandler setErrorHandler(RDFErrorHandler errHandler)
setErrorHandler in interface RDFWritererrHandler - The new error handler to be used.
public void setNsPrefix(java.lang.String prefix,
java.lang.String ns)
setNsPrefix in interface RDFWriterprefix - the prefix to be usedns - the namespace
public java.lang.Object setProperty(java.lang.String propName,
java.lang.Object propValue)
throws RDFException
prettyWriter.setProperty("prettyTypes",new Resource[]{
DAML.Ontology,
DAML.Class,
DAML.Datatype,
DAML.Property,
DAML.ObjectProperty,
DAML.DatatypeProperty,
DAML.TransitiveProperty,
DAML.UnambigousProperty,
DAML.UniqueProperty,
});
setProperty in interface RDFWriterpropName - Must be one of "xmlbase", "showXmlDeclaration", "prettyTypes"propValue - Appropriate value for the property. i.e. For
null
if no value was set.
RDFException - Throws a generic RDF exception
public void write(Model model,
java.io.Writer out,
java.lang.String base)
throws RDFException
model to Writer out.
- Specified by:
write in interface RDFWriter
- Parameters:
out - The Writer to which the serialization should
be sent.model - The model to be written.base - the base URI for relative URI calculations.
null means use only absolute URI's.
- Throws:
RDFException - Generic RDF exception.
public void write(Model model,
java.io.OutputStream out,
java.lang.String base)
throws RDFException
RDFExceptionpublic void error(java.lang.Exception e)
RDFErrorHandler
error in interface RDFErrorHandlere - an exception representing the errorpublic void warning(java.lang.Exception e)
RDFErrorHandler
warning in interface RDFErrorHandlere - an exception representing the errorpublic void fatalError(java.lang.Exception e)
RDFErrorHandler
fatalError in interface RDFErrorHandlere - an exception representing the error
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||