Java Code Examples for org.apache.commons.lang.WordUtils

The following examples show how to use org.apache.commons.lang.WordUtils. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: das   Source File: AbstractDataPreparer.java    License: Apache License 2.0 6 votes vote down vote up
protected String getPojoClassName(String prefix, String suffix, String tableName) {
    String className = tableName;
    if (null != prefix && !prefix.isEmpty() && className.indexOf(prefix) == 0) {
        className = className.replaceFirst(prefix, "");
    }
    if (null != suffix && !suffix.isEmpty()) {
        className = className + WordUtils.capitalize(suffix);
    }

    StringBuilder result = new StringBuilder();
    for (String str : StringUtils.split(className, "_")) {
        result.append(WordUtils.capitalize(str));
    }

    return WordUtils.capitalize(result.toString());
}
 
Example 2
Source Project: openregistry   Source File: NameSuffixAspect.java    License: Apache License 2.0 6 votes vote down vote up
@Around("set(@org.openregistry.core.domain.normalization.NameSuffix * *)")
public Object transformFieldValue(final ProceedingJoinPoint joinPoint) throws Throwable {
	final String value = (String) joinPoint.getArgs()[0];

       if (isDisabled() || value == null || value.isEmpty()) {
           return joinPoint.proceed();
       }

       final String overrideValue = getCustomMapping().get(value);

       if (overrideValue != null) {
          return joinPoint.proceed(new Object[] {overrideValue});
       }
        
       final String casifyValue;
       if (value.matches("^[IiVv]+$")) { //TODO Generalize II - VIII
       	casifyValue = value.toUpperCase();
       } else {
       	casifyValue = WordUtils.capitalizeFully(value);
       }

       return joinPoint.proceed(new Object[] {casifyValue});
   }
 
Example 3
@EventHandler(priority = EventPriority.LOW)
public void onMatchEnd(MatchEndEvent event) {
    Match match = event.getMatch();
    Tourney plugin = Tourney.get();
    this.session.appendMatch(match, plugin.getMatchManager().getTeamManager().teamToEntrant(Iterables.getOnlyElement(event.getMatch().needMatchModule(VictoryMatchModule.class).winners(), null)));

    Entrant winningParticipation = this.session.calculateWinner();
    int matchesPlayed = this.session.getMatchesPlayed();
    if (winningParticipation != null) {
        Bukkit.broadcastMessage(ChatColor.YELLOW + "A winner has been determined!");
        Bukkit.broadcastMessage(ChatColor.AQUA + WordUtils.capitalize(winningParticipation.team().name()) + ChatColor.RESET + ChatColor.YELLOW + " wins! Congratulations!");
        plugin.clearKDMSession();
    } else if (matchesPlayed < 3) {
        Bukkit.broadcastMessage(ChatColor.YELLOW + "A winner has not yet been determined! Beginning match #" + (matchesPlayed + 1) + "...");
        match.needMatchModule(CycleMatchModule.class).startCountdown(Duration.ofSeconds(15), session.getMap());
    } else {
        Bukkit.broadcastMessage(ChatColor.YELLOW + "There is a tie! Congratulations to both teams!");
        Tourney.get().clearKDMSession();
    }
}
 
Example 4
Source Project: CardinalPGM   Source File: ScoreboardModule.java    License: MIT License 6 votes vote down vote up
public void renderObjective(GameObjective objective) {
    if (!objective.showOnScoreboard()) return;
    int score = currentScore;
    Team team = scoreboard.getTeam(objective.getScoreboardHandler().getNumber() + "-o");
    String prefix = objective.getScoreboardHandler().getPrefix(this.team);
    team.setPrefix(prefix);
    if (team.getEntries().size() > 0) {
        setScore(this.objective, new ArrayList<>(team.getEntries()).get(0), score);
    } else {
        String raw = (objective instanceof HillObjective ? "" : ChatColor.RESET) + " " + WordUtils.capitalizeFully(objective.getName().replaceAll("_", " "));
        while (used.contains(raw)) {
            raw =  raw + ChatColor.RESET;
        }
        team.addEntry(raw);
        setScore(this.objective, raw, score);
        used.add(raw);
    }
    currentScore++;
}
 
