@Override public void deserializeAndSet(JsonParser jp, EObject current, DeserializationContext ctxt, Resource resource) throws IOException { String value = jp.nextTextValue(); if (value != null) { ((InternalEObject) current).eSetProxyURI(URI.createURI(value)); } } }
protected JvmOperation createMethodProxy(Method method) { JvmOperation proxy = operationProxies.get(method); if (proxy == null) { proxy = TypesFactory.eINSTANCE.createJvmOperation(); URI uri = uriHelper.getFullURI(method); ((InternalEObject)proxy).eSetProxyURI(uri); operationProxies.put(method, proxy); } return proxy; }
protected JvmAnnotationType createAnnotationProxy(Class<? extends Annotation> type) { JvmAnnotationType proxy = annotationProxies.get(type); if (proxy == null) { proxy = TypesFactory.eINSTANCE.createJvmAnnotationType(); URI uri = uriHelper.getFullURI(type); ((InternalEObject)proxy).eSetProxyURI(uri); annotationProxies.put(type, proxy); } return proxy; }
protected JvmType createProxy(Type type) { JvmType proxy = typeProxies.get(type); if (proxy == null) { proxy = TypesFactory.eINSTANCE.createJvmVoid(); URI uri = uriHelper.getFullURI(type); ((InternalEObject)proxy).eSetProxyURI(uri); typeProxies.put(type, proxy); } return proxy; }
protected JvmOperation createMethodProxy(Method method) { JvmOperation proxy = operationProxies.get(method); if (proxy == null) { proxy = TypesFactory.eINSTANCE.createJvmOperation(); URI uri = uriHelper.getFullURI(method); ((InternalEObject)proxy).eSetProxyURI(uri); operationProxies.put(method, proxy); } return proxy; }
/** * Copies the proxy URI from the original to the copy, if present. * @param eObject the object being copied. * @param copyEObject the copy being initialized. */ protected void copyProxyURI(EObject eObject, EObject copyEObject) { if (eObject.eIsProxy()) { ((InternalEObject)copyEObject).eSetProxyURI(((InternalEObject)eObject).eProxyURI()); } }
protected void clearPackage(Resource resource, EPackage pack) { Map<InternalEObject, URI> uris = Maps.newHashMap(); for(EClassifier classifier: pack.getEClassifiers()) { InternalEObject internalEObject = (InternalEObject) classifier; URI appendFragment = resource.getURI().appendFragment(resource.getURIFragment(internalEObject)); uris.put(internalEObject, appendFragment); } pack.getEClassifiers().clear(); for (Map.Entry<InternalEObject, URI> entry : uris.entrySet()) { entry.getKey().eSetProxyURI(entry.getValue()); } }
public JavaClass createClassRef(String targetName) { JavaClass ref = createJavaClass(); ((InternalEObject) ref).eSetProxyURI(createTypeURI(targetName)); return ref; }
public IEObjectDescription apply(String from) { InternalEObject proxyPackage = (InternalEObject) EcoreFactory.eINSTANCE.createEPackage(); proxyPackage.eSetProxyURI(URI.createURI(from)); return EObjectDescription.create(QualifiedName.create(from), proxyPackage, Collections.singletonMap("nsURI", "true")); } }));
/** * Copies the proxy URI from the original to the copy, if present. * @param eObject the object being copied. * @param copyEObject the copy being initialized. */ protected void copyProxyURI(EObject eObject, EObject copyEObject) { if (eObject.eIsProxy()) { ((InternalEObject)copyEObject).eSetProxyURI(((InternalEObject)eObject).eProxyURI()); } }
@Override public IEObjectDescription apply(String from) { InternalEObject proxyPackage = (InternalEObject) EcoreFactory.eINSTANCE.createEPackage(); proxyPackage.eSetProxyURI(URI.createURI(from)); QualifiedName qualifiedName = qualifiedNameConverter.toQualifiedName(from); return EObjectDescription.create(qualifiedName, proxyPackage, Collections.singletonMap("nsURI", "true")); } });
public static JvmType findJvmType(URI uri, EObject context) { InternalEObject proxy = (InternalEObject) TypesFactory.eINSTANCE.createJvmVoid(); proxy.eSetProxyURI(uri); JvmType result = (JvmType) EcoreUtil.resolve(proxy, context); return result; } }
/** * createFieldRef - return a JavaURL reference to the named field in the named Java class in the form "package.class_field" * @deprecated no replacement at this time. */ public static Field createFieldRef(String className, String fieldName) { Field ref = JavaRefFactory.eINSTANCE.createField(); URI classURI = JavaRefFactory.eINSTANCE.createTypeURI(className); ((InternalEObject) ref).eSetProxyURI(URI.createURI(classURI.toString()+ReflectionAdaptor.C_CLASS_MEMBER_DELIMITER+fieldName)); return ref; }
protected List<JvmType> createObjectReference(Resource resource) { if (resource != null) { // no upper bound found - seems to be an invalid - assume object as upper bound URI objectURI = new ClassURIHelper().getFullURI(Object.class); JvmType objectType = factory.createJvmGenericType(); ((InternalEObject)objectType).eSetProxyURI(objectURI); objectType = (JvmType) EcoreUtil.resolve(objectType, resource); return Collections.singletonList(objectType); } return Collections.emptyList(); } }
protected List<JvmType> createObjectReference(ResourceSet resourceSet) { // no upper bound found - seems to be an invalid - assume object as upper bound JvmType objectType = factory.createJvmGenericType(); String objectClassName = Object.class.getName(); ((InternalEObject) objectType).eSetProxyURI(URIHelperConstants.OBJECTS_URI.appendSegment(objectClassName).appendFragment(objectClassName)); objectType = (JvmType) EcoreUtil.resolve(objectType, resourceSet); return Collections.singletonList(objectType); } }
protected JvmEnumerationLiteral createEnumLiteral(String literalName, BinaryTypeSignature typeName) { JvmEnumerationLiteral enumLiteralProxy = TypesFactory.eINSTANCE.createJvmEnumerationLiteral(); InternalEObject internalEObject = (InternalEObject) enumLiteralProxy; BinarySimpleMemberSignature fieldSignature = typeName.appendField(literalName); URI uri = fieldSignature.getURI(); internalEObject.eSetProxyURI(uri); return enumLiteralProxy; }
public static JvmType getType(final Class<?> clazz, final EObject context) { JvmType _xblockexpression = null; { JvmVoid _createJvmVoid = TypesFactory.eINSTANCE.createJvmVoid(); final InternalEObject proxy = ((InternalEObject) _createJvmVoid); proxy.eSetProxyURI(XFunctionTypeRefs.computeTypeUri(clazz)); EObject _resolve = EcoreUtil.resolve(proxy, context); _xblockexpression = ((JvmType) _resolve); } return _xblockexpression; } }
private JvmTypeReference newObjectReference() { JvmType objectType = typesFactory.createJvmGenericType(); String objectClassName = Object.class.getName(); ((InternalEObject) objectType).eSetProxyURI(URIHelperConstants.OBJECTS_URI.appendSegment(objectClassName).appendFragment(objectClassName)); JvmParameterizedTypeReference result = typesFactory.createJvmParameterizedTypeReference(); result.setType(objectType); return result; }
protected LightweightTypeReference createObjectReference(ITypeReferenceOwner owner, ResourceSet resourceSet) { // no upper bound found - seems to be an invalid - assume object as upper bound JvmType objectType = factory.createJvmGenericType(); String objectClassName = Object.class.getName(); ((InternalEObject) objectType).eSetProxyURI(URIHelperConstants.OBJECTS_URI.appendSegment(objectClassName).appendFragment(objectClassName)); objectType = (JvmType) EcoreUtil.resolve(objectType, resourceSet); return owner.newParameterizedTypeReference(objectType); } }
public void makePrimKeyFieldProxy(String oldName) { if (cmp.getPrimKeyField() == null) return; cmp.setPrimKeyField(EjbFactory.eINSTANCE.createCMPAttribute()); cmp.getPrimKeyField().setName(oldName); ((InternalEObject)cmp.getPrimKeyField()).eSetProxyURI(URI.createURI(oldName)); }