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 every word is with first letter capitalized 012 * @author Rusi Popov (popovr@mdatools.net) 013 */ 014public class FormatFirstCapital extends FormatWordsString { 015 016 public FormatFirstCapital() { 017 super( "" ); 018 } 019 020 /** 021 * @see net.mdatools.modelant.core.operation.format.FormatWordsString#prepare(java.lang.String) 022 */ 023 protected final String prepare(String source) { 024 return source; 025 } 026 027 /** 028 * @see net.mdatools.modelant.core.operation.format.FormatWordsString#formatFirstWord(java.lang.StringBuilder, java.lang.String, boolean) 029 */ 030 protected void formatFirstWord(StringBuilder result, String word, boolean nextWordExists) { 031 formatFirstCapitalAllLower( result, word ); 032 } 033 034 /** 035 * @see net.mdatools.modelant.core.operation.format.FormatWordsString#formatNextWord(java.lang.StringBuilder, java.lang.String, boolean) 036 */ 037 protected void formatNextWord(StringBuilder result, String word, boolean nextWordExists) { 038 formatFirstCapitalAllLower( result, word ); 039 } 040}