Example 5
Source Project: hadoop   Source File: CacheAdmin.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public String getLongUsage() {
  TableListing listing = AdminHelper.getOptionDescriptionListing();

  listing.addRow("<name>", "Name of the pool to modify.");
  listing.addRow("<owner>", "Username of the owner of the pool");
  listing.addRow("<group>", "Groupname of the group of the pool.");
  listing.addRow("<mode>", "Unix-style permissions of the pool in octal.");
  listing.addRow("<limit>", "Maximum number of bytes that can be cached " +
      "by this pool.");
  listing.addRow("<maxTtl>", "The maximum allowed time-to-live for " +
      "directives being added to the pool.");

  return getShortUsage() + "\n" +
      WordUtils.wrap("Modifies the metadata of an existing cache pool. " +
      "See usage of " + AddCachePoolCommand.NAME + " for more details.",
      AdminHelper.MAX_LINE_WIDTH) + "\n\n" +
      listing.toString();
}
 
Example 6
Source Project: openhab1-addons   Source File: WeatherPublisher.java    License: Eclipse Public License 2.0 6 votes vote down vote up
/**
 * Publishes the item with the value.
 */
private void publishValue(String itemName, Object value, WeatherBindingConfig bindingConfig) {
    if (value == null) {
        context.getEventPublisher().postUpdate(itemName, UnDefType.UNDEF);
    } else if (value instanceof Calendar) {
        Calendar calendar = (Calendar) value;
        context.getEventPublisher().postUpdate(itemName, new DateTimeType(calendar));
    } else if (value instanceof Number) {
        context.getEventPublisher().postUpdate(itemName, new DecimalType(round(value.toString(), bindingConfig)));
    } else if (value instanceof String || value instanceof Enum) {
        if (value instanceof Enum) {
            String enumValue = WordUtils.capitalizeFully(StringUtils.replace(value.toString(), "_", " "));
            context.getEventPublisher().postUpdate(itemName, new StringType(enumValue));
        } else {
            context.getEventPublisher().postUpdate(itemName, new StringType(value.toString()));
        }
    } else {
        logger.warn("Unsupported value type {}", value.getClass().getSimpleName());
    }
}
 
Example 7
Source Project: hadoop   Source File: TableListing.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Return the ith row of the column as a set of wrapped strings, each at
 * most wrapWidth in length.
 */
String[] getRow(int idx) {
  String raw = rows.get(idx);
  // Line-wrap if it's too long
  String[] lines = new String[] {raw};
  if (wrap) {
    lines = WordUtils.wrap(lines[0], wrapWidth, "\n", true).split("\n");
  }
  for (int i=0; i<lines.length; i++) {
    if (justification == Justification.LEFT) {
      lines[i] = StringUtils.rightPad(lines[i], maxWidth);
    } else if (justification == Justification.RIGHT) {
      lines[i] = StringUtils.leftPad(lines[i], maxWidth);
    }
  }
  return lines;
}
 
Example 8
Source Project: openregistry   Source File: FirstNameAspect.java    License: Apache License 2.0 6 votes vote down vote up
@Around("set(@org.openregistry.core.domain.normalization.FirstName * *)")
public Object transformFieldValue(final ProceedingJoinPoint joinPoint) throws Throwable {
    final String value = (String) joinPoint.getArgs()[0];

    if (isDisabled() || value == null || value.isEmpty()) {
        return joinPoint.proceed();
    }

    final String overrideValue = getCustomMapping().get(value);

    if (overrideValue != null) {
        return joinPoint.proceed(new Object[] {overrideValue});
    }

    return joinPoint.proceed(new Object[] {WordUtils.capitalizeFully(value)});
}
 
Example 9
Source Project: bioasq   Source File: GoPubMedTripleRetrievalExecutor.java    License: Apache License 2.0 6 votes vote down vote up
private void addQueryWord(String s){
    if(s==null)return;
    if(s.length()==0)return;
    if(queryWords.contains(s))
        return;
    else
        queryWords.add(s);
    
    if(sb.length()>0) sb.append(" OR ");
    sb.append(s+"[obj] OR "+ s + "[subj]");
    List<String> ls = new LinkedList<String>();
    ls.add(s.toUpperCase());
    ls.add(s.toLowerCase());
    ls.add(WordUtils.capitalize(s));
    for(String x:ls){
        sb.append(" OR ");
        sb.append(x);
        sb.append("[obj] OR ");
        sb.append(x);
        sb.append("[subj]");
    }
}
 
