Skip to content
Snippets Groups Projects
Commit 0591645b authored by Florian Hölzl's avatar Florian Hölzl
Browse files

added IdentifierUtils

fixed deployment generation of toolcase ECU
refs 137
parent 1d7f6461
No related branches found
No related tags found
No related merge requests found
/*--------------------------------------------------------------------------+
$Id$
| |
| Copyright 2011 ForTISS GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.kernel.utils;
import org.fortiss.tooling.kernel.model.INamedElement;
/**
* Utility class for unique identifiers.
*
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating RED Hash:
*/
public class IdentifierUtils {
/**
* Returns the unique identifier built from the model element's name and ID.
* All non-word characters in the returned string are replace with '_'.
*/
public static String getUniqueIdentifier(INamedElement modelElement) {
return (modelElement.getName() + "_ID_" + modelElement.getId())
.replaceAll("\\W", "_");
}
/**
* Returns the identifier built from the model element's name. All non-word
* characters in the returned string are replace with '_'.
*/
public static String getIdentifier(INamedElement modelElement) {
return modelElement.getName().replaceAll("\\W", "_");
}
}
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