Skip to content
Snippets Groups Projects
Commit f1a8627c authored by Dominique Marcadet's avatar Dominique Marcadet
Browse files

rename classes

parent 7f1bafa1
Branches
No related tags found
1 merge request!10Resolve "update to changes in RiseClipseMain"
Showing
with 78 additions and 81 deletions
...@@ -20,39 +20,28 @@ import org.eclipse.emf.ecore.xmi.XMLHelper; ...@@ -20,39 +20,28 @@ import org.eclipse.emf.ecore.xmi.XMLHelper;
import org.eclipse.emf.ecore.xmi.XMLLoad; import org.eclipse.emf.ecore.xmi.XMLLoad;
import org.eclipse.emf.ecore.xmi.XMLSave; import org.eclipse.emf.ecore.xmi.XMLSave;
/** import fr.centralesupelec.edf.riseclipse.cim.util.cimxml.AbstractCimResource;
* <!-- begin-user-doc -->
* The <b>Resource </b> associated with the package.
* <!-- end-user-doc --> public abstract class AbstractCim17Resource extends AbstractCimResource {
* @see fr.centralesupelec.edf.riseclipse.cim.cim17.iec61970cim17v16.cim.util.CimResourceFactoryImpl
* @generated public AbstractCim17Resource( URI uri ) {
*/
public abstract class CimResourceImpl extends fr.centralesupelec.edf.riseclipse.cim.util.cimxml.CimResourceImpl {
/**
* Creates an instance of the resource.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param uri the URI of the new resource.
* @generated NOT
*/
public CimResourceImpl( URI uri ) {
super( uri ); super( uri );
} }
@Override @Override
protected XMLLoad createXMLLoad() { protected XMLLoad createXMLLoad() {
return new CimXMLLoadImpl( createXMLHelper() ); return new Cim17XmlLoad( createXMLHelper() );
} }
@Override @Override
protected XMLSave createXMLSave() { protected XMLSave createXMLSave() {
return new CimXMLSaveImpl( createXMLHelper() ); return new Cim17XmlSave( createXMLHelper() );
} }
@Override @Override
protected XMLHelper createXMLHelper() { protected XMLHelper createXMLHelper() {
return new CimXMLHelperImpl( this ); return new Cim17XmlHelper( this );
} }
} // CimResourceImpl }
...@@ -19,10 +19,11 @@ ...@@ -19,10 +19,11 @@
*/ */
package fr.centralesupelec.edf.riseclipse.cim.cim17.util; package fr.centralesupelec.edf.riseclipse.cim.cim17.util;
import fr.centralesupelec.edf.riseclipse.cim.util.cimxml.AbstractCimResourceSet;
public abstract class CimResourceSetImpl extends fr.centralesupelec.edf.riseclipse.cim.util.cimxml.CimResourceSetImpl { public abstract class AbstractCim17ResourceSet extends AbstractCimResourceSet {
public CimResourceSetImpl( boolean strictContent ) { public AbstractCim17ResourceSet( boolean strictContent ) {
super( strictContent ); super( strictContent );
} }
} }
...@@ -19,9 +19,11 @@ ...@@ -19,9 +19,11 @@
*/ */
package fr.centralesupelec.edf.riseclipse.cim.cim17.util; package fr.centralesupelec.edf.riseclipse.cim.cim17.util;
public abstract class CimResourceSetFactory extends fr.centralesupelec.edf.riseclipse.cim.util.cimxml.CimResourceSetFactory { import fr.centralesupelec.edf.riseclipse.cim.util.cimxml.AbstractCimResourceSetFactory;
public abstract class AbstractCim17ResourceSetFactory extends AbstractCimResourceSetFactory {
public CimResourceSetFactory() { public AbstractCim17ResourceSetFactory() {
super(); super();
} }
} }
...@@ -15,8 +15,9 @@ ...@@ -15,8 +15,9 @@
*/ */
package fr.centralesupelec.edf.riseclipse.cim.cim17.util; package fr.centralesupelec.edf.riseclipse.cim.cim17.util;
import fr.centralesupelec.edf.riseclipse.cim.util.cimxml.AbstractCimConstants;
public class CimConstants extends fr.centralesupelec.edf.riseclipse.cim.util.cimxml.CimConstants { public class Cim17Constants extends AbstractCimConstants {
// CimPackage is specific to each concrete Cim17 metamodel, so we cannot get it here, // CimPackage is specific to each concrete Cim17 metamodel, so we cannot get it here,
// but we prefer to have a generic Cim17 package // but we prefer to have a generic Cim17 package
......
/**
* Copyright (c) 2016 CentraleSupélec & EDF.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* This file is part of the RiseClipse tool
*
* Contributors:
* Computer Science Department, CentraleSupélec : initial implementation
* Contacts:
* Dominique.Marcadet@centralesupelec.fr
*
*/
package fr.centralesupelec.edf.riseclipse.cim.cim17.util;
import fr.centralesupelec.edf.riseclipse.cim.cim17.util.Cim17ResourceHandler;
import fr.centralesupelec.edf.riseclipse.cim.util.cimxml.AbstractCimResourceFactory;
public abstract class Cim17ResourceFactory extends AbstractCimResourceFactory {
@Override
protected Cim17ResourceHandler createCimResourceHandler() {
return new Cim17ResourceHandler();
}
}
...@@ -20,13 +20,15 @@ import java.util.Map; ...@@ -20,13 +20,15 @@ import java.util.Map;
import org.eclipse.emf.ecore.xmi.XMLResource; import org.eclipse.emf.ecore.xmi.XMLResource;
public class CimResourceHandler extends fr.centralesupelec.edf.riseclipse.cim.util.cimxml.CimResourceHandler { import fr.centralesupelec.edf.riseclipse.cim.util.cimxml.AbstractCimResourceHandler;
public class Cim17ResourceHandler extends AbstractCimResourceHandler {
static final String xmlDeclaration = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>\n"; static final String xmlDeclaration = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>\n";
@Override @Override
public void preSave( XMLResource resource, OutputStream outputStream, Map< ?, ? > options ) { public void preSave( XMLResource resource, OutputStream outputStream, Map< ?, ? > options ) {
super.preSave( resource, outputStream, options, CimConstants.cimURISharp ); super.preSave( resource, outputStream, options, Cim17Constants.cimURISharp );
} }
} }
...@@ -22,23 +22,25 @@ import org.eclipse.emf.ecore.EStructuralFeature; ...@@ -22,23 +22,25 @@ import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.xmi.XMLHelper; import org.eclipse.emf.ecore.xmi.XMLHelper;
import org.eclipse.emf.ecore.xmi.XMLResource; import org.eclipse.emf.ecore.xmi.XMLResource;
public class CimXMLHandler extends fr.centralesupelec.edf.riseclipse.cim.util.cimxml.CimXMLHandler { import fr.centralesupelec.edf.riseclipse.cim.util.cimxml.AbstractCimXmlHandler;
public CimXMLHandler( XMLResource xmiResource, XMLHelper helper, Map< ?, ? > options ) { public class Cim17XmlHandler extends AbstractCimXmlHandler {
super( CimConstants.cimURI, xmiResource, helper, options );
public Cim17XmlHandler( XMLResource xmiResource, XMLHelper helper, Map< ?, ? > options ) {
super( Cim17Constants.cimURI, xmiResource, helper, options );
} }
// This method needs the specific URI // This method needs the specific URI
@Override @Override
protected boolean setEnumValue( EObject object, EStructuralFeature feature, String resource ) { protected boolean setEnumValue( EObject object, EStructuralFeature feature, String resource ) {
if( resource.startsWith( CimConstants.cimURISharp ) ) { if( resource.startsWith( Cim17Constants.cimURISharp ) ) {
int enumNameLength = feature.getEType().getName().length(); int enumNameLength = feature.getEType().getName().length();
// do not call fr.centralesupelec.riseclipse.cim.util.cimxml.CimXMLHandler.setFeatureValue to avoid infinite recursion // do not call fr.centralesupelec.riseclipse.cim.util.cimxml.CimXMLHandler.setFeatureValue to avoid infinite recursion
// call instead org.eclipse.emf.ecore.xmi.impl.SAXXMLHandler.setFeatureValue // call instead org.eclipse.emf.ecore.xmi.impl.SAXXMLHandler.setFeatureValue
// We use the fact that SAXXMLHandler.setFeatureValue( EObject, EStructuralFeature, Object ) call // We use the fact that SAXXMLHandler.setFeatureValue( EObject, EStructuralFeature, Object ) call
// SAXXMLHandler.setFeatureValue( EObject, EStructuralFeature, Object, -1 ) // SAXXMLHandler.setFeatureValue( EObject, EStructuralFeature, Object, -1 )
super.setFeatureValue( object, feature, super.setFeatureValue( object, feature,
resource.substring( CimConstants.cimURISharp.length() + enumNameLength + 1 ), -1 ); resource.substring( Cim17Constants.cimURISharp.length() + enumNameLength + 1 ), -1 );
return true; return true;
} }
return false; return false;
......
...@@ -14,17 +14,18 @@ ...@@ -14,17 +14,18 @@
*/ */
package fr.centralesupelec.edf.riseclipse.cim.cim17.util; package fr.centralesupelec.edf.riseclipse.cim.cim17.util;
import fr.centralesupelec.edf.riseclipse.cim.util.cimxml.AbstractCimXmlHelper;
public class CimXMLHelperImpl extends fr.centralesupelec.edf.riseclipse.cim.util.cimxml.CimXMLHelperImpl { public class Cim17XmlHelper extends AbstractCimXmlHelper {
public CimXMLHelperImpl( CimResourceImpl cimResourceImpl ) { public Cim17XmlHelper( AbstractCim17Resource abstractCim17Resource ) {
super( cimResourceImpl ); super( abstractCim17Resource );
} }
@Override @Override
public String getURI( String prefix ) { public String getURI( String prefix ) {
String uri = super.getURI( prefix ); String uri = super.getURI( prefix );
if( CimConstants.cimURISharp.equals( uri )) return CimConstants.cimURI; if( Cim17Constants.cimURISharp.equals( uri )) return Cim17Constants.cimURI;
return uri; return uri;
} }
......
...@@ -18,15 +18,17 @@ package fr.centralesupelec.edf.riseclipse.cim.cim17.util; ...@@ -18,15 +18,17 @@ package fr.centralesupelec.edf.riseclipse.cim.cim17.util;
import org.eclipse.emf.ecore.xmi.XMLHelper; import org.eclipse.emf.ecore.xmi.XMLHelper;
import org.xml.sax.helpers.DefaultHandler; import org.xml.sax.helpers.DefaultHandler;
public class CimXMLLoadImpl extends fr.centralesupelec.edf.riseclipse.cim.util.cimxml.CimXMLLoadImpl { import fr.centralesupelec.edf.riseclipse.cim.util.cimxml.AbstractCimXmlLoad;
public CimXMLLoadImpl( XMLHelper helper ) { public class Cim17XmlLoad extends AbstractCimXmlLoad {
public Cim17XmlLoad( XMLHelper helper ) {
super( helper ); super( helper );
} }
@Override @Override
protected DefaultHandler makeDefaultHandler() { protected DefaultHandler makeDefaultHandler() {
return new CimXMLHandler( resource, helper, options ); return new Cim17XmlHandler( resource, helper, options );
} }
} }
...@@ -19,18 +19,20 @@ import java.util.Map; ...@@ -19,18 +19,20 @@ import java.util.Map;
import org.eclipse.emf.ecore.xmi.XMLHelper; import org.eclipse.emf.ecore.xmi.XMLHelper;
public class CimXMLSaveImpl extends fr.centralesupelec.edf.riseclipse.cim.util.cimxml.CimXMLSaveImpl { import fr.centralesupelec.edf.riseclipse.cim.util.cimxml.AbstractCimXmlSave;
public class Cim17XmlSave extends AbstractCimXmlSave {
public CimXMLSaveImpl( XMLHelper helper ) { public Cim17XmlSave( XMLHelper helper ) {
super( CimConstants.cimURISharp, helper ); super( Cim17Constants.cimURISharp, helper );
} }
public CimXMLSaveImpl( Map< ?, ? > options, XMLHelper helper, String encoding ) { public Cim17XmlSave( Map< ?, ? > options, XMLHelper helper, String encoding ) {
super( CimConstants.cimURISharp, options, helper, encoding ); super( Cim17Constants.cimURISharp, options, helper, encoding );
} }
public CimXMLSaveImpl( Map< ?, ? > options, XMLHelper helper, String encoding, String xmlVersion ) { public Cim17XmlSave( Map< ?, ? > options, XMLHelper helper, String encoding, String xmlVersion ) {
super( CimConstants.cimURISharp, options, helper, encoding, xmlVersion ); super( Cim17Constants.cimURISharp, options, helper, encoding, xmlVersion );
} }
} }
/**
* Copyright (c) 2016 CentraleSupélec & EDF.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* This file is part of the RiseClipse tool
*
* Contributors:
* Computer Science Department, CentraleSupélec : initial implementation
* Contacts:
* Dominique.Marcadet@centralesupelec.fr
*
*/
package fr.centralesupelec.edf.riseclipse.cim.cim17.util;
import fr.centralesupelec.edf.riseclipse.cim.cim17.util.CimResourceHandler;
/**
* <!-- begin-user-doc -->
* The <b>Resource Factory</b> associated with the package.
* <!-- end-user-doc -->
* @see fr.centralesupelec.edf.riseclipse.cim.cim17.iec61970cim17v16.cim.util.CimResourceImpl
* @generated NOT
*/
public abstract class CimResourceFactoryImpl extends fr.centralesupelec.edf.riseclipse.cim.util.cimxml.CimResourceFactoryImpl {
@Override
protected CimResourceHandler createCimResourceHandler() {
return new CimResourceHandler();
}
} //CimResourceFactoryImpl
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment