org.restlet.ext.emf
Class EmfConverter
java.lang.Object
org.restlet.engine.Helper
org.restlet.engine.converter.ConverterHelper
org.restlet.ext.emf.EmfConverter
public class EmfConverter
- extends ConverterHelper
Converter between the XML/XMI/ECore and representation classes based on EMF.
- Author:
- Jerome Louvel
|
Method Summary |
protected
|
create(MediaType mediaType,
T source)
Creates the marshaling EmfRepresentation. |
protected
|
create(Representation source)
Creates the unmarshaling EmfRepresentation. |
List<Class<?>> |
getObjectClasses(Variant source)
|
List<VariantInfo> |
getVariants(Class<?> source)
|
protected boolean |
isCompatible(Variant variant)
|
float |
score(Object source,
Variant target,
Resource resource)
|
|
score(Representation source,
Class<T> target,
Resource resource)
|
|
toObject(Representation source,
Class<T> target,
Resource resource)
|
Representation |
toRepresentation(Object source,
Variant target,
Resource resource)
|
|
updatePreferences(List<Preference<MediaType>> preferences,
Class<T> entity)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EmfConverter
public EmfConverter()
create
protected <T extends EObject> EmfRepresentation<T> create(MediaType mediaType,
T source)
- Creates the marshaling
EmfRepresentation.
- Type Parameters:
T - - Parameters:
mediaType - The target media type.source - The source object to marshal.
- Returns:
- The marshaling
EmfRepresentation.
create
protected <T extends EObject> EmfRepresentation<T> create(Representation source)
- Creates the unmarshaling
EmfRepresentation.
- Type Parameters:
T - - Parameters:
source - The source representation to unmarshal.
- Returns:
- The unmarshaling
EmfRepresentation.
getObjectClasses
public List<Class<?>> getObjectClasses(Variant source)
- Specified by:
getObjectClasses in class ConverterHelper
getVariants
public List<VariantInfo> getVariants(Class<?> source)
- Specified by:
getVariants in class ConverterHelper
isCompatible
protected boolean isCompatible(Variant variant)
score
public float score(Object source,
Variant target,
Resource resource)
- Specified by:
score in class ConverterHelper
score
public <T> float score(Representation source,
Class<T> target,
Resource resource)
- Specified by:
score in class ConverterHelper
toObject
public <T> T toObject(Representation source,
Class<T> target,
Resource resource)
throws IOException
- Specified by:
toObject in class ConverterHelper
- Throws:
IOException
toRepresentation
public Representation toRepresentation(Object source,
Variant target,
Resource resource)
- Specified by:
toRepresentation in class ConverterHelper
updatePreferences
public <T> void updatePreferences(List<Preference<MediaType>> preferences,
Class<T> entity)
- Overrides:
updatePreferences in class ConverterHelper
Copyright © 2005-2013 Restlet S.A.S..