Questions tagged [apache-commons-lang]

The standard Java libraries fail to provide enough methods for manipulation of its core classes. Apache Commons Lang provides these extra methods.

Apache Commons Lang provides a host of helper utilities for the java.lang API, notably string manipulation methods, basic numerical methods, object reflection, concurrency, creation and serialization and System properties. Additionally it contains basic enhancements to java.util.Date and a series of utilities dedicated to help with building methods, such as hashCode(), toString() and equals().

Note that Lang 3.0 (and subsequent versions) use a different package (org.apache.commons.lang3) than the previous versions (org.apache.commons.lang), allowing it to be used at the same time as an earlier version.

Official Website: http://commons.apache.org/lang/

Useful Links:

Related Tags:

76 questions
1
vote
2 answers

Grabbing a non-english character in jexcelapi

I have an excel sheet with some non-english characters in it and when I try to grab the contents via sheet.getColumn(column)[row].getContents() It returns the string with the replacement character \uFFFD instead of the non-english character which…
buddyp450
  • 601
  • 1
  • 10
  • 26
1
vote
3 answers

NoClassDefFoundError when project imported to Eclipse?

I am working on an app which uses Commonslang.jar libraries. I was trying to setup it on a new system with newly installed Eclipse.The project is not showing any error But when I run the project it force closes with NoClassDefFoundError at each…
Navdroid
  • 3,851
  • 7
  • 26
  • 47
0
votes
1 answer

if an attribute is not present in map, How to replace the values in template string using strsubsitutor as null or empty string

I have a string String templateString = "The ${animal} jumps over the ${target}."; valuesMap.put("animal", "quick brown fox"); StrSubstitutor sub = new StrSubstitutor(valuesMap); String resolvedString = sub.replace(templateString); But there is no…
0
votes
3 answers

Why apache commons lang is "lang", does lang stand for language?

I use apache commons lang lib as my favorite 3rd party lib for many years, but I don't really understand what's the meaning of "lang" in its name. Yesterday I thought I need another try. I tried googling for some time and read through all its…
0
votes
1 answer

How do I set the format of toString methods with ToStringBuilder in commons-lang?

how do I configure the setting of the format for toString
flybywire
  • 232,954
  • 184
  • 384
  • 491
0
votes
1 answer

Escape XML using stringutils commons.lang version3 apply on writer

In the older version of "org.apache.commons.lang"(2.6) StringEscapeUtils, there is a method to escapexml by passing an instance of "java.io.Writer" as one of the parameter. eg: escapeXml(Writer writer, String str) But, in newer version 3…
0
votes
1 answer

Mule - Updating third party library in runtime

I'm using Mule Server 3.8 EE which brings commons-lang 2.4 with it. A third-party library in my project needs commons-lang 2.6, because it uses a method that was introduced in this version. So when I just start my application, I get a…
Erik P
  • 278
  • 2
  • 13
0
votes
2 answers

Using Apache SystemUtils Java

I am trying to use the Apache Java library SystemUtils to determine the operating system being used. Here is a link: https://commons.apache.org/proper/commons-lang/download_lang.cgi I am using netbeans to create my application. I can not figure out…
RailsSon
  • 17,439
  • 31
  • 80
  • 104
0
votes
0 answers

JavaFX Null Pointer Exception When Populating ListView From A Website

I am trying to dynamically populate a ListView with strings gathered from a website that are within certain tags. The following code uses Apache Commons lang and Apache Commons IO to firstly go to the website and then use a for loop to put the text…
0
votes
1 answer

GAE throws AccessControlException by TimedSemaphore

I'm using Google App Engine (Java) and my war has to use TimedSemaphore to control resources within specific time period but GAE throws well-known exceptions due to accessed to disallowed API as follows. java.security.AccessControlException: access…
pot8os
  • 1
  • 2
0
votes
1 answer

Is it bad for performance to use ToStringBuilder.reflectionToString() in my Android project?

I've read that reflection can cause performance issues on Android, so I'm wondering if using the ToStringBuilder.reflectionToString() method would be a bad thing.
Caren
  • 1,218
  • 2
  • 13
  • 21
0
votes
4 answers

StringEscapeUtils cannot be resolved

I am currently attempting to access a code designed by another programmer in my company. My job is to take his code from the jar he designed and make it easier to use for those who are less technologically savvy. The first time I tried to run the…
0
votes
1 answer

How to change a Date based on time-only input and account for time zone and DST?

I need to create a new Java Date based on two strings provided by a user: a date (e.g. "1.1.2015"), and a time of day (e.g. "23:00"). First the user enters the date, which is sent to the server and parsed into a Date (time of day is set to midnight…
Markus Yrjölä
  • 747
  • 1
  • 9
  • 22
0
votes
0 answers

Calculate the Date breakdown without Joda

I am using SimpleDateFormat to get the difference between two Dates and with the new Date I am trying to break that down into days, hours, minutes, seconds, ms without using Joda libraries. I am able to use the apache commons-lang library which…
0
votes
2 answers

apache.commons.lang3.DateUtils.setMonths with December

I am facing very strange issue.. Here is the code, which generates a new Date object: Date result = DateUtils.setYears(new Date(), year); result = DateUtils.setMonths(result, month); return DateUtils.setDays(result, day); If I pass any value for…
nKognito
  • 5,946
  • 16
  • 67
  • 131