Example 10
/**
  * @see org.kuali.kfs.pdp.batch.service.ExtractPaymentService#formatCheckNoteLines(java.lang.String)
  *
  * Long check stub note
  */
@Override
public List<String> formatCheckNoteLines(String checkNote) {
    List<String> formattedCheckNoteLines = new ArrayList<String>();

    if (StringUtils.isBlank(checkNote)) {
        return formattedCheckNoteLines;
    }

    String[] textLines = StringUtils.split(checkNote, BusinessObjectReportHelper.LINE_BREAK);
    int maxLengthOfNoteLine = dataDictionaryService.getAttributeMaxLength(PaymentNoteText.class, "customerNoteText");
    for (String textLine : textLines) {
        String text = WordUtils.wrap(textLine, maxLengthOfNoteLine, BusinessObjectReportHelper.LINE_BREAK, true);
        String[] wrappedTextLines = StringUtils.split(text, BusinessObjectReportHelper.LINE_BREAK);
        for (String wrappedText : wrappedTextLines) {
            formattedCheckNoteLines.add(wrappedText);
        }
    }
    return formattedCheckNoteLines;
}
 
Example 11
Source Project: pentaho-kettle   Source File: RepositoryCleanupUtil.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Format strings for command line output
 * 
 * @param unformattedText
 * @param indentFirstLine
 * @param indentBalance
 * @return
 */
private String indentFormat( String unformattedText, int indentFirstLine, int indentBalance ) {
  final int maxWidth = 79;
  String leadLine = WordUtils.wrap( unformattedText, maxWidth - indentFirstLine );
  StringBuilder result = new StringBuilder();
  result.append( "\n" );
  if ( leadLine.indexOf( NEW_LINE ) == -1 ) {
    result.append( NEW_LINE ).append( StringUtils.repeat( " ", indentFirstLine ) ).append( unformattedText );
  } else {
    int lineBreakPoint = leadLine.indexOf( NEW_LINE );
    String indentString = StringUtils.repeat( " ", indentBalance );
    result.append( NEW_LINE ).append( StringUtils.repeat( " ", indentFirstLine ) ).append(
        leadLine.substring( 0, lineBreakPoint ) );
    String formattedText = WordUtils.wrap( unformattedText.substring( lineBreakPoint ), maxWidth - indentBalance );
    for ( String line : formattedText.split( NEW_LINE ) ) {
      result.append( NEW_LINE ).append( indentString ).append( line );
    }
  }
  return result.toString();
}
 
Example 12
Source Project: ant-ivy   Source File: HelloIvy.java    License: Apache License 2.0 6 votes vote down vote up
public static void main(String[] args) throws Exception {
    String  message = "Hello Ivy!";
    System.out.println("standard message : " + message);
    System.out.println("capitalized by " + WordUtils.class.getName()
        + " : " + WordUtils.capitalizeFully(message));

    HttpClient client = new HttpClient();
    HeadMethod head = new HeadMethod("http://www.ibiblio.org/");
    client.executeMethod(head);

    int status = head.getStatusCode();
    System.out.println("head status code with httpclient: " + status);
    head.releaseConnection();

    System.out.println(
        "now check if httpclient dependency on commons-logging has been realized");
    Class<?> clss = Class.forName("org.apache.commons.logging.Log");
    System.out.println("found logging class in classpath: " + clss);
}
 
Example 13
Source Project: big-c   Source File: TableListing.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Return the ith row of the column as a set of wrapped strings, each at
 * most wrapWidth in length.
 */
String[] getRow(int idx) {
  String raw = rows.get(idx);
  // Line-wrap if it's too long
  String[] lines = new String[] {raw};
  if (wrap) {
    lines = WordUtils.wrap(lines[0], wrapWidth, "\n", true).split("\n");
  }
  for (int i=0; i<lines.length; i++) {
    if (justification == Justification.LEFT) {
      lines[i] = StringUtils.rightPad(lines[i], maxWidth);
    } else if (justification == Justification.RIGHT) {
      lines[i] = StringUtils.leftPad(lines[i], maxWidth);
    }
  }
  return lines;
}
 
