-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move KeysResource and Factory to internal package
- Loading branch information
1 parent
66e0bc9
commit 3272d9b
Showing
5 changed files
with
154 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<?eclipse version="3.0"?> | ||
<!-- | ||
Copyright (c) 2021, 2024 ArSysOp | ||
This program and the accompanying materials are made available under the | ||
terms of the Eclipse Public License 2.0 which is available at | ||
https://www.eclipse.org/legal/epl-2.0/. | ||
SPDX-License-Identifier: EPL-2.0 | ||
Contributors: | ||
ArSysOp - initial API and implementation | ||
ArSysOp - further support | ||
--> | ||
<plugin> | ||
|
||
|
||
<extension point="org.eclipse.emf.ecore.generated_package"> | ||
<!-- @generated keys --> | ||
<package | ||
uri="http://www.eclipse.org/passage/lic/keys/3.0.0" | ||
class="org.eclipse.passage.lic.keys.model.meta.KeysPackage" | ||
genModel="model/keys.genmodel"/> | ||
</extension> | ||
|
||
<extension point="org.eclipse.emf.ecore.extension_parser"> | ||
<!-- @generated keys --> | ||
<parser | ||
type="keys" | ||
class="org.eclipse.passage.lic.keys.model.util.KeysResourceFactoryImpl"/> | ||
</extension> | ||
|
||
</plugin> | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<?eclipse version="3.0"?> | ||
<!-- | ||
Copyright (c) 2021, 2024 ArSysOp | ||
This program and the accompanying materials are made available under the | ||
terms of the Eclipse Public License 2.0 which is available at | ||
https://www.eclipse.org/legal/epl-2.0/. | ||
SPDX-License-Identifier: EPL-2.0 | ||
Contributors: | ||
ArSysOp - initial API and implementation | ||
ArSysOp - further support | ||
--> | ||
<plugin> | ||
|
||
|
||
<extension point="org.eclipse.emf.ecore.generated_package"> | ||
<!-- @generated keys --> | ||
<package | ||
uri="http://www.eclipse.org/passage/lic/keys/3.0.0" | ||
class="org.eclipse.passage.lic.keys.model.meta.KeysPackage" | ||
genModel="model/keys.genmodel"/> | ||
</extension> | ||
|
||
<extension point="org.eclipse.emf.ecore.extension_parser"> | ||
<!-- @generated keys --> | ||
<parser | ||
type="keys" | ||
class="org.eclipse.passage.lic.internal.keys.model.util.KeysResourceFactoryImpl"/> | ||
</extension> | ||
|
||
</plugin> |
91 changes: 46 additions & 45 deletions
91
....model/src/org/eclipse/passage/lic/internal/keys/model/migration/KeysResourceHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,46 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 ArSysOp | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* https://www.eclipse.org/legal/epl-2.0/. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* ArSysOp - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.passage.lic.internal.keys.model.migration; | ||
|
||
import org.eclipse.emf.ecore.EPackage; | ||
import org.eclipse.emf.ecore.xmi.XMLResource; | ||
import org.eclipse.passage.lic.emf.migration.MigrationRoutes; | ||
import org.eclipse.passage.lic.emf.migration.SimpleMigrationRoutes; | ||
import org.eclipse.passage.lic.emf.xmi.MigratingResourceHandler; | ||
import org.eclipse.passage.lic.keys.model.meta.KeysPackage; | ||
|
||
public final class KeysResourceHandler extends MigratingResourceHandler { | ||
|
||
@Override | ||
protected void complete(XMLResource resource) { | ||
// do nothing | ||
} | ||
|
||
@Override | ||
protected void register() { | ||
migrate200(); | ||
} | ||
|
||
@Override | ||
protected MigrationRoutes attributes() { | ||
return new SimpleMigrationRoutes(); | ||
} | ||
|
||
private void migrate200() { | ||
String uri = "http://www.eclipse.org/passage/lic/keys/2.0.0"; //$NON-NLS-1$ | ||
KeysPackage delegate = KeysPackage.eINSTANCE; | ||
EPackage.Registry.INSTANCE.computeIfAbsent(uri, ns -> delegate); | ||
} | ||
|
||
} | ||
/******************************************************************************* | ||
* Copyright (c) 2024 ArSysOp | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* https://www.eclipse.org/legal/epl-2.0/. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* ArSysOp - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.passage.lic.internal.keys.model.migration; | ||
|
||
import org.eclipse.emf.ecore.EPackage; | ||
import org.eclipse.emf.ecore.xmi.XMLResource; | ||
import org.eclipse.passage.lic.emf.migration.MigrationRoutes; | ||
import org.eclipse.passage.lic.emf.migration.SimpleMigrationRoutes; | ||
import org.eclipse.passage.lic.emf.xmi.MigratingResourceHandler; | ||
import org.eclipse.passage.lic.keys.model.meta.KeysPackage; | ||
|
||
@SuppressWarnings("restriction") | ||
public final class KeysResourceHandler extends MigratingResourceHandler { | ||
|
||
@Override | ||
protected void complete(XMLResource resource) { | ||
// do nothing | ||
} | ||
|
||
@Override | ||
protected void register() { | ||
migrate200(); | ||
} | ||
|
||
@Override | ||
protected MigrationRoutes attributes() { | ||
return new SimpleMigrationRoutes(); | ||
} | ||
|
||
private void migrate200() { | ||
String uri = "http://www.eclipse.org/passage/lic/keys/2.0.0"; //$NON-NLS-1$ | ||
KeysPackage delegate = KeysPackage.eINSTANCE; | ||
EPackage.Registry.INSTANCE.computeIfAbsent(uri, ns -> delegate); | ||
} | ||
|
||
} |
76 changes: 33 additions & 43 deletions
76
...s/model/util/KeysResourceFactoryImpl.java → ...s/model/util/KeysResourceFactoryImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,33 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 ArSysOp | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* https://www.eclipse.org/legal/epl-2.0/. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* ArSysOp - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.passage.lic.keys.model.util; | ||
|
||
import org.eclipse.emf.common.util.URI; | ||
import org.eclipse.emf.ecore.resource.Resource; | ||
import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl; | ||
import org.eclipse.passage.lic.emf.resource.BlindResourceFactory; | ||
|
||
/** | ||
* @since 3.0 | ||
* | ||
* @generated NOT | ||
*/ | ||
public final class KeysResourceFactoryImpl extends ResourceFactoryImpl implements BlindResourceFactory { | ||
|
||
/** | ||
* @generated NOT | ||
*/ | ||
@Override | ||
public Resource createResource(URI uri) { | ||
return new KeysResourceImpl(uri); | ||
} | ||
|
||
/** | ||
* @generated NOT | ||
*/ | ||
@Override | ||
public Resource createResource() { | ||
return new KeysResourceImpl(); | ||
} | ||
|
||
} | ||
/******************************************************************************* | ||
* Copyright (c) 2024 ArSysOp | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* https://www.eclipse.org/legal/epl-2.0/. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* ArSysOp - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.passage.lic.internal.keys.model.util; | ||
|
||
import org.eclipse.emf.common.util.URI; | ||
import org.eclipse.emf.ecore.resource.Resource; | ||
import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl; | ||
import org.eclipse.passage.lic.emf.resource.BlindResourceFactory; | ||
|
||
@SuppressWarnings("restriction") | ||
public final class KeysResourceFactoryImpl extends ResourceFactoryImpl implements BlindResourceFactory { | ||
|
||
@Override | ||
public Resource createResource(URI uri) { | ||
return new KeysResourceImpl(uri); | ||
} | ||
|
||
@Override | ||
public Resource createResource() { | ||
return new KeysResourceImpl(); | ||
} | ||
|
||
} |
91 changes: 39 additions & 52 deletions
91
...lic/keys/model/util/KeysResourceImpl.java → ...nal/keys/model/util/KeysResourceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,39 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 ArSysOp | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* https://www.eclipse.org/legal/epl-2.0/. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* ArSysOp - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.passage.lic.keys.model.util; | ||
|
||
import java.util.Map; | ||
|
||
import org.eclipse.emf.common.util.URI; | ||
import org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl; | ||
import org.eclipse.passage.lic.internal.keys.model.migration.KeysResourceHandler; | ||
|
||
/** | ||
* @generated NOT | ||
* @since 3.0 | ||
*/ | ||
public class KeysResourceImpl extends XMIResourceImpl { | ||
/** | ||
* @generated | ||
*/ | ||
public KeysResourceImpl(URI uri) { | ||
super(uri); | ||
} | ||
|
||
/** | ||
* | ||
* @generated NOT | ||
*/ | ||
public KeysResourceImpl() { | ||
super(); | ||
} | ||
|
||
/** | ||
* @generated NOT | ||
*/ | ||
@Override | ||
protected void init() { | ||
super.init(); | ||
Map<Object, Object> options = getDefaultLoadOptions(); | ||
options.put(OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE); | ||
options.put(OPTION_RESOURCE_HANDLER, new KeysResourceHandler()); | ||
} | ||
|
||
} | ||
/******************************************************************************* | ||
* Copyright (c) 2024 ArSysOp | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* https://www.eclipse.org/legal/epl-2.0/. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* ArSysOp - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.passage.lic.internal.keys.model.util; | ||
|
||
import java.util.Map; | ||
|
||
import org.eclipse.emf.common.util.URI; | ||
import org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl; | ||
import org.eclipse.passage.lic.internal.keys.model.migration.KeysResourceHandler; | ||
|
||
public class KeysResourceImpl extends XMIResourceImpl { | ||
|
||
public KeysResourceImpl(URI uri) { | ||
super(uri); | ||
} | ||
|
||
public KeysResourceImpl() { | ||
super(); | ||
} | ||
|
||
@Override | ||
protected void init() { | ||
super.init(); | ||
Map<Object, Object> options = getDefaultLoadOptions(); | ||
options.put(OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE); | ||
options.put(OPTION_RESOURCE_HANDLER, new KeysResourceHandler()); | ||
} | ||
|
||
} |