本文整理了Java中org.eclipse.emf.ecore.resource.impl.ResourceImpl
类的一些代码示例,展示了ResourceImpl
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ResourceImpl
类的具体详情如下:
包路径:org.eclipse.emf.ecore.resource.impl.ResourceImpl
类名称:ResourceImpl
[英]A highly extensible resource implementation.
The following configuration and control mechanisms are provided:
Serialization
#doSave(OutputStream,Map)
Root URI Fragment
#getURIFragmentRootSegment(EObject)
Containment Changes
#attached(EObject)
ZIP
#useZip
URI Conversion
#getURIConverter
Modification
#createModificationTrackingAdapter()
[中]高度可扩展的资源实现。
提供了以下配置和控制机制:
*系列化
*#doSave(输出流、地图)
*#数据加载(输入流、地图)
*#杜恩洛德
*根URI片段
*#getURIFragmentRootSegment(EObject)
*#getEObjectForURIFragmentRootSegment(字符串)
*遏制变化
*#附件(对象)
*#分离(对象)
*#卸载(内部对象)
*拉链
*#useZip
*#newContentZipEntry
*#isContentZipEntry(ZipEntry)
*URI转换
*#盖图里转换器
*修改
*#createModificationTrackingAdapter()
代码示例来源:origin: org.eclipse.xtext.common/types
@Override
public String getURIFragment(EObject eObject) {
if (mirror != null) {
String result = mirror.getFragment(eObject, fragmentProviderFallback);
return result;
}
return super.getURIFragment(eObject);
}
代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.common.types
@Override
public EObject getEObject(String uriFragment) {
if (mirror != null) {
EObject result = mirror.getEObject(this, uriFragment, fragmentProviderFallback);
return result;
}
return super.getEObject(uriFragment);
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.emf.ecore
/**
* Returns a newly allocated default resource {@link org.eclipse.emf.ecore.resource.impl.ResourceImpl#ResourceImpl(URI) implementation}.
* @param uri the URI.
* @return a new resource for the URI.
*/
public Resource createResource(URI uri)
{
return new ResourceImpl(uri);
}
}
代码示例来源:origin: org.eclipse.emf/org.eclipse.emf.ecore
public final void unload()
{
if (isLoaded)
{
unloadingContents = getUnloadingContents();
Notification notification = setLoaded(false);
try
{
doUnload();
}
finally
{
unloadingContents = null;
if (notification != null)
{
eNotify(notification);
}
setTimeStamp(URIConverter.NULL_TIME_STAMP);
}
}
}
代码示例来源:origin: org.eclipse.emf/org.eclipse.emf.ecore
public void detached(EObject eObject)
{
if (isAttachedDetachedHelperRequired())
{
detachedHelper(eObject);
for (TreeIterator<EObject> tree = getAllProperContents(eObject); tree.hasNext(); )
{
detachedHelper(tree.next());
}
}
}
代码示例来源:origin: org.eclipse.emf/org.eclipse.emf.ecore
public void attached(EObject eObject)
{
if (isAttachedDetachedHelperRequired())
{
attachedHelper(eObject);
for (TreeIterator<EObject> tree = getAllProperContents(eObject); tree.hasNext(); )
{
attachedHelper(tree.next());
}
}
}
代码示例来源:origin: org.eclipse.emf/org.eclipse.emf.ecore
/**
* Does all the work of unloading the resource.
* It calls {@link #unloaded unloaded} for each object it the content {@link #getAllContents tree},
* and clears the {@link #getContents contents}, {@link #getErrors errors}, and {@link #getWarnings warnings}.
*/
protected void doUnload()
{
Iterator<EObject> allContents = getAllProperContents(unloadingContents);
// This guard is needed to ensure that clear doesn't make the resource become loaded.
//
if (!getContents().isEmpty())
{
getContents().clear();
}
getErrors().clear();
getWarnings().clear();
while (allContents.hasNext())
{
unloaded((InternalEObject)allContents.next());
}
}
代码示例来源:origin: org.eclipse.emf/org.eclipse.emf.ecore
public EObject getEObject(String uriFragment)
{
int length = uriFragment.length();
if (length > 0)
{
if (uriFragment.charAt(0) == '/')
{
return getEObject(SegmentSequence.create("/", uriFragment).subSegmentsList(1));
}
else if (uriFragment.charAt(length - 1) == '?')
{
int index = uriFragment.lastIndexOf('?', length - 2);
if (index > 0)
{
uriFragment = uriFragment.substring(0, index);
}
}
}
return getEObjectByID(uriFragment);
}
代码示例来源:origin: org.eclipse.emf/org.eclipse.emf.ecore
modificationTrackingAdapter = createModificationTrackingAdapter();
for (TreeIterator<EObject> i = getAllProperContents(getContents()); i.hasNext(); )
modificationTrackingAdapter = null;
for (TreeIterator<EObject> i = getAllProperContents(getContents()); i.hasNext(); )
if (eNotificationRequired())
eNotify(notification);
代码示例来源:origin: org.eclipse.emf/org.eclipse.emf.ecore
return getEObjectByID(uriFragmentRootSegment.substring(1));
List<EObject> contents = getContents();
if (position < contents.size() && position >= 0)
代码示例来源:origin: org.eclipse.xtext/org.eclipse.xtext.java
@Override
protected List<EObject> getUnloadingContents() {
return super.getContents();
}
代码示例来源:origin: org.eclipse.emf/org.eclipse.emf.ecore
Map<String, EObject> map = getIntrinsicIDToEObjectMap();
if (map != null)
for (TreeIterator<EObject> i = getAllProperContents(getContents()); i.hasNext(); )
代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator
public void attached(EObject eObject)
{
super.attached(eObject);
// we need to attach a XSDSchemaLocator in order to resolve inline schema locations
// if there's not already one attached
XSDSchemaLocator xsdSchemaLocator = (XSDSchemaLocator)EcoreUtil.getRegisteredAdapter(this, XSDSchemaLocator.class);
if (xsdSchemaLocator == null)
{
getResourceSet().getAdapterFactories().add(new XSDSchemaLocatorAdapterFactory());
}
if (eObject instanceof DefinitionImpl)
{
DefinitionImpl definition = (DefinitionImpl)eObject;
definition.setInlineSchemaLocations(this);
}
}
/*
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.emf.ecore
@Override
public NotificationChain inverseAdd(E object, NotificationChain notifications)
{
InternalEObject eObject = (InternalEObject)object;
notifications = eObject.eSetResource(ResourceImpl.this, notifications);
ResourceImpl.this.attached(eObject);
return notifications;
}
代码示例来源:origin: org.emfjson/emfjson-jackson
@Override
protected void detachedHelper(EObject eObject) {
if (useIDs() && unloadingContents == null) {
if (useUUIDs()) {
DETACHED_EOBJECT_TO_ID_MAP.put(eObject, getID(eObject));
}
if (idToEObjectMap != null && eObjectToIDMap != null) {
setID(eObject, null);
}
}
super.detachedHelper(eObject);
}
代码示例来源:origin: org.eclipse.emf/org.eclipse.emf.ecore.xmi
@Override
protected boolean isAttachedDetachedHelperRequired()
{
return useIDs() || super.isAttachedDetachedHelperRequired();
}
代码示例来源:origin: org.emfjson/emfjson-jackson
@Override
protected EObject getEObjectByID(String id) {
if (idToEObjectMap != null) {
EObject eObject = idToEObjectMap.get(id);
if (eObject != null) {
return eObject;
}
}
return super.getEObjectByID(id);
}
代码示例来源:origin: org.emfjson/emfjson-jackson
@Override
protected void attachedHelper(EObject eObject) {
super.attachedHelper(eObject);
String id = getID(eObject);
if (id == null) {
if (!isLoading()) {
id = DETACHED_EOBJECT_TO_ID_MAP.remove(eObject);
if (id == null) {
id = EcoreUtil.generateUUID();
}
setID(eObject, id);
}
} else {
getIDToEObjectMap().put(id, eObject);
}
}
代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator
private void handleDefinitionElement(Element element)
{
Definition definition = null;
if (element == null)
{
definition = WSDLFactory.eINSTANCE.createDefinition();
((DefinitionImpl)definition).setUseExtensionFactories(useExtensionFactories);
}
else
{
definition = DefinitionImpl.createDefinition(element, getURI().toString(), useExtensionFactories);
}
getContents().add(definition);
// Do we need the next line?
((DefinitionImpl)definition).reconcileReferences(true);
}
代码示例来源:origin: org.eclipse/xtext
@Override
protected void doUnload() {
super.doUnload();
parseResult = null;
}
内容来源于网络,如有侵权,请联系作者删除!