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 all words are in upper case, separated by "_" 012 * @author Rusi Popov (popovr@mdatools.net) 013 */ 014public class FormatAllCapital extends FormatWordsString { 015 016 public FormatAllCapital() { 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 final void formatFirstWord(StringBuilder result, String word, boolean nextWordExists) { 031 result.append( word.toUpperCase() ); 032 } 033 034 /** 035 * @see net.mdatools.modelant.core.operation.format.FormatWordsString#formatNextWord(java.lang.StringBuilder, java.lang.String, boolean) 036 */ 037 protected final void formatNextWord(StringBuilder result, String word, boolean nextWordExists) { 038 result.append( word.toUpperCase() ); 039 } 040}