Java 类org.eclipse.emf.ecore.impl.BasicEObjectImpl 实例源码

项目:txtUML    文件:PapyrusModelCreator.java   
/**
 * Copies the content of the sourceUMLPath to the umlFile
 * The referenced Profile files will be also copied
 * @param sourceUMLPath - The path of the source .uml File
 */
private void setUpUMLFile(String sourceUMLPath){
        copyFile(sourceUMLPath, umlFile);

        Model m = getUmlModel();
        EList<Profile> profiles = m.getAllAppliedProfiles();
        for(Profile profile : profiles){
                    String filestring = ((BasicEObjectImpl) profile).eProxyURI().toPlatformString(false);
                    Path profileFilepath = new Path(filestring);

                    String oldFolder = new Path(new Path(sourceUMLPath).toFile().getParent().toString()).toString();
                    String oldFileName = oldFolder+Path.SEPARATOR+profileFilepath.toFile().getName();

                    int index = umlFilePath.lastIndexOf(Path.SEPARATOR);
                    String newFileName = umlFilePath.substring(0, index)+Path.SEPARATOR+profileFilepath.toFile().getName();
                    IFile newFile = fileFromPath(newFileName);

                    copyFile(oldFileName, newFile);
        }
}
项目:OpenSPIFe    文件:ADParameterUtils.java   
/**
 * Add a reference to a named AD 
 * @param element
 * @param referenceURI
 * @param referenceID
 * @param attribute
 */
@SuppressWarnings("unchecked")
public static void addReference(EPlanElement element, URI referenceURI, String referenceID, String attribute) {
    if (referenceURI != null) {
        EObject data = element.getData();
        EStructuralFeature feature = data.eClass().getEStructuralFeature(attribute);
        EClass referenceClass = (EClass) feature.getEType();
        List groupReferences = (List)data.eGet(data.eClass().getEStructuralFeature(attribute));

        URI uri = referenceURI.appendFragment(referenceID);
        EObject groupObject = ActivityDictionary.getInstance().getEFactoryInstance().create(referenceClass);
        ((BasicEObjectImpl)groupObject).eSetProxyURI(uri);
        if (!groupReferences.contains(groupObject)) {
            groupReferences.add(groupObject);
        }
    }
}
项目:fixflow    文件:BpmnModelUtil.java   
public static  BaseElement getBaseElement(DefinitionsBehavior definitions,BaseElement baseElement){
    if(baseElement==null){
        return null;
    }
    if(baseElement.getId()==null){
        BasicEObjectImpl basicEObjectImpl=(BasicEObjectImpl)baseElement;
        if(basicEObjectImpl!=null&&basicEObjectImpl.eProxyURI()!=null){
            String elementId=basicEObjectImpl.eProxyURI().fragment();
            BaseElement bpmnElement=definitions.getElement(elementId);
            return bpmnElement;
        }
        else{
            return null;
        }
    }else{
        return baseElement;
    }
}
项目:fixflow    文件:GetFlowGraphicsElementPositionCmd.java   
private  BaseElement getBaseElement(BaseElement baseElement){
    if(baseElement==null){
        return null;
    }
    if(baseElement.getId()==null){
        BasicEObjectImpl basicEObjectImpl=(BasicEObjectImpl)baseElement;
        if(basicEObjectImpl!=null&&basicEObjectImpl.eProxyURI()!=null){
            String elementId=basicEObjectImpl.eProxyURI().fragment();
            BaseElement bpmnElement=definitions.getElement(elementId);
            return bpmnElement;
        }
        else{
            return null;
        }
    }else{
        return baseElement;
    }
}
项目:DarwinSPL    文件:HyexpressionMarkerHelper.java   
/**
 * Returns an URI that identifies the given object.
 */
protected String getObjectURI(EObject object) {
    if (object == null) {
        return null;
    }
    if (object.eIsProxy() && object instanceof BasicEObjectImpl) {
        return ((BasicEObjectImpl) object).eProxyURI().toString();
    }
    Resource eResource = object.eResource();
    if (eResource == null) {
        return null;
    }
    return eResource.getURI().toString() + "#" + eResource.getURIFragment(object);
}
项目:DarwinSPL    文件:HymanifestMarkerHelper.java   
/**
 * Returns an URI that identifies the given object.
 */
protected String getObjectURI(EObject object) {
    if (object == null) {
        return null;
    }
    if (object.eIsProxy() && object instanceof BasicEObjectImpl) {
        return ((BasicEObjectImpl) object).eProxyURI().toString();
    }
    Resource eResource = object.eResource();
    if (eResource == null) {
        return null;
    }
    return eResource.getURI().toString() + "#" + eResource.getURIFragment(object);
}
项目:DarwinSPL    文件:HymappingMarkerHelper.java   
/**
 * Returns an URI that identifies the given object.
 */
