All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.rhocas.featuregen.ap.FeatureNameConverter Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
package de.rhocas.featuregen.ap;

import org.eclipse.xtend.lib.macro.declaration.AnnotationReference;

/**
 * This is a helper class to convert the names of the features to valid Java identifiers.
 * 
 * @author Nils Christian Ehmke
 */
@SuppressWarnings("all")
final class FeatureNameConverter {
  public String convertToValidSimpleFeatureName(final String rawFeatureName, final AnnotationReference annotation) {
    String _xblockexpression = null;
    {
      final String prefix = annotation.getStringValue("prefix");
      final String suffix = annotation.getStringValue("suffix");
      String _replaceAll = rawFeatureName.replaceAll("(\\W)", "");
      String _plus = (prefix + _replaceAll);
      final String simpleFeatureName = (_plus + suffix);
      _xblockexpression = simpleFeatureName.toUpperCase();
    }
    return _xblockexpression;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy