Package org.hypermedea.ct.dom
Class DOMHandler
java.lang.Object
org.hypermedea.ct.BaseRepresentationHandler
org.hypermedea.ct.dom.DOMHandler
- All Implemented Interfaces:
RepresentationHandler
-
Field Summary
Fields inherited from class org.hypermedea.ct.BaseRepresentationHandler
functor, supportedContentTypes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCollection<jason.asSyntax.Literal> deserialize(InputStream representation, String resourceURI, String contentType) Deserialize the input representation into a collection of Jason terms.voidserialize(Collection<jason.asSyntax.Literal> terms, OutputStream out, String resourceURI) Serialize the input representation into an alternative representation, in a well-known format (a Content-Type), assumed to be the first Content-Type returned byRepresentationHandler.getSupportedContentTypes().Methods inherited from class org.hypermedea.ct.BaseRepresentationHandler
getArity, getFunctor, getSupportedContentTypes
-
Constructor Details
-
DOMHandler
public DOMHandler()
-
-
Method Details
-
serialize
public void serialize(Collection<jason.asSyntax.Literal> terms, OutputStream out, String resourceURI) throws UnsupportedRepresentationException, IOException Description copied from interface:RepresentationHandlerSerialize the input representation into an alternative representation, in a well-known format (a Content-Type), assumed to be the first Content-Type returned byRepresentationHandler.getSupportedContentTypes().- Parameters:
terms- some resource representation as Jason termsout- a stream in which the alternative representation will be serializedresourceURI- URI of the resource being represented- Throws:
UnsupportedRepresentationExceptionIOException
-
deserialize
public Collection<jason.asSyntax.Literal> deserialize(InputStream representation, String resourceURI, String contentType) throws UnsupportedRepresentationException, IOException Description copied from interface:RepresentationHandlerDeserialize the input representation into a collection of Jason terms. If the input Content-Type is not in the list returned byRepresentationHandler.getSupportedContentTypes(), an error is thrown.- Parameters:
representation- some serialized representationresourceURI- URI of the resource being representedcontentType- the Content-Type of the serialization- Returns:
- one or more Jason terms representing the input representation
- Throws:
UnsupportedRepresentationExceptionIOException
-