Example 14
Source Project: dal   Source File: AbstractJavaDataPreparer.java    License: Apache License 2.0 6 votes vote down vote up
protected String getPojoClassName(String prefix, String suffix, String tableName) {
    String className = tableName;
    if (null != prefix && !prefix.isEmpty() && className.indexOf(prefix) == 0) {
        className = className.replaceFirst(prefix, "");
    }
    if (null != suffix && !suffix.isEmpty()) {
        className = className + WordUtils.capitalize(suffix);
    }

    StringBuilder result = new StringBuilder();
    for (String str : StringUtils.split(className, "_")) {
        result.append(WordUtils.capitalize(str));
    }

    return WordUtils.capitalize(result.toString());
}
 
Example 15
Source Project: dal   Source File: AbstractCSharpDataPreparer.java    License: Apache License 2.0 6 votes vote down vote up
protected String getPojoClassName(String prefix, String suffix, String table) {
    String className = table;
    if (null != prefix && !prefix.isEmpty() && className.indexOf(prefix) == 0) {
        className = className.replaceFirst(prefix, "");
    }
    if (null != suffix && !suffix.isEmpty()) {
        className = className + WordUtils.capitalize(suffix);
    }

    StringBuilder result = new StringBuilder();
    for (String str : StringUtils.split(className, "_")) {
        result.append(WordUtils.capitalize(str));
    }

    return WordUtils.capitalize(result.toString());
}
 
Example 16
Source Project: dal   Source File: CSharpDataPreparerOfFreeSqlProcessor.java    License: Apache License 2.0 6 votes vote down vote up
private void prepareDbFromFreeSql(CodeGenContext codeGenCtx, List<GenTaskByFreeSql> freeSqls) throws Exception {
    CSharpCodeGenContext ctx = (CSharpCodeGenContext) codeGenCtx;
    Map<String, DatabaseHost> _dbHosts = ctx.getDbHosts();
    Set<String> _freeDaos = ctx.getFreeDaos();
    for (GenTaskByFreeSql task : freeSqls) {
        addDatabaseSet(ctx, task.getDatabaseSetName());
        _freeDaos.add(WordUtils.capitalize(task.getClass_name()));
        if (!_dbHosts.containsKey(task.getAllInOneName())) {
            String provider = "sqlProvider";
            String dbType = DbUtils.getDbType(task.getAllInOneName());
            if (null != dbType && !dbType.equalsIgnoreCase("Microsoft SQL Server")) {
                provider = "mySqlProvider";
            }
            DatabaseHost host = new DatabaseHost();
            host.setAllInOneName(task.getAllInOneName());
            host.setProviderType(provider);
            host.setDatasetName(task.getDatabaseSetName());
            _dbHosts.put(task.getAllInOneName(), host);
        }
    }
}
 
Example 17
Source Project: dal   Source File: CSharpMethodHost.java    License: Apache License 2.0 6 votes vote down vote up
public String getParameterDeclaration() {
    List<String> paramsDeclaration = new ArrayList<>();
    for (CSharpParameterHost parameter : parameters) {
        ConditionType conditionType = parameter.getConditionType();
        if (conditionType == ConditionType.In || parameter.isInParameter()) {
            paramsDeclaration.add(String.format("List<%s> %s", parameter.getType(), WordUtils.uncapitalize(parameter.getAlias())));
        } else if (conditionType == ConditionType.IsNull || conditionType == ConditionType.IsNotNull
                || conditionType == ConditionType.And || conditionType == ConditionType.Or
                || conditionType == ConditionType.Not || conditionType == ConditionType.LeftBracket
                || conditionType == ConditionType.RightBracket) {
            continue;// is null、is not null don't hava param
        } else {
            paramsDeclaration.add(String.format("%s %s", parameter.getType(), WordUtils.uncapitalize(parameter.getAlias())));
        }
    }
    if (this.paging && this.crud_type.equalsIgnoreCase("select")) {
        paramsDeclaration.add("int pageNo");
        paramsDeclaration.add("int pageSize");
    }
    return StringUtils.join(paramsDeclaration, ", ");
}
 
