public class EObjectBuilderImpl extends java.lang.Object implements EObjectBuilder
| Constructor and Description |
|---|
EObjectBuilderImpl(ConverterService converterService,
URI baseUri,
CodecRegistry codecRegistry,
ResourceSet resourceSet,
java.util.Map<?,?> options,
java.util.List<Resource> resourceCache)
Constructs an object builder without an EClass cache.
|
EObjectBuilderImpl(ConverterService converterService,
URI baseUri,
java.util.Map<java.lang.String,EClass> eClassCache,
CodecRegistry codecRegistry,
ResourceSet resourceSet,
java.util.Map<?,?> options,
java.util.List<Resource> resourceCache)
Constructs an object builder with an optional EClass cache.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
buildExtrinsicID(BsonReader reader,
Resource resource,
EObject eObject)
Sets the extrensic ID if it exists and the resource is of type XMLResource.
|
protected java.lang.Object |
convertMongoToEMFValue(EDataType eDataType,
java.lang.Object dbValue)
Converts the MongoDB value into an EMF value using the converter service
|
protected EObject |
createEObject(BsonReader reader,
ResourceSet resourceSet,
EReference reference,
java.lang.String eClassUri)
This function creates an empty EObject ether according to the given eClass URI or with reference type
of the given reference.
|
void |
decodeAttribute(BsonReader reader,
DecoderContext decoderContext,
BsonType type,
EObject parent,
EAttribute attribute)
Decodes a
EAttribute from the BsonReader |
void |
decodeFeatures(BsonReader reader,
DecoderContext decoderContext,
EObject parent)
Decodes
EStructuralFeature from the BsonReader |
EObject |
decodeObject(BsonReader reader,
DecoderContext context,
Resource resource)
Decodes an
EObject out of the BsonReader |
void |
decodeReference(BsonReader reader,
DecoderContext decoderContext,
BsonType type,
EObject parent,
EReference reference)
Decodes a
EReference from the BsonReader |
protected EClass |
getEClass(ResourceSet resourceSet,
java.lang.String eClassURI)
Finds the EClass for the given URI
|
public EObjectBuilderImpl(ConverterService converterService,
URI baseUri,
CodecRegistry codecRegistry,
ResourceSet resourceSet,
java.util.Map<?,?> options,
java.util.List<Resource> resourceCache)
converterService - the service to use when converting attribute valuesuriHandler - the handler for creating proxy URIsbaseUri - the basic URI to useincludeAttributesForProxyReferences - true if you want attribute values to be set on proxy references; false otherwiseoptions - the resource load optionspublic EObjectBuilderImpl(ConverterService converterService,
URI baseUri,
java.util.Map<java.lang.String,EClass> eClassCache,
CodecRegistry codecRegistry,
ResourceSet resourceSet,
java.util.Map<?,?> options,
java.util.List<Resource> resourceCache)
converterService - the service to use when converting attribute valuesbaseUri - the basic URI to useincludeAttributesForProxyReferences - true if you want attribute values to be set on proxy references; false otherwiseeClassCache - the cache to use to EClass lookups when building the EObject instance - may be nulloptions - the Resource load optionsprotected void buildExtrinsicID(BsonReader reader,
Resource resource,
EObject eObject)
reader - the object read from MongoDBresource - the resource that will contain the EMF ObjecteObject - the EMF object being builtprotected java.lang.Object convertMongoToEMFValue(EDataType eDataType,
java.lang.Object dbValue)
eDataType - the value typedbValue - the valueprotected EObject createEObject(BsonReader reader,
ResourceSet resourceSet,
EReference reference,
java.lang.String eClassUri)
reader - the BsonReader to read fromresourceSet - the resourceSet that will be used to locate the EClass if it is not cachedreference - the reference this object is foreClassUri - if a eClass attribute has been read beforeprotected EClass getEClass(ResourceSet resourceSet,
java.lang.String eClassURI)
resourceSet - the resource set used to locate the EClass if it was not
found in the cacheeClassURI - the URI of the EClasspublic EObject decodeObject(BsonReader reader,
DecoderContext context,
Resource resource)
EObjectBuilderEObject out of the BsonReaderdecodeObject in interface EObjectBuilderreader - the BsonReader to read fromcontext - the DecoderContextresource - the resource belonging to the objectEObject instancepublic void decodeFeatures(BsonReader reader,
DecoderContext decoderContext,
EObject parent)
EObjectBuilderEStructuralFeature from the BsonReaderdecodeFeatures in interface EObjectBuilderreader - the BsonReader to read fromdecoderContext - the decoder contextparent - the parent EObject to decode the EStructuralFeature forpublic void decodeReference(BsonReader reader,
DecoderContext decoderContext,
BsonType type,
EObject parent,
EReference reference)
EObjectBuilderEReference from the BsonReaderdecodeReference in interface EObjectBuilderreader - the BsonReader to read fromdecoderContext - the decoder contexttype - the type of the referenceparent - the parent object to set the reference valuereference - the EReferencepublic void decodeAttribute(BsonReader reader,
DecoderContext decoderContext,
BsonType type,
EObject parent,
EAttribute attribute)
EObjectBuilderEAttribute from the BsonReaderdecodeAttribute in interface EObjectBuilderreader - the BsonReader to read fromdecoderContext - the decoder contexttype - the type of the attributeparent - the parent object to set the attributes valuesattribute - the EAttributeBryan Hunt, Data In Motion Consulting