@NotNull private static String transformClassNameToBemFormat(@NotNull String className,@NotNull String separator,@NotNull GenerationNode node){
  Pair<String,Integer> cleanStringAndDepth=getCleanStringAndDepth(className,separator);
  Integer depth=cleanStringAndDepth.second;
  if (depth > 0) {
    GenerationNode donor=node;
    while (donor.getParent() != null && depth > 0) {
      donor=donor.getParent();
      depth--;
    }
    BemState bemState=BEM_STATE.get(donor);
    if (bemState != null) {
      String prefix=bemState.getBlock();
      if (!isNullOrEmpty(prefix)) {
        String element=bemState.getElement();
        if (MODIFIER_SEPARATOR.equals(separator) && !isNullOrEmpty(element)) {
          prefix=prefix + separator + element;
        }
        return prefix + separator + cleanStringAndDepth.first;
      }
    }
  }
  return className;
}

@ NotNull private static String transformClassNameToBemFormat ( @ NotNull String className , @ NotNull String separator , @ NotNull GenerationNode node ) { Pair < String , Integer > cleanStringAndDepth = getCleanStringAndDepth ( className , separator ) ; Integer depth = cleanStringAndDepth . second ; if ( depth > 0 ) { GenerationNode donor = node ; while ( donor . getParent ( ) != null && depth > 0 ) { donor = donor . getParent ( ) ; depth -- ; } BemState bemState = BEM_STATE . get ( donor ) ; if ( bemState != null ) { String prefix = bemState . getBlock ( ) ; if ( ! isNullOrEmpty ( prefix ) ) { String element = bemState . getElement ( ) ; if ( MODIFIER_SEPARATOR . equals ( separator ) && ! isNullOrEmpty ( element ) ) { prefix = prefix + separator + element ; } return prefix + separator + cleanStringAndDepth . first ; } } } return className ; }
adduction classname to bem format according to tags structure .