Example 18
Source Project: oodt   Source File: RSSUtils.java    License: Apache License 2.0 6 votes vote down vote up
public static Element emitRSSTag(RSSTag tag, Metadata prodMet, Document doc,
    Element item) {
  String outputTag = tag.getName();
  if (outputTag.contains(" ")) {
    outputTag = StringUtils.join(WordUtils.capitalizeFully(outputTag).split(
        " "));
  }
  Element rssMetElem = XMLUtils.addNode(doc, item, outputTag);

  // first check if there is a source defined, if so, use that as the value
  if (tag.getSource() != null) {
    rssMetElem.appendChild(doc.createTextNode(StringEscapeUtils.escapeXml(PathUtils.replaceEnvVariables(
        tag.getSource(), prodMet))));
  }

  // check if there are attributes defined, and if so, add to the attributes
  for (RSSTagAttribute attr : tag.getAttrs()) {
    rssMetElem.setAttribute(attr.getName(), PathUtils.replaceEnvVariables(
        attr.getValue(), prodMet));
  }

  return rssMetElem;
}
 
Example 19
Source Project: SonarPet   Source File: PetOwnerListener.java    License: GNU General Public License v3.0 6 votes vote down vote up
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerTeleport(final PlayerTeleportEvent event) {
    final Player p = event.getPlayer();
    final IPet pi = EchoPet.getManager().getPet(p);
    Iterator<IPet> i = EchoPet.getManager().getPets().iterator();
    while (i.hasNext()) {
        IPet pet = i.next();
        if (pet.getEntityPet() instanceof IEntityPacketPet && ((IEntityPacketPet) pet.getEntityPet()).hasInititiated()) {
            if (GeometryUtil.getNearbyEntities(event.getTo(), 50).contains(pet)) {
                ((IEntityPacketPet) pet.getEntityPet()).updatePosition();
            }
        }
    }
    if (pi != null) {
        if (!WorldUtil.allowPets(event.getTo())) {
            Lang.sendTo(p, Lang.PETS_DISABLED_HERE.toString().replace("%world%", WordUtils.capitalizeFully(event.getTo().getWorld().getName())));
            EchoPet.getManager().saveFileData("autosave", pi);
            EchoPet.getSqlManager().saveToDatabase(pi, false);
            EchoPet.getManager().removePet(pi, false);
        }
    }
}
 
Example 20
Source Project: ant-ivy   Source File: HelloConsole.java    License: Apache License 2.0 6 votes vote down vote up
public static void main(String[] args) throws Exception {
    Option msg = Option.builder("m")
        .longOpt("message")
        .hasArg()
        .desc("the message to capitalize")
        .build();
    Options options = new Options();
    options.addOption(msg);

    CommandLineParser parser = new DefaultParser();
    CommandLine line = parser.parse(options, args);

    String  message = line.getOptionValue("m", "Hello Ivy!");
    System.out.println("standard message : " + message);
    System.out.println("capitalized by " + WordUtils.class.getName()
        + " : " + WordUtils.capitalizeFully(message));
}
 
Example 21
Source Project: das   Source File: GenUtils.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 组建最基本的VelocityContext
 *
 * @return
 */
public static VelocityContext buildDefaultVelocityContext() {
    VelocityContext context = new VelocityContext();
    context.put("WordUtils", WordUtils.class);
    context.put("StringUtils", StringUtils.class);
    context.put("helper", VelocityHelper.class);

    return context;
}
 
Example 22
Source Project: das   Source File: JavaParameterHost.java    License: Apache License 2.0 5 votes vote down vote up
public String getCapitalizedName() {
    String tempName = name.replace("@", "");
    // if (tempName.contains("_")) {
    // tempName = WordUtils.capitalizeFully(tempName.replace('_', ' ')).replace(" ", "");
    // }
    return WordUtils.capitalize(tempName);
}
 
Example 23
Source Project: das   Source File: JavaParameterHost.java    License: Apache License 2.0 5 votes vote down vote up
public String getCamelCaseCapitalizedName() {
    String temp = name.replace("@", "");
    if (temp.contains("_")) {
        temp = WordUtils.capitalizeFully(temp.replace('_', ' ')).replace(" ", "");
    }
    return WordUtils.capitalize(temp);
}
 
Example 24
Source Project: das   Source File: JavaParameterHost.java    License: Apache License 2.0 5 votes vote down vote up
public String getUncapitalizedName() {
    String tempName = name.replace("@", "");
    // if (tempName.contains("_")) {
    // tempName = WordUtils.capitalizeFully(tempName.replace('_', ' ')).replace(" ", "");
    // }
    return WordUtils.uncapitalize(tempName);
}
 
