001/*
002 * Copyright c 2018 Rusi Popov, MDA Tools.net All rights reserved.
003 *
004 * This program and the accompanying materials are made available under the terms of the
005 * Eclipse Public License v2.0 which accompanies this distribution, and is available at
006 * http://www.eclipse.org/legal/epl-v20.html
007 */
008package net.mdatools.modelant.core.operation.format;
009
010/**
011 * Concatenate the words without separators, where first one is in lower case, any next one
012 * is with first letter capitalized
013 * @author Rusi Popov (popovr@mdatools.net)
014 */
015public class FormatFirstLower extends FormatWordsString {
016
017  public FormatFirstLower() {
018    super( "" );
019  }
020
021  /**
022   * @see net.mdatools.modelant.core.operation.format.FormatWordsString#prepare(java.lang.String)
023   */
024  protected final String prepare(String source) {
025    return source;
026  }
027
028  /**
029   * @see net.mdatools.modelant.core.operation.format.FormatWordsString#formatFirstWord(java.lang.StringBuilder, java.lang.String, boolean)
030   */
031  protected void formatFirstWord(StringBuilder result, String word, boolean nextWordExists) {
032    result.append( word.toLowerCase() );
033  }
034
035  /**
036   * @see net.mdatools.modelant.core.operation.format.FormatWordsString#formatNextWord(java.lang.StringBuilder, java.lang.String, boolean)
037   */
038  protected void formatNextWord(StringBuilder result, String word, boolean nextWordExists) {
039    formatFirstCapitalAllLower( result, word );
040  }
041}