Add convenience property setters to serializers and parsers. Project: http://git-wip-us.apache.org/repos/asf/incubator-juneau/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-juneau/commit/68dffad1 Tree: http://git-wip-us.apache.org/repos/asf/incubator-juneau/tree/68dffad1 Diff: http://git-wip-us.apache.org/repos/asf/incubator-juneau/diff/68dffad1
Branch: refs/heads/master Commit: 68dffad1d3b26a7d021e5a67a78bf29cbdebbfd7 Parents: 30dd3b9 Author: JamesBognar <[email protected]> Authored: Thu Feb 9 12:31:15 2017 -0500 Committer: JamesBognar <[email protected]> Committed: Thu Feb 9 12:31:15 2017 -0500 ---------------------------------------------------------------------- .../apache/juneau/jena/RdfCommonContext.java | 195 +-- .../java/org/apache/juneau/jena/RdfParser.java | 631 +++++++- .../apache/juneau/jena/RdfParserContext.java | 23 - .../org/apache/juneau/jena/RdfSerializer.java | 792 +++++++++- .../juneau/jena/RdfSerializerContext.java | 44 - .../java/org/apache/juneau/BeanConfigTest.java | 135 +- .../java/org/apache/juneau/BeanMapTest.java | 20 +- .../org/apache/juneau/IgnoredClassesTest.java | 17 +- .../test/java/org/apache/juneau/TestUtils.java | 15 +- .../java/org/apache/juneau/VisibilityTest.java | 65 +- .../a/rttests/RoundTripAddClassAttrsTest.java | 42 +- .../a/rttests/RoundTripLargeObjectsTest.java | 31 +- .../juneau/a/rttests/RoundTripMapsTest.java | 12 +- .../apache/juneau/a/rttests/RoundTripTest.java | 61 +- .../a/rttests/RoundTripTrimStringsTest.java | 4 +- .../org/apache/juneau/dto/atom/AtomTest.java | 8 +- .../apache/juneau/dto/cognos/CognosXmlTest.java | 12 +- .../apache/juneau/html/CommonParserTest.java | 10 +- .../java/org/apache/juneau/html/CommonTest.java | 62 +- .../java/org/apache/juneau/html/HtmlTest.java | 28 +- .../apache/juneau/jena/CommonParserTest.java | 16 +- .../java/org/apache/juneau/jena/CommonTest.java | 54 +- .../org/apache/juneau/jena/CommonXmlTest.java | 5 +- .../org/apache/juneau/jena/RdfParserTest.java | 5 +- .../java/org/apache/juneau/jena/RdfTest.java | 31 +- .../apache/juneau/json/CommonParserTest.java | 10 +- .../java/org/apache/juneau/json/CommonTest.java | 48 +- .../juneau/json/JsonParserEdgeCasesTest.java | 8 +- .../java/org/apache/juneau/json/JsonTest.java | 11 +- .../transforms/ByteArrayBase64SwapTest.java | 3 +- .../juneau/transforms/CalendarSwapTest.java | 16 +- .../urlencoding/CommonParser_UonTest.java | 12 +- .../CommonParser_UrlEncodingTest.java | 12 +- .../juneau/urlencoding/Common_UonTest.java | 46 +- .../urlencoding/Common_UrlEncodingTest.java | 46 +- .../urlencoding/UrlEncodingParserTest.java | 2 +- .../urlencoding/UrlEncodingSerializerTest.java | 4 +- .../org/apache/juneau/utils/PojoRestTest.java | 5 +- .../apache/juneau/utils/StringUtilsTest.java | 3 +- .../org/apache/juneau/xml/CommonParserTest.java | 5 +- .../java/org/apache/juneau/xml/CommonTest.java | 48 +- .../org/apache/juneau/xml/CommonXmlTest.java | 3 +- .../org/apache/juneau/xml/XmlContentTest.java | 5 +- .../org/apache/juneau/xml/XmlParserTest.java | 3 +- .../java/org/apache/juneau/xml/XmlTest.java | 216 ++- .../java/org/apache/juneau/BeanContext.java | 354 ----- .../java/org/apache/juneau/ConfigException.java | 13 +- .../java/org/apache/juneau/ContextFactory.java | 8 +- .../main/java/org/apache/juneau/CoreApi.java | 1445 +++++++++++++++++- .../main/java/org/apache/juneau/Lockable.java | 4 +- .../main/java/org/apache/juneau/MediaType.java | 2 +- .../org/apache/juneau/annotation/BeanParam.java | 26 + .../org/apache/juneau/csv/CsvSerializer.java | 7 +- .../main/java/org/apache/juneau/dto/Link.java | 1 + .../org/apache/juneau/dto/atom/Content.java | 1 + .../java/org/apache/juneau/dto/atom/Entry.java | 1 + .../java/org/apache/juneau/dto/atom/Icon.java | 1 + .../java/org/apache/juneau/dto/atom/Source.java | 1 + .../org/apache/juneau/dto/atom/package.html | 6 +- .../org/apache/juneau/dto/cognos/Column.java | 1 + .../java/org/apache/juneau/dto/html5/A.java | 13 +- .../java/org/apache/juneau/dto/html5/Area.java | 19 +- .../org/apache/juneau/dto/html5/Article.java | 1 + .../java/org/apache/juneau/dto/html5/Audio.java | 17 +- .../java/org/apache/juneau/dto/html5/Base.java | 5 +- .../org/apache/juneau/dto/html5/Blockquote.java | 3 +- .../java/org/apache/juneau/dto/html5/Body.java | 13 +- .../org/apache/juneau/dto/html5/Button.java | 25 +- .../org/apache/juneau/dto/html5/Canvas.java | 5 +- .../java/org/apache/juneau/dto/html5/Col.java | 3 +- .../org/apache/juneau/dto/html5/Colgroup.java | 3 +- .../java/org/apache/juneau/dto/html5/Data.java | 3 +- .../java/org/apache/juneau/dto/html5/Del.java | 5 +- .../java/org/apache/juneau/dto/html5/Embed.java | 9 +- .../org/apache/juneau/dto/html5/Fieldset.java | 7 +- .../java/org/apache/juneau/dto/html5/Form.java | 17 +- .../java/org/apache/juneau/dto/html5/Html.java | 3 +- .../apache/juneau/dto/html5/HtmlElement.java | 124 +- .../juneau/dto/html5/HtmlElementText.java | 2 +- .../org/apache/juneau/dto/html5/Iframe.java | 13 +- .../java/org/apache/juneau/dto/html5/Img.java | 15 +- .../java/org/apache/juneau/dto/html5/Input.java | 65 +- .../java/org/apache/juneau/dto/html5/Ins.java | 5 +- .../org/apache/juneau/dto/html5/Keygen.java | 13 +- .../java/org/apache/juneau/dto/html5/Label.java | 5 +- .../java/org/apache/juneau/dto/html5/Link.java | 15 +- .../java/org/apache/juneau/dto/html5/Map.java | 3 +- .../java/org/apache/juneau/dto/html5/Meta.java | 9 +- .../java/org/apache/juneau/dto/html5/Meter.java | 13 +- .../org/apache/juneau/dto/html5/Object2.java | 17 +- .../java/org/apache/juneau/dto/html5/Ol.java | 7 +- .../org/apache/juneau/dto/html5/Optgroup.java | 5 +- .../org/apache/juneau/dto/html5/Option.java | 9 +- .../org/apache/juneau/dto/html5/Output.java | 7 +- .../java/org/apache/juneau/dto/html5/Param.java | 5 +- .../org/apache/juneau/dto/html5/Progress.java | 5 +- .../java/org/apache/juneau/dto/html5/Q.java | 3 +- .../org/apache/juneau/dto/html5/Script.java | 13 +- .../org/apache/juneau/dto/html5/Select.java | 15 +- .../org/apache/juneau/dto/html5/Source.java | 5 +- .../java/org/apache/juneau/dto/html5/Style.java | 5 +- .../java/org/apache/juneau/dto/html5/Table.java | 3 +- .../java/org/apache/juneau/dto/html5/Td.java | 7 +- .../org/apache/juneau/dto/html5/Textarea.java | 31 +- .../java/org/apache/juneau/dto/html5/Th.java | 13 +- .../java/org/apache/juneau/dto/html5/Time.java | 3 +- .../java/org/apache/juneau/dto/html5/Track.java | 11 +- .../java/org/apache/juneau/dto/html5/Video.java | 23 +- .../apache/juneau/dto/jsonschema/Schema.java | 1 + .../apache/juneau/encoders/EncoderGroup.java | 2 +- .../apache/juneau/html/HtmlDocSerializer.java | 477 +++++- .../juneau/html/HtmlDocSerializerContext.java | 47 - .../java/org/apache/juneau/html/HtmlParser.java | 412 ++++- .../apache/juneau/html/HtmlParserContext.java | 15 - .../juneau/html/HtmlSchemaDocSerializer.java | 9 +- .../org/apache/juneau/html/HtmlSerializer.java | 607 +++++++- .../juneau/html/HtmlSerializerContext.java | 44 - .../org/apache/juneau/ini/ConfigFileImpl.java | 2 + .../java/org/apache/juneau/ini/Section.java | 4 + .../org/apache/juneau/internal/ClassUtils.java | 109 ++ .../org/apache/juneau/internal/Version.java | 2 +- .../java/org/apache/juneau/json/JsonParser.java | 389 ++++- .../apache/juneau/json/JsonParserContext.java | 15 - .../juneau/json/JsonSchemaSerializer.java | 16 +- .../org/apache/juneau/json/JsonSerializer.java | 554 ++++++- .../juneau/json/JsonSerializerContext.java | 37 - .../java/org/apache/juneau/json/JsonWriter.java | 1 + .../java/org/apache/juneau/json/package.html | 10 +- .../apache/juneau/msgpack/MsgPackParser.java | 390 ++++- .../juneau/msgpack/MsgPackParserContext.java | 15 - .../juneau/msgpack/MsgPackSerializer.java | 452 +++++- .../msgpack/MsgPackSerializerContext.java | 15 - .../java/org/apache/juneau/parser/Parser.java | 503 +++++- .../org/apache/juneau/parser/ParserContext.java | 33 - .../org/apache/juneau/parser/ParserGroup.java | 995 +++++++++++- .../org/apache/juneau/parser/ParserMatch.java | 4 +- .../serializer/OutputStreamSerializer.java | 1 + .../apache/juneau/serializer/Serializer.java | 828 +++++++++- .../juneau/serializer/SerializerContext.java | 110 -- .../juneau/serializer/SerializerGroup.java | 1159 +++++++++++++- .../juneau/serializer/WriterSerializer.java | 1 + .../java/org/apache/juneau/svl/VarResolver.java | 1 + .../org/apache/juneau/transform/PojoSwap.java | 1 + .../apache/juneau/urlencoding/UonParser.java | 445 +++++- .../juneau/urlencoding/UonParserContext.java | 30 - .../juneau/urlencoding/UonSerializer.java | 605 +++++++- .../urlencoding/UonSerializerContext.java | 37 - .../apache/juneau/urlencoding/UonWriter.java | 1 + .../juneau/urlencoding/UrlEncodingContext.java | 2 +- .../juneau/urlencoding/UrlEncodingParser.java | 455 +++++- .../urlencoding/UrlEncodingParserContext.java | 25 +- .../urlencoding/UrlEncodingSerializer.java | 537 ++++++- .../UrlEncodingSerializerContext.java | 24 - .../org/apache/juneau/urlencoding/package.html | 2 +- .../org/apache/juneau/xml/XmlDocSerializer.java | 7 +- .../java/org/apache/juneau/xml/XmlParser.java | 548 ++++++- .../org/apache/juneau/xml/XmlParserContext.java | 75 - .../org/apache/juneau/xml/XmlParserSession.java | 12 - .../org/apache/juneau/xml/XmlSerializer.java | 646 +++++++- .../apache/juneau/xml/XmlSerializerContext.java | 58 - .../java/org/apache/juneau/xml/XmlUtils.java | 1 + .../java/org/apache/juneau/xml/package.html | 56 +- juneau-core/src/main/javadoc/overview.html | 63 +- .../examples/rest/AddressBookResourceTest.java | 3 +- .../SampleRemoteableServicesResourceTest.java | 3 +- .../apache/juneau/examples/rest/TestUtils.java | 15 +- .../juneau/microservice/Microservice.java | 2 + .../juneau/microservice/RestMicroservice.java | 4 + .../resources/DirectoryResource.java | 10 +- .../apache/juneau/rest/client/RestClient.java | 10 +- .../org/apache/juneau/rest/ResponseHandler.java | 4 +- .../org/apache/juneau/rest/RestRequest.java | 16 +- .../org/apache/juneau/rest/RestServlet.java | 1 + .../apache/juneau/rest/RestServletContext.java | 47 - .../rest/remoteable/RemoteableServlet.java | 1 + 175 files changed, 13630 insertions(+), 2691 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfCommonContext.java ---------------------------------------------------------------------- diff --git a/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfCommonContext.java b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfCommonContext.java index 548dce5..eb61785 100644 --- a/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfCommonContext.java +++ b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfCommonContext.java @@ -20,197 +20,6 @@ import org.apache.juneau.xml.annotation.*; /** * Configurable properties common to both the {@link RdfSerializer} and {@link RdfParser} classes. - * - * <h6 class='topic' id='ConfigProperties'>Configurable properties common to the RDF serializers and parsers</h6> - * <table class='styled' style='border-collapse: collapse;'> - * <tr><th>Setting name</th><th>Description</th><th>Data type</th><th>Default value</th></tr> - * <tr> - * <td>{@link #RDF_language}</td> - * <td>RDF language.</td> - * <td><code>String</code></td> - * <td><js>"RDF/XML-ABBREV"</js></td> - * </tr> - * <tr> - * <td>{@link #RDF_juneauNs}</td> - * <td>XML namespace for Juneau properties.</td> - * <td>{@link Namespace}</td> - * <td><code>{j:<js>'http://www.apache.org/juneau/'</js>}</code></td> - * </tr> - * <tr> - * <td>{@link #RDF_juneauBpNs}</td> - * <td>Default XML namespace for bean properties.</td> - * <td>{@link Namespace}</td> - * <td><code>{j:<js>'http://www.apache.org/juneaubp/'</js>}</code></td> - * </tr> - * <tr> - * <td>{@link #RDF_useXmlNamespaces}</td> - * <td>Reuse XML namespaces when RDF namespaces not specified.</td> - * <td><code>Boolean</code></td> - * <td><jk>true</jk></td> - * </tr> - * <tr> - * <td>{@link #RDF_arp_iriRules}</td> - * <td>RDF/XML property: <code>iri_rules</code>.</td> - * <td><code>String</code></td> - * <td><js>"lax"</js></td> - * </tr> - * <tr> - * <td>{@link #RDF_arp_errorMode}</td> - * <td>RDF/XML ARP property: <code>error-mode</code>.</td> - * <td><code>String</code></td> - * <td><js>"lax"</js></td> - * </tr> - * <tr> - * <td>{@link #RDF_arp_embedding}</td> - * <td>RDF/XML ARP property: <code>embedding</code>.</td> - * <td><code>Boolean</code></td> - * <td><jk>false</jk></td> - * </tr> - * <tr> - * <td>{@link #RDF_arp_err_}</td> - * <td>RDF/XML ARP property: <code>ERR_xxx</code>.</td> - * <td><code>String</code></td> - * <td></td> - * </tr> - * <tr> - * <td>{@link #RDF_arp_warn_}</td> - * <td>RDF/XML ARP property: <code>WARN_xxx</code>.</td> - * <td><code>String</code></td> - * <td></td> - * </tr> - * <tr> - * <td>{@link #RDF_arp_ign_}</td> - * <td>RDF/XML ARP property: <code>IGN_xxx</code>.</td> - * <td><code>String</code></td> - * <td></td> - * </tr> - * <tr> - * <td>{@link #RDF_rdfxml_xmlBase}</td> - * <td>RDF/XML property: <code>xmlbase</code>.</td> - * <td><code>String</code></td> - * <td><jk>null</jk></td> - * </tr> - * <tr> - * <td>{@link #RDF_rdfxml_longId}</td> - * <td>RDF/XML property: <code>longId</code>.</td> - * <td><code>Boolean</code></td> - * <td><jk>false</jk></td> - * </tr> - * <tr> - * <td>{@link #RDF_rdfxml_allowBadUris}</td> - * <td>RDF/XML property: <code>allowBadURIs</code>.</td> - * <td><code>Boolean</code></td> - * <td><jk>false</jk></td> - * </tr> - * <tr> - * <td>{@link #RDF_rdfxml_relativeUris}</td> - * <td>RDF/XML property: <code>relativeURIs</code>.</td> - * <td><code>String</code></td> - * <td><js>"same-document, absolute, relative, parent"</js></td> - * </tr> - * <tr> - * <td>{@link #RDF_rdfxml_showXmlDeclaration}</td> - * <td>RDF/XML property: <code>showXmlDeclaration</code>.</td> - * <td><code>String</code></td> - * <td><js>"default"</js></td> - * </tr> - * <tr> - * <td>{@link #RDF_rdfxml_showDoctypeDeclaration}</td> - * <td>RDF/XML property: <code>showDoctypeDeclaration</code>.</td> - * <td><code>Boolean</code></td> - * <td><jk>true</jk></td> - * </tr> - * <tr> - * <td>{@link #RDF_rdfxml_tab}</td> - * <td>RDF/XML property: <code>tab</code>.</td> - * <td><code>Integer</code></td> - * <td><code>2</code></td> - * </tr> - * <tr> - * <td>{@link #RDF_rdfxml_attributeQuoteChar}</td> - * <td>RDF/XML property: <code>attributeQuoteChar</code>.</td> - * <td><code>Character</code></td> - * <td><js>'"'</js></td> - * </tr> - * <tr> - * <td>{@link #RDF_rdfxml_blockRules}</td> - * <td>RDF/XML property: <code>blockRules</code>.</td> - * <td><code>String</code></td> - * <td><js>""</js></td> - * </tr> - * <tr> - * <td>{@link #RDF_n3_minGap}</td> - * <td>N3/Turtle property: <code>minGap</code>.</td> - * <td><code>Integer</code></td> - * <td><code>1</code></td> - * </tr> - * <tr> - * <td>{@link #RDF_n3_objectLists}</td> - * <td>N3/Turtle property: <code>objectLists</code>.</td> - * <td><code>Boolean</code></td> - * <td><jk>true</jk></td> - * </tr> - * <tr> - * <td>{@link #RDF_n3_subjectColumn}</td> - * <td>N3/Turtle property: <code>subjectColumn</code>.</td> - * <td><code>Integer</code></td> - * <td>indent column</td> - * </tr> - * <tr> - * <td>{@link #RDF_n3_propertyColumn}</td> - * <td>N3/Turtle property: <code>propertyColumn</code>.</td> - * <td><code>Integer</code></td> - * <td><code>8</code></td> - * </tr> - * <tr> - * <td>{@link #RDF_n3_indentProperty}</td> - * <td>N3/Turtle property: <code>indentProperty</code>.</td> - * <td><code>Integer</code></td> - * <td><code>6</code></td> - * </tr> - * <tr> - * <td>{@link #RDF_n3_widePropertyLen}</td> - * <td>N3/Turtle property: <code>widePropertyLen</code>.</td> - * <td><code>Integer</code></td> - * <td><code>20</code></td> - * </tr> - * <tr> - * <td>{@link #RDF_n3_abbrevBaseUri}</td> - * <td>N3/Turtle property: <code>abbrevBaseURI</code>.</td> - * <td><code>Boolean</code></td> - * <td><jk>true</jk></td> - * </tr> - * <tr> - * <td>{@link #RDF_n3_usePropertySymbols}</td> - * <td>N3/Turtle property: <code>usePropertySymbols</code>.</td> - * <td><code>Boolean</code></td> - * <td><jk>true</jk></td> - * </tr> - * <tr> - * <td>{@link #RDF_n3_useTripleQuotedStrings}</td> - * <td>N3/Turtle property: <code>useTripleQuotedStrings</code>.</td> - * <td><code>Boolean</code></td> - * <td><jk>true</jk></td> - * </tr> - * <tr> - * <td>{@link #RDF_n3_useDoubles}</td> - * <td>N3/Turtle property: <code>useDoubles</code>.</td> - * <td><code>Boolean</code></td> - * <td><jk>true</jk></td> - * </tr> - * <tr> - * <td>{@link #RDF_collectionFormat}</td> - * <td>RDF format for representing collections and arrays.</td> - * <td><code>String</code></td> - * <td><js>"DEFAULT"</js></td> - * </tr> - * <tr> - * <td>{@link #RDF_looseCollections}</td> - * <td>Collections should be serialized and parsed as loose collections.</td> - * <td><code>Boolean</code></td> - * <td><jk>false</jk></td> - * </tr> - * </table> */ @SuppressWarnings("serial") public interface RdfCommonContext { @@ -730,8 +539,8 @@ public interface RdfCommonContext { * * <h5 class='section'>Example:</h5> * <p class='bcode'> - * WriterSerializer s = <jk>new</jk> RdfSerializer.XmlAbbrev().setProperty(<jsf>RDF_looseCollection</jsf>, <jk>true</jk>); - * ReaderParser p = <jk>new</jk> RdfParser.Xml().setProperty(<jsf>RDF_looseCollection</jsf>, <jk>true</jk>); + * WriterSerializer s = <jk>new</jk> RdfSerializer.XmlAbbrev().setLooseCollections(<jk>true</jk>); + * ReaderParser p = <jk>new</jk> RdfParser.Xml().setLooseCollections(<jk>true</jk>); * * List<MyBean> l = createListOfMyBeans(); * http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java ---------------------------------------------------------------------- diff --git a/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java index 9ac292f..468afc0 100644 --- a/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java +++ b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfParser.java @@ -15,14 +15,18 @@ package org.apache.juneau.jena; import static org.apache.juneau.internal.StringUtils.*; import static org.apache.juneau.jena.Constants.*; import static org.apache.juneau.jena.RdfCommonContext.*; +import static org.apache.juneau.jena.RdfParserContext.*; import java.lang.reflect.*; import java.util.*; import org.apache.juneau.*; import org.apache.juneau.annotation.*; +import org.apache.juneau.jena.annotation.*; import org.apache.juneau.parser.*; import org.apache.juneau.transform.*; +import org.apache.juneau.xml.*; +import org.apache.juneau.xml.annotation.*; import com.hp.hpl.jena.rdf.model.*; import com.hp.hpl.jena.util.iterator.*; @@ -70,7 +74,7 @@ public class RdfParser extends ReaderParser { public static class Xml extends RdfParser { /** Constructor */ public Xml() { - setProperty(RDF_language, LANG_RDF_XML); + setLanguage(LANG_RDF_XML); } } @@ -79,7 +83,7 @@ public class RdfParser extends ReaderParser { public static class NTriple extends RdfParser { /** Constructor */ public NTriple() { - setProperty(RDF_language, LANG_NTRIPLE); + setLanguage(LANG_NTRIPLE); } } @@ -88,7 +92,7 @@ public class RdfParser extends ReaderParser { public static class Turtle extends RdfParser { /** Constructor */ public Turtle() { - setProperty(RDF_language, LANG_TURTLE); + setLanguage(LANG_TURTLE); } } @@ -97,7 +101,7 @@ public class RdfParser extends ReaderParser { public static class N3 extends RdfParser { /** Constructor */ public N3() { - setProperty(RDF_language, LANG_N3); + setLanguage(LANG_N3); } } @@ -420,58 +424,649 @@ public class RdfParser extends ReaderParser { return l; } + //-------------------------------------------------------------------------------- - // Overridden methods + // Entry point methods //-------------------------------------------------------------------------------- @Override /* Parser */ public RdfParserSession createSession(Object input, ObjectMap op, Method javaMethod, Object outer, Locale locale, TimeZone timeZone, MediaType mediaType) { return new RdfParserSession(getContext(RdfParserContext.class), op, input, javaMethod, outer, locale, timeZone, mediaType); } + + + //-------------------------------------------------------------------------------- + // Properties + //-------------------------------------------------------------------------------- + + /** + * <b>Configuration property:</b> Trim whitespace from text elements. + * <p> + * <ul> + * <li><b>Name:</b> <js>"RdfParser.trimWhitespace"</js> + * <li><b>Data type:</b> <code>Boolean</code> + * <li><b>Default:</b> <jk>false</jk> + * <li><b>Session-overridable:</b> <jk>true</jk> + * </ul> + * <p> + * If <jk>true</jk>, whitespace in text elements will be automatically trimmed. + * <p> + * <h5 class='section'>Notes:</h5> + * <ul> + * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_trimWhitespace</jsf>, value)</code>. + * </ul> + * + * @param value The new value for this property. + * @return This object (for method chaining). + * @throws LockedException If {@link #lock()} was called on this class. + * @see RdfParserContext#RDF_trimWhitespace + */ + public RdfParser setTrimWhitespace(boolean value) throws LockedException { + return setProperty(RDF_trimWhitespace, value); + } + + /** + * <b>Configuration property:</b> RDF language. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.language"</js> + * <li><b>Data type:</b> <code>String</code> + * <li><b>Default:</b> <js>"RDF/XML-ABBREV"</js> + * </ul> + * <p> + * Can be any of the following: + * <ul class='spaced-list'> + * <li><js>"RDF/XML"</js> + * <li><js>"RDF/XML-ABBREV"</js> + * <li><js>"N-TRIPLE"</js> + * <li><js>"N3"</js> - General name for the N3 writer. + * Will make a decision on exactly which writer to use (pretty writer, plain writer or simple writer) when created. + * Default is the pretty writer but can be overridden with system property <code>com.hp.hpl.jena.n3.N3JenaWriter.writer</code>. + * <li><js>"N3-PP"</js> - Name of the N3 pretty writer. + * The pretty writer uses a frame-like layout, with prefixing, clustering like properties and embedding one-referenced bNodes. + * <li><js>"N3-PLAIN"</js> - Name of the N3 plain writer. + * The plain writer writes records by subject. + * <li><js>"N3-TRIPLES"</js> - Name of the N3 triples writer. + * This writer writes one line per statement, like N-Triples, but does N3-style prefixing. + * <li><js>"TURTLE"</js> - Turtle writer. + * http://www.dajobe.org/2004/01/turtle/ + * </ul> + * <p> + * <h5 class='section'>Notes:</h5> + * <ul> + * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_language</jsf>, value)</code>. + * </ul> + * + * @param value The new value for this property. + * @return This object (for method chaining). + * @throws LockedException If {@link #lock()} was called on this class. + * @see RdfParserContext#RDF_language + */ + public RdfParser setLanguage(String value) throws LockedException { + return setProperty(RDF_language, value); + } + + /** + * <b>Configuration property:</b> XML namespace for Juneau properties. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.juneauNs"</js> + * <li><b>Data type:</b> {@link Namespace} + * <li><b>Default:</b> <code>{j:<js>'http://www.apache.org/juneau/'</js>}</code> + * </ul> + * <p> + * <h5 class='section'>Notes:</h5> + * <ul> + * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_juneauNs</jsf>, value)</code>. + * </ul> + * + * @param value The new value for this property. + * @return This object (for method chaining). + * @throws LockedException If {@link #lock()} was called on this class. + * @see RdfParserContext#RDF_juneauNs + */ + public RdfParser setJuneauNs(Namespace value) throws LockedException { + return setProperty(RDF_juneauNs, value); + } + + /** + * <b>Configuration property:</b> Default XML namespace for bean properties. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.juneauBpNs"</js> + * <li><b>Data type:</b> {@link Namespace} + * <li><b>Default:</b> <code>{j:<js>'http://www.apache.org/juneaubp/'</js>}</code> + * </ul> + * <p> + * <h5 class='section'>Notes:</h5> + * <ul> + * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_juneauBpNs</jsf>, value)</code>. + * </ul> + * + * @param value The new value for this property. + * @return This object (for method chaining). + * @throws LockedException If {@link #lock()} was called on this class. + * @see RdfParserContext#RDF_juneauBpNs + */ + public RdfParser setJuneauBpNs(Namespace value) throws LockedException { + return setProperty(RDF_juneauBpNs, value); + } + + /** + * <b>Configuration property:</b> Reuse XML namespaces when RDF namespaces not specified. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.useXmlNamespaces"</js> + * <li><b>Data type:</b> <code>Boolean</code> + * <li><b>Default:</b> <jk>true</jk> + * </ul> + * <p> + * When specified, namespaces defined using {@link XmlNs} and {@link Xml} will be inherited by the RDF serializers. + * Otherwise, namespaces will be defined using {@link RdfNs} and {@link Rdf}. + * <p> + * <h5 class='section'>Notes:</h5> + * <ul> + * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_useXmlNamespaces</jsf>, value)</code>. + * </ul> + * + * @param value The new value for this property. + * @return This object (for method chaining). + * @throws LockedException If {@link #lock()} was called on this class. + * @see RdfParserContext#RDF_useXmlNamespaces + */ + public RdfParser setUseXmlNamespaces(boolean value) throws LockedException { + return setProperty(RDF_useXmlNamespaces, value); + } + + /** + * <b>Configuration property:</b> RDF format for representing collections and arrays. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.collectionFormat"</js> + * <li><b>Data type:</b> <code>RdfCollectionFormat</code> + * <li><b>Default:</b> <js>"DEFAULT"</js> + * </ul> + * <p> + * Possible values: + * <ul class='spaced-list'> + * <li><js>"DEFAULT"</js> - Default format. The default is an RDF Sequence container. + * <li><js>"SEQ"</js> - RDF Sequence container. + * <li><js>"BAG"</js> - RDF Bag container. + * <li><js>"LIST"</js> - RDF List container. + * <li><js>"MULTI_VALUED"</js> - Multi-valued properties. + * </ul> + * <p> + * <h5 class='section'>Notes:</h5> + * <ul> + * <li>If you use <js>"BAG"</js> or <js>"MULTI_VALUED"</js>, the order of the elements in the collection will get lost. + * </ul> + * <p> + * <h5 class='section'>Notes:</h5> + * <ul> + * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_collectionFormat</jsf>, value)</code>. + * <li>This introduces a slight performance penalty. + * </ul> + * + * @param value The new value for this property. + * @return This object (for method chaining). + * @throws LockedException If {@link #lock()} was called on this class. + * @see RdfCommonContext#RDF_collectionFormat + */ + public RdfParser setCollectionFormat(RdfCollectionFormat value) throws LockedException { + return setProperty(RDF_collectionFormat, value); + } + + /** + * <b>Configuration property:</b> Collections should be serialized and parsed as loose collections. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.looseCollections"</js> + * <li><b>Data type:</b> <code>Boolean</code> + * <li><b>Default:</b> <jk>false</jk> + * </ul> + * <p> + * When specified, collections of resources are handled as loose collections of resources in RDF instead of + * resources that are children of an RDF collection (e.g. Sequence, Bag). + * <p> + * Note that this setting is specialized for RDF syntax, and is incompatible with the concept of + * losslessly representing POJO models, since the tree structure of these POJO models are lost + * when serialized as loose collections. + * <p> + * This setting is typically only useful if the beans being parsed into do not have a bean property + * annotated with {@link Rdf#beanUri @Rdf(beanUri=true)}. + * + * <h5 class='section'>Example:</h5> + * <p class='bcode'> + * WriterSerializer s = <jk>new</jk> RdfSerializer.XmlAbbrev().setLooseCollections(<jk>true</jk>); + * ReaderParser p = <jk>new</jk> RdfParser.Xml().setLooseCollections(<jk>true</jk>); + * + * List<MyBean> l = createListOfMyBeans(); + * + * <jc>// Serialize to RDF/XML as loose resources</jc> + * String rdfXml = s.serialize(l); + * + * <jc>// Parse back into a Java collection</jc> + * l = p.parse(rdfXml, LinkedList.<jk>class</jk>, MyBean.<jk>class</jk>); + * + * MyBean[] b = createArrayOfMyBeans(); + * + * <jc>// Serialize to RDF/XML as loose resources</jc> + * String rdfXml = s.serialize(b); + * + * <jc>// Parse back into a bean array</jc> + * b = p.parse(rdfXml, MyBean[].<jk>class</jk>); + * </p> + * <p> + * <h5 class='section'>Notes:</h5> + * <ul> + * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_looseCollections</jsf>, value)</code>. + * </ul> + * + * @param value The new value for this property. + * @return This object (for method chaining). + * @throws LockedException If {@link #lock()} was called on this class. + * @see RdfCommonContext#RDF_looseCollections + */ + public RdfParser setLooseCollections(boolean value) throws LockedException { + return setProperty(RDF_looseCollections, value); + } + + @Override /* Parser */ + public RdfParser setTrimStrings(boolean value) throws LockedException { + super.setTrimStrings(value); + return this; + } + + @Override /* Parser */ + public RdfParser setStrict(boolean value) throws LockedException { + super.setStrict(value); + return this; + } + + @Override /* Parser */ + public RdfParser setInputStreamCharset(String value) throws LockedException { + super.setInputStreamCharset(value); + return this; + } + + @Override /* Parser */ + public RdfParser setFileCharset(String value) throws LockedException { + super.setFileCharset(value); + return this; + } @Override /* CoreApi */ - public RdfParser setProperty(String property, Object value) throws LockedException { - super.setProperty(property, value); + public RdfParser setBeansRequireDefaultConstructor(boolean value) throws LockedException { + super.setBeansRequireDefaultConstructor(value); return this; } @Override /* CoreApi */ - public RdfParser setProperties(ObjectMap properties) throws LockedException { - super.setProperties(properties); + public RdfParser setBeansRequireSerializable(boolean value) throws LockedException { + super.setBeansRequireSerializable(value); + return this; + } + + @Override /* CoreApi */ + public RdfParser setBeansRequireSettersForGetters(boolean value) throws LockedException { + super.setBeansRequireSettersForGetters(value); + return this; + } + + @Override /* CoreApi */ + public RdfParser setBeansRequireSomeProperties(boolean value) throws LockedException { + super.setBeansRequireSomeProperties(value); + return this; + } + + @Override /* CoreApi */ + public RdfParser setBeanMapPutReturnsOldValue(boolean value) throws LockedException { + super.setBeanMapPutReturnsOldValue(value); + return this; + } + + @Override /* CoreApi */ + public RdfParser setBeanConstructorVisibility(Visibility value) throws LockedException { + super.setBeanConstructorVisibility(value); + return this; + } + + @Override /* CoreApi */ + public RdfParser setBeanClassVisibility(Visibility value) throws LockedException { + super.setBeanClassVisibility(value); + return this; + } + + @Override /* CoreApi */ + public RdfParser setBeanFieldVisibility(Visibility value) throws LockedException { + super.setBeanFieldVisibility(value); return this; } @Override /* CoreApi */ - public RdfParser addNotBeanClasses(Class<?>...classes) throws LockedException { - super.addNotBeanClasses(classes); + public RdfParser setMethodVisibility(Visibility value) throws LockedException { + super.setMethodVisibility(value); return this; } @Override /* CoreApi */ - public RdfParser addBeanFilters(Class<?>...classes) throws LockedException { - super.addBeanFilters(classes); + public RdfParser setUseJavaBeanIntrospector(boolean value) throws LockedException { + super.setUseJavaBeanIntrospector(value); return this; } @Override /* CoreApi */ - public RdfParser addPojoSwaps(Class<?>...classes) throws LockedException { - super.addPojoSwaps(classes); + public RdfParser setUseInterfaceProxies(boolean value) throws LockedException { + super.setUseInterfaceProxies(value); return this; } @Override /* CoreApi */ - public RdfParser addToDictionary(Class<?>...classes) throws LockedException { - super.addToDictionary(classes); + public RdfParser setIgnoreUnknownBeanProperties(boolean value) throws LockedException { + super.setIgnoreUnknownBeanProperties(value); return this; } @Override /* CoreApi */ - public <T> RdfParser addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException { + public RdfParser setIgnoreUnknownNullBeanProperties(boolean value) throws LockedException { + super.setIgnoreUnknownNullBeanProperties(value); + return this; + } + + @Override /* CoreApi */ + public RdfParser setIgnorePropertiesWithoutSetters(boolean value) throws LockedException { + super.setIgnorePropertiesWithoutSetters(value); + return this; + } + + @Override /* CoreApi */ + public RdfParser setIgnoreInvocationExceptionsOnGetters(boolean value) throws LockedException { + super.setIgnoreInvocationExceptionsOnGetters(value); + return this; + } + + @Override /* CoreApi */ + public RdfParser setIgnoreInvocationExceptionsOnSetters(boolean value) throws LockedException { + super.setIgnoreInvocationExceptionsOnSetters(value); + return this; + } + + @Override /* CoreApi */ + public RdfParser setSortProperties(boolean value) throws LockedException { + super.setSortProperties(value); + return this; + } + + @Override /* CoreApi */ + public RdfParser setNotBeanPackages(String...values) throws LockedException { + super.setNotBeanPackages(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser setNotBeanPackages(Collection<String> values) throws LockedException { + super.setNotBeanPackages(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser addNotBeanPackages(String...values) throws LockedException { + super.addNotBeanPackages(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser addNotBeanPackages(Collection<String> values) throws LockedException { + super.addNotBeanPackages(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser removeNotBeanPackages(String...values) throws LockedException { + super.removeNotBeanPackages(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser removeNotBeanPackages(Collection<String> values) throws LockedException { + super.removeNotBeanPackages(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser setNotBeanClasses(Class<?>...values) throws LockedException { + super.setNotBeanClasses(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser setNotBeanClasses(Collection<Class<?>> values) throws LockedException { + super.setNotBeanClasses(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser addNotBeanClasses(Class<?>...values) throws LockedException { + super.addNotBeanClasses(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser addNotBeanClasses(Collection<Class<?>> values) throws LockedException { + super.addNotBeanClasses(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser removeNotBeanClasses(Class<?>...values) throws LockedException { + super.removeNotBeanClasses(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser removeNotBeanClasses(Collection<Class<?>> values) throws LockedException { + super.removeNotBeanClasses(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser setBeanFilters(Class<?>...values) throws LockedException { + super.setBeanFilters(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser setBeanFilters(Collection<Class<?>> values) throws LockedException { + super.setBeanFilters(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser addBeanFilters(Class<?>...values) throws LockedException { + super.addBeanFilters(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser addBeanFilters(Collection<Class<?>> values) throws LockedException { + super.addBeanFilters(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser removeBeanFilters(Class<?>...values) throws LockedException { + super.removeBeanFilters(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser removeBeanFilters(Collection<Class<?>> values) throws LockedException { + super.removeBeanFilters(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser setPojoSwaps(Class<?>...values) throws LockedException { + super.setPojoSwaps(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser setPojoSwaps(Collection<Class<?>> values) throws LockedException { + super.setPojoSwaps(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser addPojoSwaps(Class<?>...values) throws LockedException { + super.addPojoSwaps(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser addPojoSwaps(Collection<Class<?>> values) throws LockedException { + super.addPojoSwaps(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser removePojoSwaps(Class<?>...values) throws LockedException { + super.removePojoSwaps(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser removePojoSwaps(Collection<Class<?>> values) throws LockedException { + super.removePojoSwaps(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser setImplClasses(Map<Class<?>,Class<?>> values) throws LockedException { + super.setImplClasses(values); + return this; + } + + @Override /* CoreApi */ + public <T> CoreApi addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException { super.addImplClass(interfaceClass, implClass); return this; } @Override /* CoreApi */ + public RdfParser setBeanDictionary(Class<?>...values) throws LockedException { + super.setBeanDictionary(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser setBeanDictionary(Collection<Class<?>> values) throws LockedException { + super.setBeanDictionary(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser addToBeanDictionary(Class<?>...values) throws LockedException { + super.addToBeanDictionary(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser addToBeanDictionary(Collection<Class<?>> values) throws LockedException { + super.addToBeanDictionary(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser removeFromBeanDictionary(Class<?>...values) throws LockedException { + super.removeFromBeanDictionary(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser removeFromBeanDictionary(Collection<Class<?>> values) throws LockedException { + super.removeFromBeanDictionary(values); + return this; + } + + @Override /* CoreApi */ + public RdfParser setBeanTypePropertyName(String value) throws LockedException { + super.setBeanTypePropertyName(value); + return this; + } + + @Override /* CoreApi */ + public RdfParser setDefaultParser(Class<?> value) throws LockedException { + super.setDefaultParser(value); + return this; + } + + @Override /* CoreApi */ + public RdfParser setLocale(Locale value) throws LockedException { + super.setLocale(value); + return this; + } + + @Override /* CoreApi */ + public RdfParser setTimeZone(TimeZone value) throws LockedException { + super.setTimeZone(value); + return this; + } + + @Override /* CoreApi */ + public RdfParser setMediaType(MediaType value) throws LockedException { + super.setMediaType(value); + return this; + } + + @Override /* CoreApi */ + public RdfParser setDebug(boolean value) throws LockedException { + super.setDebug(value); + return this; + } + + @Override /* CoreApi */ + public RdfParser setProperty(String name, Object value) throws LockedException { + super.setProperty(name, value); + return this; + } + + @Override /* CoreApi */ + public RdfParser setProperties(ObjectMap properties) throws LockedException { + super.setProperties(properties); + return this; + } + + @Override /* CoreApi */ + public RdfParser addToProperty(String name, Object value) throws LockedException { + super.addToProperty(name, value); + return this; + } + + @Override /* CoreApi */ + public RdfParser putToProperty(String name, Object key, Object value) throws LockedException { + super.putToProperty(name, key, value); + return this; + } + + @Override /* CoreApi */ + public RdfParser putToProperty(String name, Object value) throws LockedException { + super.putToProperty(name, value); + return this; + } + + @Override /* CoreApi */ + public RdfParser removeFromProperty(String name, Object value) throws LockedException { + super.removeFromProperty(name, value); + return this; + } + + + //-------------------------------------------------------------------------------- + // Overridden methods + //-------------------------------------------------------------------------------- + + @Override /* CoreApi */ public RdfParser setClassLoader(ClassLoader classLoader) throws LockedException { super.setClassLoader(classLoader); return this; http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfParserContext.java ---------------------------------------------------------------------- diff --git a/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfParserContext.java b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfParserContext.java index 224dc13..0161f11 100644 --- a/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfParserContext.java +++ b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfParserContext.java @@ -24,31 +24,8 @@ import org.apache.juneau.xml.*; * Context properties are set by calling {@link ContextFactory#setProperty(String, Object)} on the context factory * returned {@link CoreApi#getContextFactory()}. * <p> - * The following convenience methods are also provided for setting context properties: - * <ul> - * <li>{@link RdfParser#setProperty(String,Object)} - * <li>{@link RdfParser#setProperties(ObjectMap)} - * <li>{@link RdfParser#addNotBeanClasses(Class[])} - * <li>{@link RdfParser#addBeanFilters(Class[])} - * <li>{@link RdfParser#addPojoSwaps(Class[])} - * <li>{@link RdfParser#addToDictionary(Class[])} - * <li>{@link RdfParser#addImplClass(Class,Class)} - * </ul> - * <p> * See {@link ContextFactory} for more information about context properties. * - * <h6 class='topic' id='ConfigProperties'>Configurable properties on the RDF parsers</h6> - * <table class='styled' style='border-collapse: collapse;'> - * <tr><th>Setting name</th><th>Description</th><th>Data type</th><th>Default value</th><th>Session overridable</th></tr> - * <tr> - * <td>{@link #RDF_trimWhitespace}</td> - * <td>Trim whitespace from text elements.</td> - * <td><code>Boolean</code></td> - * <td><jk>false</jk></td> - * <td><jk>true</jk></td> - * </tr> - * </table> - * * <h6 class='topic' id='ConfigProperties'>Configurable properties inherited by the RDF parsers</h6> * <ul class='javahierarchy'> * <li class='c'><a class="doclink" href="../BeanContext.html#ConfigProperties">BeanContext</a> - Properties associated with handling beans on serializers and parsers. http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java ---------------------------------------------------------------------- diff --git a/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java index f296666..9bb6d94 100644 --- a/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java +++ b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfSerializer.java @@ -14,6 +14,7 @@ package org.apache.juneau.jena; import static org.apache.juneau.jena.Constants.*; import static org.apache.juneau.jena.RdfCommonContext.*; +import static org.apache.juneau.jena.RdfSerializerContext.*; import java.lang.reflect.*; import java.util.*; @@ -21,9 +22,11 @@ import java.util.*; import org.apache.juneau.*; import org.apache.juneau.annotation.*; import org.apache.juneau.internal.*; +import org.apache.juneau.jena.annotation.*; import org.apache.juneau.serializer.*; import org.apache.juneau.transform.*; import org.apache.juneau.xml.*; +import org.apache.juneau.xml.annotation.*; import com.hp.hpl.jena.rdf.model.*; @@ -75,7 +78,7 @@ public class RdfSerializer extends WriterSerializer { public static class Xml extends RdfSerializer { /** Constructor */ public Xml() { - setProperty(RDF_language, LANG_RDF_XML); + setLanguage(LANG_RDF_XML); } } @@ -84,7 +87,7 @@ public class RdfSerializer extends WriterSerializer { public static class XmlAbbrev extends RdfSerializer { /** Constructor */ public XmlAbbrev() { - setProperty(RDF_language, LANG_RDF_XML_ABBREV); + setLanguage(LANG_RDF_XML_ABBREV); } } @@ -93,7 +96,7 @@ public class RdfSerializer extends WriterSerializer { public static class NTriple extends RdfSerializer { /** Constructor */ public NTriple() { - setProperty(RDF_language, LANG_NTRIPLE); + setLanguage(LANG_NTRIPLE); } } @@ -102,7 +105,7 @@ public class RdfSerializer extends WriterSerializer { public static class Turtle extends RdfSerializer { /** Constructor */ public Turtle() { - setProperty(RDF_language, LANG_TURTLE); + setLanguage(LANG_TURTLE); } } @@ -111,7 +114,7 @@ public class RdfSerializer extends WriterSerializer { public static class N3 extends RdfSerializer { /** Constructor */ public N3() { - setProperty(RDF_language, LANG_N3); + setLanguage(LANG_N3); } } @@ -387,8 +390,9 @@ public class RdfSerializer extends WriterSerializer { } + //-------------------------------------------------------------------------------- - // Overridden methods + // Entry point methods //-------------------------------------------------------------------------------- @Override /* Serializer */ @@ -396,49 +400,799 @@ public class RdfSerializer extends WriterSerializer { return new RdfSerializerSession(getContext(RdfSerializerContext.class), op, output, javaMethod, locale, timeZone, mediaType); } + + //-------------------------------------------------------------------------------- + // Properties + //-------------------------------------------------------------------------------- + + /** + * <b>Configuration property:</b> RDF language. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.language"</js> + * <li><b>Data type:</b> <code>String</code> + * <li><b>Default:</b> <js>"RDF/XML-ABBREV"</js> + * </ul> + * <p> + * Can be any of the following: + * <ul class='spaced-list'> + * <li><js>"RDF/XML"</js> + * <li><js>"RDF/XML-ABBREV"</js> + * <li><js>"N-TRIPLE"</js> + * <li><js>"N3"</js> - General name for the N3 writer. + * Will make a decision on exactly which writer to use (pretty writer, plain writer or simple writer) when created. + * Default is the pretty writer but can be overridden with system property <code>com.hp.hpl.jena.n3.N3JenaWriter.writer</code>. + * <li><js>"N3-PP"</js> - Name of the N3 pretty writer. + * The pretty writer uses a frame-like layout, with prefixing, clustering like properties and embedding one-referenced bNodes. + * <li><js>"N3-PLAIN"</js> - Name of the N3 plain writer. + * The plain writer writes records by subject. + * <li><js>"N3-TRIPLES"</js> - Name of the N3 triples writer. + * This writer writes one line per statement, like N-Triples, but does N3-style prefixing. + * <li><js>"TURTLE"</js> - Turtle writer. + * http://www.dajobe.org/2004/01/turtle/ + * </ul> + * <p> + * <h5 class='section'>Notes:</h5> + * <ul> + * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_language</jsf>, value)</code>. + * <li>This introduces a slight performance penalty. + * </ul> + * + * @param value The new value for this property. + * @return This object (for method chaining). + * @throws LockedException If {@link #lock()} was called on this class. + * @see RdfCommonContext#RDF_language + */ + public RdfSerializer setLanguage(String value) throws LockedException { + return setProperty(RDF_language, value); + } + + /** + * <b>Configuration property:</b> XML namespace for Juneau properties. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.juneauNs"</js> + * <li><b>Data type:</b> {@link Namespace} + * <li><b>Default:</b> <code>{j:<js>'http://www.apache.org/juneau/'</js>}</code> + * </ul> + * <p> + * <h5 class='section'>Notes:</h5> + * <ul> + * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_juneauNs</jsf>, value)</code>. + * <li>This introduces a slight performance penalty. + * </ul> + * + * @param value The new value for this property. + * @return This object (for method chaining). + * @throws LockedException If {@link #lock()} was called on this class. + * @see RdfSerializerContext#RDF_juneauNs + */ + public RdfSerializer setJuneauNs(Namespace value) throws LockedException { + return setProperty(RDF_juneauNs, value); + } + + /** + * <b>Configuration property:</b> Default XML namespace for bean properties. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.juneauBpNs"</js> + * <li><b>Data type:</b> {@link Namespace} + * <li><b>Default:</b> <code>{j:<js>'http://www.apache.org/juneaubp/'</js>}</code> + * </ul> + * <p> + * <h5 class='section'>Notes:</h5> + * <ul> + * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_juneauBpNs</jsf>, value)</code>. + * <li>This introduces a slight performance penalty. + * </ul> + * + * @param value The new value for this property. + * @return This object (for method chaining). + * @throws LockedException If {@link #lock()} was called on this class. + * @see RdfSerializerContext#RDF_juneauBpNs + */ + public RdfSerializer setJuneauBpNs(Namespace value) throws LockedException { + return setProperty(RDF_juneauBpNs, value); + } + + /** + * <b>Configuration property:</b> Reuse XML namespaces when RDF namespaces not specified. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.useXmlNamespaces"</js> + * <li><b>Data type:</b> <code>Boolean</code> + * <li><b>Default:</b> <jk>true</jk> + * </ul> + * <p> + * When specified, namespaces defined using {@link XmlNs} and {@link Xml} will be inherited by the RDF serializers. + * Otherwise, namespaces will be defined using {@link RdfNs} and {@link Rdf}. + * <p> + * <h5 class='section'>Notes:</h5> + * <ul> + * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_useXmlNamespaces</jsf>, value)</code>. + * <li>This introduces a slight performance penalty. + * </ul> + * + * @param value The new value for this property. + * @return This object (for method chaining). + * @throws LockedException If {@link #lock()} was called on this class. + * @see SerializerContext#SERIALIZER_sortMaps + */ + public RdfSerializer setUseXmlNamespaces(boolean value) throws LockedException { + return setProperty(RDF_useXmlNamespaces, value); + } + + /** + * <b>Configuration property:</b> Add XSI data types to non-<code>String</code> literals. + * <p> + * <ul> + * <li><b>Name:</b> <js>"RdfSerializer.addLiteralTypes"</js> + * <li><b>Data type:</b> <code>Boolean</code> + * <li><b>Default:</b> <jk>false</jk> + * <li><b>Session-overridable:</b> <jk>true</jk> + * </ul> + * <p> + * <h5 class='section'>Notes:</h5> + * <ul> + * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_addLiteralTypes</jsf>, value)</code>. + * <li>This introduces a slight performance penalty. + * </ul> + * + * @param value The new value for this property. + * @return This object (for method chaining). + * @throws LockedException If {@link #lock()} was called on this class. + * @see RdfSerializerContext#RDF_addLiteralTypes + */ + public RdfSerializer setAddLiteralTypes(boolean value) throws LockedException { + return setProperty(RDF_addLiteralTypes, value); + } + + /** + * <b>Configuration property:</b> Add RDF root identifier property to root node. + * <p> + * <ul> + * <li><b>Name:</b> <js>"RdfSerializer.addRootProperty"</js> + * <li><b>Data type:</b> <code>Boolean</code> + * <li><b>Default:</b> <jk>false</jk> + * <li><b>Session-overridable:</b> <jk>true</jk> + * </ul> + * <p> + * When enabled an RDF property <code>http://www.apache.org/juneau/root</code> is added with a value of <js>"true"</js> + * to identify the root node in the graph. + * This helps locate the root node during parsing. + * <p> + * If disabled, the parser has to search through the model to find any resources without + * incoming predicates to identify root notes, which can introduce a considerable performance + * degradation. + * <p> + * <h5 class='section'>Notes:</h5> + * <ul> + * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_addRootProperty</jsf>, value)</code>. + * <li>This introduces a slight performance penalty. + * </ul> + * + * @param value The new value for this property. + * @return This object (for method chaining). + * @throws LockedException If {@link #lock()} was called on this class. + * @see RdfSerializerContext#RDF_addRootProperty + */ + public RdfSerializer setAddRootProperty(boolean value) throws LockedException { + return setProperty(RDF_addRootProperty, value); + } + + /** + * <b>Configuration property:</b> Auto-detect namespace usage. + * <p> + * <ul> + * <li><b>Name:</b> <js>"RdfSerializer.autoDetectNamespaces"</js> + * <li><b>Data type:</b> <code>Boolean</code> + * <li><b>Default:</b> <jk>true</jk> + * <li><b>Session-overridable:</b> <jk>true</jk> + * </ul> + * <p> + * Detect namespace usage before serialization. + * <p> + * If enabled, then the data structure will first be crawled looking for + * namespaces that will be encountered before the root element is + * serialized. + * <p> + * <h5 class='section'>Notes:</h5> + * <ul> + * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_autoDetectNamespaces</jsf>, value)</code>. + * <li>This introduces a slight performance penalty. + * </ul> + * + * @param value The new value for this property. + * @return This object (for method chaining). + * @throws LockedException If {@link #lock()} was called on this class. + * @see RdfSerializerContext#RDF_autoDetectNamespaces + */ + public RdfSerializer setAutoDetectNamespaces(boolean value) throws LockedException { + return setProperty(RDF_autoDetectNamespaces, value); + } + + /** + * <b>Configuration property:</b> Default namespaces. + * <p> + * <ul> + * <li><b>Name:</b> <js>"RdfSerializer.namespaces.list"</js> + * <li><b>Data type:</b> <code>List<{@link Namespace}></code> + * <li><b>Default:</b> empty list + * <li><b>Session-overridable:</b> <jk>true</jk> + * </ul> + * <p> + * The default list of namespaces associated with this serializer. + * <p> + * <h5 class='section'>Notes:</h5> + * <ul> + * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_namespaces</jsf>, values)</code>. + * <li>This introduces a slight performance penalty. + * </ul> + * + * @param values The new value for this property. + * @return This object (for method chaining). + * @throws LockedException If {@link #lock()} was called on this class. + * @see RdfSerializerContext#RDF_namespaces + */ + public RdfSerializer setNamespaces(Namespace...values) throws LockedException { + return setProperty(RDF_namespaces, values); + } + + /** + * <b>Configuration property:</b> RDF format for representing collections and arrays. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.collectionFormat"</js> + * <li><b>Data type:</b> <code>RdfCollectionFormat</code> + * <li><b>Default:</b> <js>"DEFAULT"</js> + * </ul> + * <p> + * Possible values: + * <ul class='spaced-list'> + * <li><js>"DEFAULT"</js> - Default format. The default is an RDF Sequence container. + * <li><js>"SEQ"</js> - RDF Sequence container. + * <li><js>"BAG"</js> - RDF Bag container. + * <li><js>"LIST"</js> - RDF List container. + * <li><js>"MULTI_VALUED"</js> - Multi-valued properties. + * </ul> + * <p> + * <h5 class='section'>Notes:</h5> + * <ul> + * <li>If you use <js>"BAG"</js> or <js>"MULTI_VALUED"</js>, the order of the elements in the collection will get lost. + * </ul> + * <p> + * <h5 class='section'>Notes:</h5> + * <ul> + * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_collectionFormat</jsf>, value)</code>. + * <li>This introduces a slight performance penalty. + * </ul> + * + * @param value The new value for this property. + * @return This object (for method chaining). + * @throws LockedException If {@link #lock()} was called on this class. + * @see RdfCommonContext#RDF_collectionFormat + */ + public RdfSerializer setCollectionFormat(RdfCollectionFormat value) throws LockedException { + return setProperty(RDF_collectionFormat, value); + } + + /** + * <b>Configuration property:</b> Collections should be serialized and parsed as loose collections. + * <p> + * <ul> + * <li><b>Name:</b> <js>"Rdf.looseCollections"</js> + * <li><b>Data type:</b> <code>Boolean</code> + * <li><b>Default:</b> <jk>false</jk> + * </ul> + * <p> + * When specified, collections of resources are handled as loose collections of resources in RDF instead of + * resources that are children of an RDF collection (e.g. Sequence, Bag). + * <p> + * Note that this setting is specialized for RDF syntax, and is incompatible with the concept of + * losslessly representing POJO models, since the tree structure of these POJO models are lost + * when serialized as loose collections. + * <p> + * This setting is typically only useful if the beans being parsed into do not have a bean property + * annotated with {@link Rdf#beanUri @Rdf(beanUri=true)}. + * + * <h5 class='section'>Example:</h5> + * <p class='bcode'> + * WriterSerializer s = <jk>new</jk> RdfSerializer.XmlAbbrev().setLooseCollections(<jk>true</jk>); + * ReaderParser p = <jk>new</jk> RdfParser.Xml().setLooseCollections(<jk>true</jk>); + * + * List<MyBean> l = createListOfMyBeans(); + * + * <jc>// Serialize to RDF/XML as loose resources</jc> + * String rdfXml = s.serialize(l); + * + * <jc>// Parse back into a Java collection</jc> + * l = p.parse(rdfXml, LinkedList.<jk>class</jk>, MyBean.<jk>class</jk>); + * + * MyBean[] b = createArrayOfMyBeans(); + * + * <jc>// Serialize to RDF/XML as loose resources</jc> + * String rdfXml = s.serialize(b); + * + * <jc>// Parse back into a bean array</jc> + * b = p.parse(rdfXml, MyBean[].<jk>class</jk>); + * </p> + * <p> + * <h5 class='section'>Notes:</h5> + * <ul> + * <li>This is equivalent to calling <code>setProperty(<jsf>RDF_looseCollections</jsf>, value)</code>. + * </ul> + * + * @param value The new value for this property. + * @return This object (for method chaining). + * @throws LockedException If {@link #lock()} was called on this class. + * @see RdfCommonContext#RDF_looseCollections + */ + public RdfSerializer setLooseCollections(boolean value) throws LockedException { + return setProperty(RDF_looseCollections, value); + } + + @Override /* Serializer */ + public RdfSerializer setMaxDepth(int value) throws LockedException { + super.setMaxDepth(value); + return this; + } + + @Override /* Serializer */ + public RdfSerializer setInitialDepth(int value) throws LockedException { + super.setInitialDepth(value); + return this; + } + + @Override /* Serializer */ + public RdfSerializer setDetectRecursions(boolean value) throws LockedException { + super.setDetectRecursions(value); + return this; + } + + @Override /* Serializer */ + public RdfSerializer setIgnoreRecursions(boolean value) throws LockedException { + super.setIgnoreRecursions(value); + return this; + } + + @Override /* Serializer */ + public RdfSerializer setUseIndentation(boolean value) throws LockedException { + super.setUseIndentation(value); + return this; + } + + @Override /* Serializer */ + public RdfSerializer setAddBeanTypeProperties(boolean value) throws LockedException { + super.setAddBeanTypeProperties(value); + return this; + } + + @Override /* Serializer */ + public RdfSerializer setQuoteChar(char value) throws LockedException { + super.setQuoteChar(value); + return this; + } + + @Override /* Serializer */ + public RdfSerializer setTrimNullProperties(boolean value) throws LockedException { + super.setTrimNullProperties(value); + return this; + } + + @Override /* Serializer */ + public RdfSerializer setTrimEmptyCollections(boolean value) throws LockedException { + super.setTrimEmptyCollections(value); + return this; + } + + @Override /* Serializer */ + public RdfSerializer setTrimEmptyMaps(boolean value) throws LockedException { + super.setTrimEmptyMaps(value); + return this; + } + + @Override /* Serializer */ + public RdfSerializer setTrimStrings(boolean value) throws LockedException { + super.setTrimStrings(value); + return this; + } + + @Override /* Serializer */ + public RdfSerializer setRelativeUriBase(String value) throws LockedException { + super.setRelativeUriBase(value); + return this; + } + + @Override /* Serializer */ + public RdfSerializer setAbsolutePathUriBase(String value) throws LockedException { + super.setAbsolutePathUriBase(value); + return this; + } + + @Override /* Serializer */ + public RdfSerializer setSortCollections(boolean value) throws LockedException { + super.setSortCollections(value); + return this; + } + + @Override /* Serializer */ + public RdfSerializer setSortMaps(boolean value) throws LockedException { + super.setSortMaps(value); + return this; + } + @Override /* CoreApi */ - public RdfSerializer setProperty(String property, Object value) throws LockedException { - super.setProperty(property, value); + public RdfSerializer setBeansRequireDefaultConstructor(boolean value) throws LockedException { + super.setBeansRequireDefaultConstructor(value); return this; } @Override /* CoreApi */ - public RdfSerializer setProperties(ObjectMap properties) throws LockedException { - super.setProperties(properties); + public RdfSerializer setBeansRequireSerializable(boolean value) throws LockedException { + super.setBeansRequireSerializable(value); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setBeansRequireSettersForGetters(boolean value) throws LockedException { + super.setBeansRequireSettersForGetters(value); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setBeansRequireSomeProperties(boolean value) throws LockedException { + super.setBeansRequireSomeProperties(value); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setBeanMapPutReturnsOldValue(boolean value) throws LockedException { + super.setBeanMapPutReturnsOldValue(value); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setBeanConstructorVisibility(Visibility value) throws LockedException { + super.setBeanConstructorVisibility(value); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setBeanClassVisibility(Visibility value) throws LockedException { + super.setBeanClassVisibility(value); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setBeanFieldVisibility(Visibility value) throws LockedException { + super.setBeanFieldVisibility(value); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setMethodVisibility(Visibility value) throws LockedException { + super.setMethodVisibility(value); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setUseJavaBeanIntrospector(boolean value) throws LockedException { + super.setUseJavaBeanIntrospector(value); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setUseInterfaceProxies(boolean value) throws LockedException { + super.setUseInterfaceProxies(value); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setIgnoreUnknownBeanProperties(boolean value) throws LockedException { + super.setIgnoreUnknownBeanProperties(value); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setIgnoreUnknownNullBeanProperties(boolean value) throws LockedException { + super.setIgnoreUnknownNullBeanProperties(value); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setIgnorePropertiesWithoutSetters(boolean value) throws LockedException { + super.setIgnorePropertiesWithoutSetters(value); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setIgnoreInvocationExceptionsOnGetters(boolean value) throws LockedException { + super.setIgnoreInvocationExceptionsOnGetters(value); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setIgnoreInvocationExceptionsOnSetters(boolean value) throws LockedException { + super.setIgnoreInvocationExceptionsOnSetters(value); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setSortProperties(boolean value) throws LockedException { + super.setSortProperties(value); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setNotBeanPackages(String...values) throws LockedException { + super.setNotBeanPackages(values); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setNotBeanPackages(Collection<String> values) throws LockedException { + super.setNotBeanPackages(values); return this; } @Override /* CoreApi */ - public RdfSerializer addNotBeanClasses(Class<?>...classes) throws LockedException { - super.addNotBeanClasses(classes); + public RdfSerializer addNotBeanPackages(String...values) throws LockedException { + super.addNotBeanPackages(values); return this; } @Override /* CoreApi */ - public RdfSerializer addBeanFilters(Class<?>...classes) throws LockedException { - super.addBeanFilters(classes); + public RdfSerializer addNotBeanPackages(Collection<String> values) throws LockedException { + super.addNotBeanPackages(values); return this; } @Override /* CoreApi */ - public RdfSerializer addPojoSwaps(Class<?>...classes) throws LockedException { - super.addPojoSwaps(classes); + public RdfSerializer removeNotBeanPackages(String...values) throws LockedException { + super.removeNotBeanPackages(values); return this; } @Override /* CoreApi */ - public RdfSerializer addToDictionary(Class<?>...classes) throws LockedException { - super.addToDictionary(classes); + public RdfSerializer removeNotBeanPackages(Collection<String> values) throws LockedException { + super.removeNotBeanPackages(values); return this; } @Override /* CoreApi */ - public <T> RdfSerializer addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException { + public RdfSerializer setNotBeanClasses(Class<?>...values) throws LockedException { + super.setNotBeanClasses(values); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setNotBeanClasses(Collection<Class<?>> values) throws LockedException { + super.setNotBeanClasses(values); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer addNotBeanClasses(Class<?>...values) throws LockedException { + super.addNotBeanClasses(values); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer addNotBeanClasses(Collection<Class<?>> values) throws LockedException { + super.addNotBeanClasses(values); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer removeNotBeanClasses(Class<?>...values) throws LockedException { + super.removeNotBeanClasses(values); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer removeNotBeanClasses(Collection<Class<?>> values) throws LockedException { + super.removeNotBeanClasses(values); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setBeanFilters(Class<?>...values) throws LockedException { + super.setBeanFilters(values); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setBeanFilters(Collection<Class<?>> values) throws LockedException { + super.setBeanFilters(values); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer addBeanFilters(Class<?>...values) throws LockedException { + super.addBeanFilters(values); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer addBeanFilters(Collection<Class<?>> values) throws LockedException { + super.addBeanFilters(values); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer removeBeanFilters(Class<?>...values) throws LockedException { + super.removeBeanFilters(values); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer removeBeanFilters(Collection<Class<?>> values) throws LockedException { + super.removeBeanFilters(values); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setPojoSwaps(Class<?>...values) throws LockedException { + super.setPojoSwaps(values); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setPojoSwaps(Collection<Class<?>> values) throws LockedException { + super.setPojoSwaps(values); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer addPojoSwaps(Class<?>...values) throws LockedException { + super.addPojoSwaps(values); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer addPojoSwaps(Collection<Class<?>> values) throws LockedException { + super.addPojoSwaps(values); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer removePojoSwaps(Class<?>...values) throws LockedException { + super.removePojoSwaps(values); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer removePojoSwaps(Collection<Class<?>> values) throws LockedException { + super.removePojoSwaps(values); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setImplClasses(Map<Class<?>,Class<?>> values) throws LockedException { + super.setImplClasses(values); + return this; + } + + @Override /* CoreApi */ + public <T> CoreApi addImplClass(Class<T> interfaceClass, Class<? extends T> implClass) throws LockedException { super.addImplClass(interfaceClass, implClass); return this; } @Override /* CoreApi */ + public RdfSerializer setBeanDictionary(Class<?>...values) throws LockedException { + super.setBeanDictionary(values); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setBeanDictionary(Collection<Class<?>> values) throws LockedException { + super.setBeanDictionary(values); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer addToBeanDictionary(Class<?>...values) throws LockedException { + super.addToBeanDictionary(values); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer addToBeanDictionary(Collection<Class<?>> values) throws LockedException { + super.addToBeanDictionary(values); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer removeFromBeanDictionary(Class<?>...values) throws LockedException { + super.removeFromBeanDictionary(values); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer removeFromBeanDictionary(Collection<Class<?>> values) throws LockedException { + super.removeFromBeanDictionary(values); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setBeanTypePropertyName(String value) throws LockedException { + super.setBeanTypePropertyName(value); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setDefaultParser(Class<?> value) throws LockedException { + super.setDefaultParser(value); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setLocale(Locale value) throws LockedException { + super.setLocale(value); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setTimeZone(TimeZone value) throws LockedException { + super.setTimeZone(value); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setMediaType(MediaType value) throws LockedException { + super.setMediaType(value); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setDebug(boolean value) throws LockedException { + super.setDebug(value); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setProperty(String name, Object value) throws LockedException { + super.setProperty(name, value); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer setProperties(ObjectMap properties) throws LockedException { + super.setProperties(properties); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer addToProperty(String name, Object value) throws LockedException { + super.addToProperty(name, value); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer putToProperty(String name, Object key, Object value) throws LockedException { + super.putToProperty(name, key, value); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer putToProperty(String name, Object value) throws LockedException { + super.putToProperty(name, value); + return this; + } + + @Override /* CoreApi */ + public RdfSerializer removeFromProperty(String name, Object value) throws LockedException { + super.removeFromProperty(name, value); + return this; + } + + + //-------------------------------------------------------------------------------- + // Overridden methods + //-------------------------------------------------------------------------------- + + @Override /* CoreApi */ public RdfSerializer setClassLoader(ClassLoader classLoader) throws LockedException { super.setClassLoader(classLoader); return this; http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/68dffad1/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfSerializerContext.java ---------------------------------------------------------------------- diff --git a/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfSerializerContext.java b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfSerializerContext.java index 2e3e5f0..7dcd923 100644 --- a/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfSerializerContext.java +++ b/juneau-core-rdf/src/main/java/org/apache/juneau/jena/RdfSerializerContext.java @@ -24,52 +24,8 @@ import org.apache.juneau.xml.*; * Context properties are set by calling {@link ContextFactory#setProperty(String, Object)} on the context factory * returned {@link CoreApi#getContextFactory()}. * <p> - * The following convenience methods are also provided for setting context properties: - * <ul> - * <li>{@link RdfSerializer#setProperty(String,Object)} - * <li>{@link RdfSerializer#setProperties(ObjectMap)} - * <li>{@link RdfSerializer#addNotBeanClasses(Class[])} - * <li>{@link RdfSerializer#addBeanFilters(Class[])} - * <li>{@link RdfSerializer#addPojoSwaps(Class[])} - * <li>{@link RdfSerializer#addToDictionary(Class[])} - * <li>{@link RdfSerializer#addImplClass(Class,Class)} - * </ul> - * <p> * See {@link ContextFactory} for more information about context properties. * - * <h6 class='topic' id='ConfigProperties'>Configurable properties on the RDF serializers</h6> - * <table class='styled' style='border-collapse: collapse;'> - * <tr><th>Setting name</th><th>Description</th><th>Data type</th><th>Default value</th><th>Session overridable</th></tr> - * <tr> - * <td>{@link #RDF_addLiteralTypes}</td> - * <td>Add XSI data types to non-<code>String</code> literals.</td> - * <td><code>Boolean</code></td> - * <td><jk>false</jk></td> - * <td><jk>true</jk></td> - * </tr> - * <tr> - * <td>{@link #RDF_addRootProperty}</td> - * <td>Add RDF root identifier property to root node.</td> - * <td><code>Boolean</code></td> - * <td><jk>false</jk></td> - * <td><jk>true</jk></td> - * </tr> - * <tr> - * <td>{@link #RDF_autoDetectNamespaces}</td> - * <td>Auto-detect namespace usage.</td> - * <td><code>Boolean</code></td> - * <td><jk>true</jk></td> - * <td><jk>true</jk></td> - * </tr> - * <tr> - * <td>{@link #RDF_namespaces}</td> - * <td>Default namespaces.</td> - * <td><code>List<{@link Namespace}></code></td> - * <td>empty list</td> - * <td><jk>true</jk></td> - * </tr> - * </table> - * * <h6 class='topic' id='ConfigProperties'>Configurable properties inherited by the RDF serializers</h6> * <ul class='javahierarchy'> * <li class='c'><a class="doclink" href="../BeanContext.html#ConfigProperties">BeanContext</a> - Properties associated with handling beans on serializers and parsers.