Example 25
Source Project: das   Source File: JavaParameterHost.java    License: Apache License 2.0 5 votes vote down vote up
public String getCamelCaseUncapitalizedName() {
    String temp = name.replace("@", "");
    temp = WordUtils.capitalizeFully(temp);
    if (temp.contains("_")) {
        temp = WordUtils.capitalizeFully(temp.replace('_', ' ')).replace(" ", "");
    }
    return WordUtils.uncapitalize(temp);
}
 
Example 26
Source Project: smart-admin   Source File: CodeGeneratorService.java    License: MIT License 5 votes vote down vote up
/**
 * 表名转 java变量前缀
 *
 * @param tableName
 * @param tablePrefix
 * @return
 */
private String tableName2Var(String tableName, String tablePrefix) {
    if (StringUtils.isNotBlank(tablePrefix)) {
        tableName = tableName.replaceFirst(tablePrefix, "");
    }
    String transName = WordUtils.capitalizeFully(tableName, new char[]{'_'}).replace("_", "");
    return WordUtils.uncapitalize(transName);
}
 
Example 27
Source Project: ant-ivy   Source File: Hello.java    License: Apache License 2.0 5 votes vote down vote up
public static void main(String[] args) {
    String  message = "example world !";
    System.out.println("standard message :" + message);
    System.out.println("capitalized by " + WordUtils.class.getName()
        + " : " + WordUtils.capitalizeFully(message));
    System.out.println("upperCased by " + test.StringUtils.class.getName()
        + " : " + test.StringUtils.upperCase(message));
}
 
Example 28
Source Project: weixin4j   Source File: MaterialComponent.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 新增临时素材
 *
 * @param mediaType 媒体文件类型,分别有图片(image)、语音(voice)、视频(video)和缩略图(thumb)
 * @param file form-data中媒体文件标识,有filename、filelength、content-type等信息
 * @return 上传成功返回素材Id,否则返回null
 * @throws org.weixin4j.WeixinException 微信操作异常
 * @since 0.1.4
 */
public Media upload(MediaType mediaType, File file) throws WeixinException {
    //创建请求对象
    HttpsClient http = new HttpsClient();
    //上传素材,返回JSON数据包
    String jsonStr = http.uploadHttps("https://api.weixin.qq.com/cgi-bin/media/upload?access_token=" + weixin.getToken().getAccess_token() + "&type=" + mediaType.toString(), file);
    JSONObject jsonObj = JSONObject.parseObject(jsonStr);
    if (jsonObj != null) {
        if (Configuration.isDebug()) {
            System.out.println("新增临时素材返回json:" + jsonObj.toString());
        }
        Object errcode = jsonObj.get("errcode");
        if (errcode != null && !errcode.toString().equals("0")) {
            //返回异常信息
            throw new WeixinException(getCause(jsonObj.getIntValue("errcode")));
        } else {
            //转换为Media对象
            Media media = new Media();
            media.setMediaType(MediaType.valueOf(WordUtils.capitalize(jsonObj.getString("type"))));
            media.setMediaId(jsonObj.getString("media_id"));
            //转换为毫秒数
            long time = jsonObj.getLongValue("created_at") * 1000L;
            media.setCreatedAt(new Date(time));
            //返回多媒体文件id
            return media;
        }
    }
    return null;
}
 
Example 29
Source Project: code-generator   Source File: Column.java    License: MIT License 5 votes vote down vote up
public void setColumnName(String columnName) {
    this.columnName = columnName;
    if (this.columnName != null) {
        this.uppercaseAttributeName = WordUtils.capitalizeFully(this.columnName.toLowerCase(), new char[]{'_'})
                .replace("_", "");
        this.attributeName = StringUtils.uncapitalize(this.uppercaseAttributeName);
    }
}
 
Example 30
Source Project: java-study   Source File: CommonsTest.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 其他的测试
 */
private static void otherTest(){
	System.out.println("十位数字随机数:"+RandomStringUtils.randomNumeric(10)); //0534110685
	System.out.println("十位字母随机数:"+RandomStringUtils.randomAlphabetic(10)); //jLWiHdQhHg
	System.out.println("十位ASCII随机数:"+RandomStringUtils.randomAscii(10));  //8&[bxy%h_-
	String str="hello world,why are you so happy";
	System.out.println("首字符大写:"+WordUtils.capitalize(str));  //:Hello World,why Are You So Happy
}