Skip to content

Commit

Permalink
[#1375] Revise public API
Browse files Browse the repository at this point in the history
move ProductsResource and Factory to internal package
  • Loading branch information
eparovyshnaya committed May 28, 2024
1 parent 3c12948 commit 4227443
Show file tree
Hide file tree
Showing 7 changed files with 324 additions and 353 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="0.0.0";x-installation:=
org.eclipse.passage.lic.emf;bundle-version="0.0.0",
org.eclipse.passage.lic.products;bundle-version="0.0.0";visibility:=reexport
Export-Package: org.eclipse.passage.lic.internal.products.model;x-friends:="org.eclipse.passage.loc.dashboard.ui",
org.eclipse.passage.lic.internal.products.model.util;x-internal:=true,
org.eclipse.passage.lic.products.model.api,
org.eclipse.passage.lic.products.model.impl;x-internal:=true,
org.eclipse.passage.lic.products.model.meta,
Expand Down
72 changes: 36 additions & 36 deletions bundles/org.eclipse.passage.lic.products.model/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<!--
Copyright (c) 2018, 2024 ArSysOp and others
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 products -->
<package
uri="http://www.eclipse.org/passage/lic/products/3.0.0"
class="org.eclipse.passage.lic.products.model.meta.ProductsPackage"
genModel="model/products.genmodel"/>
</extension>

<extension point="org.eclipse.emf.ecore.extension_parser">
<!-- @generated products -->
<parser
type="products"
class="org.eclipse.passage.lic.products.model.util.ProductsResourceFactoryImpl"/>
<parser
type="lic_products"
class="org.eclipse.passage.lic.products.model.util.ProductsResourceFactoryImpl"/>
</extension>

</plugin>
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<!--
Copyright (c) 2018, 2024 ArSysOp and others
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 products -->
<package
uri="http://www.eclipse.org/passage/lic/products/3.0.0"
class="org.eclipse.passage.lic.products.model.meta.ProductsPackage"
genModel="model/products.genmodel"/>
</extension>

<extension point="org.eclipse.emf.ecore.extension_parser">
<!-- @generated products -->
<parser
type="products"
class="org.eclipse.passage.lic.internal.products.model.util.ProductsResourceFactoryImpl"/>
<parser
type="lic_products"
class="org.eclipse.passage.lic.internal.products.model.util.ProductsResourceFactoryImpl"/>
</extension>

</plugin>
Original file line number Diff line number Diff line change
@@ -1,48 +1,27 @@
/*******************************************************************************
* Copyright (c) 2018, 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.products.model.util;

import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl;

/**
* <!-- begin-user-doc --> The <b>Resource Factory</b> associated with the
* package. <!-- end-user-doc -->
* @see org.eclipse.passage.lic.products.model.util.ProductsResourceImpl
* @generated
*/
public class ProductsResourceFactoryImpl extends ResourceFactoryImpl {
/**
* Creates an instance of the resource factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ProductsResourceFactoryImpl() {
super();
}

/**
* Creates an instance of the resource.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Resource createResource(URI uri) {
Resource result = new ProductsResourceImpl(uri);
return result;
}

} // ProductsResourceFactoryImpl
/*******************************************************************************
* Copyright (c) 2018, 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.products.model.util;

import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl;

public class ProductsResourceFactoryImpl extends ResourceFactoryImpl {

@Override
public Resource createResource(URI uri) {
Resource result = new ProductsResourceImpl(uri);
return result;
}

}
Original file line number Diff line number Diff line change
@@ -1,47 +1,35 @@
/*******************************************************************************
* Copyright (c) 2018, 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.products.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.products.model.migration.ProductsResourceHandler;

/**
* <!-- begin-user-doc --> The <b>Resource </b> associated with the package.
* <!-- end-user-doc -->
* @see org.eclipse.passage.lic.products.model.util.ProductsResourceFactoryImpl
* @generated
*/
public class ProductsResourceImpl extends XMIResourceImpl {
/**
* Creates an instance of the resource.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param uri the URI of the new resource.
* @generated
*/
public ProductsResourceImpl(URI uri) {
super(uri);
}

@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 ProductsResourceHandler());
}

} // ProductsResourceImpl
/*******************************************************************************
* Copyright (c) 2018, 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.products.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.products.model.migration.ProductsResourceHandler;

public class ProductsResourceImpl extends XMIResourceImpl {

public ProductsResourceImpl(URI uri) {
super(uri);
}

@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 ProductsResourceHandler());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.osgi.util.NLS;
import org.eclipse.passage.lic.internal.equinox.events.EquinoxEvent;
import org.eclipse.passage.lic.internal.products.model.util.ProductsResourceImpl;
import org.eclipse.passage.lic.products.model.api.Product;
import org.eclipse.passage.lic.products.model.api.ProductLine;
import org.eclipse.passage.lic.products.model.api.ProductVersion;
import org.eclipse.passage.lic.products.model.api.ProductVersionFeature;
import org.eclipse.passage.lic.products.model.meta.ProductsPackage;
import org.eclipse.passage.lic.products.model.util.ProductsResourceImpl;
import org.eclipse.passage.loc.internal.api.OperatorGearSupplier;
import org.eclipse.passage.loc.internal.api.workspace.KnownResources;
import org.eclipse.passage.loc.internal.api.workspace.OperatorWorkspace;
Expand All @@ -51,6 +51,7 @@
import org.osgi.service.component.annotations.ReferenceCardinality;
import org.osgi.service.event.EventAdmin;

@SuppressWarnings("restriction")
@Component(property = { EditingDomainRegistryAccess.PROPERTY_DOMAIN_NAME + '=' + ProductsPackage.eNAME,
EditingDomainRegistryAccess.PROPERTY_FILE_EXTENSION + '=' + "products_xmi" })
public final class ProductDomainRegistry extends BaseDomainRegistry<ProductLine>
Expand Down
Loading

0 comments on commit 4227443

Please sign in to comment.