Package org.apache.juneau.marshall.jena
Class RdfStreamSerializer
java.lang.Object
org.apache.juneau.marshall.Context
org.apache.juneau.marshall.MarshallingContextable
org.apache.juneau.marshall.MarshallingTraverseContext
org.apache.juneau.marshall.serializer.Serializer
org.apache.juneau.marshall.serializer.OutputStreamSerializer
org.apache.juneau.marshall.jena.RdfStreamSerializer
- All Implemented Interfaces:
Function<Object,,byte[]> ThrowingFunction<Object,,byte[]> RdfMetaProvider,XmlMetaProvider
- Direct Known Subclasses:
RdfProtoSerializer,RdfThriftSerializer
Stream-based RDF serializer for binary formats (RDF/THRIFT, RDF/PROTO).
Extends OutputStreamSerializer and delegates RDF metadata to an internal RdfSerializer.
Notes:
- This class is thread safe and reusable.
See Also:
- {doc jmr.RdfDetails}
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder class.static final classNested classes/interfaces inherited from class org.apache.juneau.marshall.serializer.Serializer
Serializer.Null -
Field Summary
Fields inherited from class org.apache.juneau.marshall.serializer.Serializer
accept, addBeanTypes, addRootType, keepNullProperties, listener, nonDefault, produces, sortCollections, sortMaps, trimEmptyCollections, trimEmptyMaps, trimStringsFields inherited from class org.apache.juneau.marshall.MarshallingContextable
marshallingContextFields inherited from class org.apache.juneau.marshall.Context
CONTEXT_APPLY_FILTER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Creates a builder from this context object.static RdfStreamSerializer.Builder<?>create()Creates a new builder.Create a session builder based on the properties defined on this context.Collection format - delegates to RdfSerializer.Juneau BP namespace - delegates to RdfSerializer.Juneau namespace - delegates to RdfSerializer.Returns the RDF language.Namespaces - delegates to RdfSerializer.getRdfBeanMeta(BeanMeta<?> bm) Returns the language-specific metadata on the specified bean.Returns the language-specific metadata on the specified bean property.getRdfClassMeta(ClassMeta<?> cm) Returns the language-specific metadata on the specified class.protected RdfSerializerReturns the delegated RdfSerializer.getXmlBeanMeta(BeanMeta<?> bm) Returns the language-specific metadata on the specified bean.Returns the language-specific metadata on the specified bean property.getXmlClassMeta(ClassMeta<?> cm) Returns the language-specific metadata on the specified class.protected booleanAdd"_type" properties when needed.booleanAdd literal types - delegates to RdfSerializer.booleanAdd root property - delegates to RdfSerializer.booleanAuto-detect namespaces - delegates to RdfSerializer.booleanLoose collections - delegates to RdfSerializer.booleanUse XML namespaces - delegates to RdfSerializer.Methods inherited from class org.apache.juneau.marshall.serializer.OutputStreamSerializer
applyThrows, getBinaryFormat, getSession, isWriterSerializer, writeMethods inherited from class org.apache.juneau.marshall.serializer.Serializer
createSerializerBuilder, doWrite, forEachAcceptMediaType, getListener, getMediaTypeRanges, getPrimaryMediaType, getResponseContentType, getResponseHeaders, getUriContext, getUriRelativity, getUriResolution, isAddRootType, isKeepNullProperties, isNonDefault, isSortCollections, isSortMaps, isTrimEmptyCollections, isTrimEmptyMaps, isTrimStrings, properties, write, writeToStringMethods inherited from class org.apache.juneau.marshall.MarshallingTraverseContext
getDetectRecursions, getIgnoreRecursions, getInitialDepth, getMaxDepth, isDetectRecursions, isIgnoreRecursions, shouldDetectRecursionsMethods inherited from class org.apache.juneau.marshall.MarshallingContextable
getDurationFormat, getMarshallingContext, getPeriodFormatMethods inherited from class org.apache.juneau.marshall.Context
createBuilder, getAnnotationProvider, init, isDebug, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.juneau.commons.function.ThrowingFunction
apply
-
Constructor Details
-
RdfStreamSerializer
Constructor.- Parameters:
builder- The builder.
Cannot benull .
-
-
Method Details
-
create
Creates a new builder.- Returns:
- A new builder.
-
copy
Description copied from class:ContextCreates a builder from this context object.Builders are used to define new contexts (e.g. serializers, parsers) based on existing configurations.
- Overrides:
copyin classSerializer- Returns:
- A new Builder object.
-
createSession
Description copied from class:ContextCreate a session builder based on the properties defined on this context.Use this method for creating sessions where you want to override basic settings. Otherwise, use
Context.getSession()directly.- Overrides:
createSessionin classOutputStreamSerializer- Returns:
- A new session builder.
-
getRdfBeanMeta
Description copied from interface:RdfMetaProviderReturns the language-specific metadata on the specified bean.- Specified by:
getRdfBeanMetain interfaceRdfMetaProvider- Parameters:
bm- The bean to return the metadata on.- Returns:
- The metadata.
-
getRdfBeanPropertyMeta
Description copied from interface:RdfMetaProviderReturns the language-specific metadata on the specified bean property.- Specified by:
getRdfBeanPropertyMetain interfaceRdfMetaProvider- Parameters:
bpm- The bean property to return the metadata on.- Returns:
- The metadata.
-
getRdfClassMeta
Description copied from interface:RdfMetaProviderReturns the language-specific metadata on the specified class.- Specified by:
getRdfClassMetain interfaceRdfMetaProvider- Parameters:
cm- The class to return the metadata on.- Returns:
- The metadata.
-
getXmlBeanMeta
Description copied from interface:XmlMetaProviderReturns the language-specific metadata on the specified bean.- Specified by:
getXmlBeanMetain interfaceXmlMetaProvider- Parameters:
bm- The bean to return the metadata on.- Returns:
- The metadata.
-
getXmlBeanPropertyMeta
Description copied from interface:XmlMetaProviderReturns the language-specific metadata on the specified bean property.- Specified by:
getXmlBeanPropertyMetain interfaceXmlMetaProvider- Parameters:
bpm- The bean property to return the metadata on.- Returns:
- The metadata.
-
getXmlClassMeta
Description copied from interface:XmlMetaProviderReturns the language-specific metadata on the specified class.- Specified by:
getXmlClassMetain interfaceXmlMetaProvider- Parameters:
cm- The class to return the metadata on.- Returns:
- The metadata.
-
getLanguage
Returns the RDF language.- Returns:
- The RDF language identifier.
-
getRdfSerializer
Returns the delegated RdfSerializer.- Returns:
- The delegated RdfSerializer.
-
getCollectionFormat
Collection format - delegates to RdfSerializer.- Returns:
- The RDF collection format.
-
getJuneauNs
Juneau namespace - delegates to RdfSerializer.- Returns:
- The Juneau namespace.
-
getJuneauBpNs
Juneau BP namespace - delegates to RdfSerializer.- Returns:
- The Juneau BP namespace.
-
getNamespaces
Namespaces - delegates to RdfSerializer.- Returns:
- The RDF namespaces.
-
isAddLiteralTypes
Add literal types - delegates to RdfSerializer.- Returns:
- True if literal types are added.
-
isAddRootProp
Add root property - delegates to RdfSerializer.- Returns:
- True if root property is added.
-
isLooseCollections
Loose collections - delegates to RdfSerializer.- Returns:
- True if loose collections are enabled.
-
isUseXmlNamespaces
Use XML namespaces - delegates to RdfSerializer.- Returns:
- True if XML namespaces are used.
-
isAutoDetectNamespaces
Auto-detect namespaces - delegates to RdfSerializer.- Returns:
- True if auto-detect namespaces is enabled.
-
isAddBeanTypes
Description copied from class:SerializerAdd"_type" properties when needed.- Overrides:
isAddBeanTypesin classSerializer- Returns:
true if"_type" properties added to beans if their type cannot be inferred through reflection.- See Also:
-