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

rename classes

parent 7f1bafa1
No related branches found
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;
import org.eclipse.emf.ecore.xmi.XMLLoad;
import org.eclipse.emf.ecore.xmi.XMLSave;
/**
* <!-- begin-user-doc -->
* The <b>Resource </b> associated with the package.
* <!-- end-user-doc -->
* @see fr.centralesupelec.edf.riseclipse.cim.cim17.iec61970cim17v16.cim.util.CimResourceFactoryImpl
* @generated
*/
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 ) {
import fr.centralesupelec.edf.riseclipse.cim.util.cimxml.AbstractCimResource;
public abstract class AbstractCim17Resource extends AbstractCimResource {
public AbstractCim17Resource( URI uri ) {
super( uri );
}
@Override
protected XMLLoad createXMLLoad() {
return new CimXMLLoadImpl( createXMLHelper() );
return new Cim17XmlLoad( createXMLHelper() );
}
@Override
protected XMLSave createXMLSave() {
return new CimXMLSaveImpl( createXMLHelper() );
return new Cim17XmlSave( createXMLHelper() );
}
@Override
protected XMLHelper createXMLHelper() {
return new CimXMLHelperImpl( this );
return new Cim17XmlHelper( this );
}
} // CimResourceImpl
}
......@@ -19,10 +19,11 @@
*/
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 );
}
}
......@@ -19,9 +19,11 @@
*/
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();
}
}
......@@ -15,8 +15,9 @@
*/
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,
// 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;
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";
@Override
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;
import org.eclipse.emf.ecore.xmi.XMLHelper;
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 ) {
super( CimConstants.cimURI, xmiResource, helper, options );
public class Cim17XmlHandler extends AbstractCimXmlHandler {
public Cim17XmlHandler( XMLResource xmiResource, XMLHelper helper, Map< ?, ? > options ) {
super( Cim17Constants.cimURI, xmiResource, helper, options );
}
// This method needs the specific URI
@Override
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();
// 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
// We use the fact that SAXXMLHandler.setFeatureValue( EObject, EStructuralFeature, Object ) call
// SAXXMLHandler.setFeatureValue( EObject, EStructuralFeature, Object, -1 )
super.setFeatureValue( object, feature,
resource.substring( CimConstants.cimURISharp.length() + enumNameLength + 1 ), -1 );
resource.substring( Cim17Constants.cimURISharp.length() + enumNameLength + 1 ), -1 );
return true;
}
return false;
......
......@@ -14,17 +14,18 @@
*/
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 ) {
super( cimResourceImpl );
public Cim17XmlHelper( AbstractCim17Resource abstractCim17Resource ) {
super( abstractCim17Resource );
}
@Override
public String getURI( String prefix ) {
String uri = super.getURI( prefix );
if( CimConstants.cimURISharp.equals( uri )) return CimConstants.cimURI;
if( Cim17Constants.cimURISharp.equals( uri )) return Cim17Constants.cimURI;
return uri;
}
......
......@@ -18,15 +18,17 @@ package fr.centralesupelec.edf.riseclipse.cim.cim17.util;
import org.eclipse.emf.ecore.xmi.XMLHelper;
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 );
}
@Override
protected DefaultHandler makeDefaultHandler() {
return new CimXMLHandler( resource, helper, options );
return new Cim17XmlHandler( resource, helper, options );
}
}
......@@ -19,18 +19,20 @@ import java.util.Map;
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 ) {
super( CimConstants.cimURISharp, helper );
public Cim17XmlSave( XMLHelper helper ) {
super( Cim17Constants.cimURISharp, helper );
}
public CimXMLSaveImpl( Map< ?, ? > options, XMLHelper helper, String encoding ) {
super( CimConstants.cimURISharp, options, helper, encoding );
public Cim17XmlSave( Map< ?, ? > options, XMLHelper helper, String encoding ) {
super( Cim17Constants.cimURISharp, options, helper, encoding );
}
public CimXMLSaveImpl( Map< ?, ? > options, XMLHelper helper, String encoding, String xmlVersion ) {
super( CimConstants.cimURISharp, options, helper, encoding, xmlVersion );
public Cim17XmlSave( Map< ?, ? > options, XMLHelper helper, String encoding, String 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.
Finish editing this message first!
Please register or to comment