protected String getObjectURI(EObject object) {
    if (object == null) {
        return null;
    }
    if (object.eIsProxy() && object instanceof BasicEObjectImpl) {
        return ((BasicEObjectImpl) object).eProxyURI().toString();
    }
    Resource eResource = object.eResource();
    if (eResource == null) {
        return null;
    }
    return eResource.getURI().toString() + "#" + eResource.getURIFragment(object);
}
项目:DarwinSPL    文件:HyconstraintsMarkerHelper.java   
/**
 * Returns an URI that identifies the given object.
 */
protected String getObjectURI(EObject object) {
    if (object == null) {
        return null;
    }
    if (object.eIsProxy() && object instanceof BasicEObjectImpl) {
        return ((BasicEObjectImpl) object).eProxyURI().toString();
    }
    Resource eResource = object.eResource();
    if (eResource == null) {
        return null;
    }
    return eResource.getURI().toString() + "#" + eResource.getURIFragment(object);
}
项目:DarwinSPL    文件:HyvalidityformulaMarkerHelper.java   
/**
 * Returns an URI that identifies the given object.
 */
protected String getObjectURI(EObject object) {
    if (object == null) {
        return null;
    }
    if (object.eIsProxy() && object instanceof BasicEObjectImpl) {
        return ((BasicEObjectImpl) object).eProxyURI().toString();
    }
    Resource eResource = object.eResource();
    if (eResource == null) {
        return null;
    }
    return eResource.getURI().toString() + "#" + eResource.getURIFragment(object);
}
项目:DarwinSPL    文件:HydatavalueMarkerHelper.java   
/**
 * Returns an URI that identifies the given object.
 */
protected String getObjectURI(EObject object) {
    if (object == null) {
        return null;
    }
    if (object.eIsProxy() && object instanceof BasicEObjectImpl) {
        return ((BasicEObjectImpl) object).eProxyURI().toString();
    }
    Resource eResource = object.eResource();
    if (eResource == null) {
        return null;
    }
    return eResource.getURI().toString() + "#" + eResource.getURIFragment(object);
}
项目:DarwinSPL    文件:DwprofileMarkerHelper.java   
/**
 * Returns an URI that identifies the given object.
 */
protected String getObjectURI(EObject object) {
    if (object == null) {
        return null;
    }
    if (object.eIsProxy() && object instanceof BasicEObjectImpl) {
        return ((BasicEObjectImpl) object).eProxyURI().toString();
    }
    Resource eResource = object.eResource();
    if (eResource == null) {
        return null;
    }
    return eResource.getURI().toString() + "#" + eResource.getURIFragment(object);
}
项目:OpenSPIFe    文件:PatchBuilder.java   
private EObject copy(EStructuralFeature feature, EObject eObject) {
    if (eObject.eContainer() != null || eObject.eResource() != null) {
        if (feature instanceof EReference) {
            EReference reference = (EReference) feature;
            URI uri = (reference.isContainment() ? null : EcoreUtil.getURI(eObject));
            if (reference.isContainment()) {
                eObject = copy(eObject);
            }
            ((BasicEObjectImpl)eObject).eSetProxyURI(uri);
        }
    }
    return eObject;
}
项目:OpenSPIFe    文件:EMFUtils.java   
public static void unresolveProxies(EObject object) {
    for (EReference r : object.eClass().getEReferences()) {
        if (object.eContainmentFeature() == r) {
            continue;
        }
        for (EObject referencedObject : eGetAsList(object, r)) {
            if (r.isContainment() && referencedObject instanceof BasicEObjectImpl) {
                unresolveProxies(referencedObject);
            } else {
                unresolveProxy(referencedObject);
            }
        }
    }
}
项目:n4js    文件:EcoreUtilN4.java   
/**
 * Will be called by super class once for each proxy. Super class will ensure that
 * <code>crossReferencedEObject</code> is a proxy.
 */
@Override
protected void add(InternalEObject eObject, EReference eReference, EObject crossReferencedEObject) {
    handler.handle(eObject, eReference, (BasicEObjectImpl) crossReferencedEObject);
}
项目:OpenSPIFe    文件:EMFUtils.java   
public static void unresolveProxy(EObject referencedObject) {
    ((BasicEObjectImpl)referencedObject).eSetProxyURI(EcoreUtil.getURI(referencedObject));
}
项目:fixflow    文件:GetFlowGraphicsSvgCmd.java   
private  BaseElement getBaseElement(BaseElement baseElement)
{



    if(baseElement==null){
        return null;
    }

    if(baseElement.getId()==null){
        BasicEObjectImpl basicEObjectImpl=(BasicEObjectImpl)baseElement;
        if(basicEObjectImpl!=null&&basicEObjectImpl.eProxyURI()!=null){
            String elementId=basicEObjectImpl.eProxyURI().fragment();
            BaseElement bpmnElement=definitions.getElement(elementId);
            return bpmnElement;
        }
        else{
            return null;
        }
    }else{
        return baseElement;
    }





}
项目:n4js    文件:EcoreUtilN4.java   
/**
 * Will be invoked for each proxy.
 */
public void handle(InternalEObject source, EReference eReference, BasicEObjectImpl targetProxy);