Package org.restlet.ext.emf
Class EmfRepresentation<T extends org.eclipse.emf.ecore.EObject>
- java.lang.Object
-
- Type Parameters:
T- The type to wrap.
@Deprecated public class EmfRepresentation<T extends org.eclipse.emf.ecore.EObject> extends OutputRepresentation
Deprecated.Will be removed in next minor release.Representation based on the EMF library. By default, it can serialize and deserialize automatically in either XML, XMI or ECore.- See Also:
- EMF project
-
-
Field Summary
Fields Modifier and Type Field Description private intlineWidthDeprecated.The maximum number of characters per line.private TobjectDeprecated.The (parsed) object to format.private RepresentationrepresentationDeprecated.The representation to parse.private booleanusingEncodedAttributeStyleDeprecated.Indicates if EMF references should be written as URI anchors.-
Fields inherited from class org.restlet.representation.Representation
UNKNOWN_SIZE
-
-
Constructor Summary
Constructors Constructor Description EmfRepresentation(MediaType mediaType, T object)Deprecated.Constructor.EmfRepresentation(Representation representation)Deprecated.Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected org.eclipse.emf.ecore.resource.ResourcecreateEmfResource(MediaType mediaType)Deprecated.Creates and configure an EMF resource.protected org.eclipse.emf.ecore.xmi.XMLResourcecreateEmfXmlResource(MediaType mediaType)Deprecated.Creates and configure an EMF resource.intgetLineWidth()Deprecated.Returns the maximum number of characters per line.protected java.util.Map<?,?>getLoadOptions()Deprecated.Returns the loading options.TgetObject()Deprecated.Returns the wrapped object either parsed from the representation or to be formatted.protected java.util.Map<?,?>getSaveOptions()Deprecated.Returns the saving options.booleanisUsingEncodedAttributeStyle()Deprecated.Indicates if EMF references should be written as URI anchors.voidsetLineWidth(int lineWidth)Deprecated.Sets the maximum number of characters per line.voidsetUsingEncodedAttributeStyle(boolean usingEncodedAttributeStyle)Deprecated.Indicates if EMF references should be written as URI anchors.voidwrite(java.io.OutputStream outputStream)Deprecated.If this representation wraps anEObject, then it tries to write it as either XML, XMI or ECore/EMOF depending on the media type set.voidwrite(org.eclipse.emf.ecore.EObject object, java.io.OutputStream outputStream)Deprecated.Writes the representation based on a given EMF object.-
Methods inherited from class org.restlet.representation.OutputRepresentation
getChannel, getStream
-
Methods inherited from class org.restlet.representation.StreamRepresentation
getReader, write, write
-
Methods inherited from class org.restlet.representation.Representation
append, exhaust, getAvailableSize, getDigest, getDisposition, getExpirationDate, getRange, getRegistration, getSize, getText, hasKnownSize, isAvailable, isEmpty, isSelectable, isTransient, release, setAvailable, setDigest, setDisposition, setExpirationDate, setListener, setRange, setSize, setTransient
-
Methods inherited from class org.restlet.representation.RepresentationInfo
getModificationDate, getTag, setModificationDate, setTag
-
Methods inherited from class org.restlet.representation.Variant
createClientInfo, equals, getCharacterSet, getEncodings, getLanguages, getLocationRef, getMediaType, hashCode, includes, isCompatible, setCharacterSet, setEncodings, setLanguages, setLocationRef, setLocationRef, setMediaType, toString
-
-
-
-
Field Detail
-
lineWidth
private volatile int lineWidth
Deprecated.The maximum number of characters per line.
-
object
private volatile T extends org.eclipse.emf.ecore.EObject object
Deprecated.The (parsed) object to format.
-
representation
private volatile Representation representation
Deprecated.The representation to parse.
-
usingEncodedAttributeStyle
private volatile boolean usingEncodedAttributeStyle
Deprecated.Indicates if EMF references should be written as URI anchors.
-
-
Constructor Detail
-
EmfRepresentation
public EmfRepresentation(MediaType mediaType, T object)
Deprecated.Constructor.- Parameters:
mediaType- The target media type. Supported values areMediaType.APPLICATION_XMI,MediaType.APPLICATION_ECOREand XML media types.object- The object to format.
-
EmfRepresentation
public EmfRepresentation(Representation representation)
Deprecated.Constructor.- Parameters:
representation- The representation to parse.
-
-
Method Detail
-
createEmfResource
protected org.eclipse.emf.ecore.resource.Resource createEmfResource(MediaType mediaType)
Deprecated.Creates and configure an EMF resource. Not to be confused with a Restlet resource. By default, it callscreateEmfXmlResource(MediaType).- Parameters:
mediaType- The associated media type.- Returns:
- A new configured EMF resource.
-
createEmfXmlResource
protected org.eclipse.emf.ecore.xmi.XMLResource createEmfXmlResource(MediaType mediaType)
Deprecated.Creates and configure an EMF resource. Not to be confused with a Restlet resource.- Parameters:
mediaType- The associated media type (ECore, XMI or XML).- Returns:
- A new configured EMF resource.
-
getLineWidth
public int getLineWidth()
Deprecated.Returns the maximum number of characters per line. Defaults to 80.- Returns:
- The maximum number of characters per line.
-
getLoadOptions
protected java.util.Map<?,?> getLoadOptions()
Deprecated.Returns the loading options. Null by default.- Returns:
- The loading options.
-
getObject
public T getObject() throws java.io.IOException
Deprecated.Returns the wrapped object either parsed from the representation or to be formatted.- Returns:
- The wrapped object.
- Throws:
java.io.IOException
-
getSaveOptions
protected java.util.Map<?,?> getSaveOptions()
Deprecated.Returns the saving options. Null by default.- Returns:
- The saving options.
-
isUsingEncodedAttributeStyle
public boolean isUsingEncodedAttributeStyle()
Deprecated.Indicates if EMF references should be written as URI anchors.- Returns:
- True if EMF references should be written as URI anchors.
-
setLineWidth
public void setLineWidth(int lineWidth)
Deprecated.Sets the maximum number of characters per line.- Parameters:
lineWidth- The maximum number of characters per line.
-
setUsingEncodedAttributeStyle
public void setUsingEncodedAttributeStyle(boolean usingEncodedAttributeStyle)
Deprecated.Indicates if EMF references should be written as URI anchors.- Parameters:
usingEncodedAttributeStyle- True if EMF references should be written as URI anchors.
-
write
public void write(org.eclipse.emf.ecore.EObject object, java.io.OutputStream outputStream) throws java.io.IOExceptionDeprecated.Writes the representation based on a given EMF object.- Parameters:
object- The EMF object to serialize.outputStream- The target output stream.- Throws:
java.io.IOException
-
write
public void write(java.io.OutputStream outputStream) throws java.io.IOExceptionDeprecated.If this representation wraps anEObject, then it tries to write it as either XML, XMI or ECore/EMOF depending on the media type set. Note that in order to write thisEObject, an EMF resource is created, configured for proper serialization and theEObjectis then added to the content of this resource. This could has a side effect of removing it from a previous resource/container.- Specified by:
writein classRepresentation- Parameters:
outputStream- The output stream.- Throws:
java.io.IOException
-
-