SupportWriter space ↗
A JOURNAL ABOUT TECHNOLOGY

Learn something new.
Write. Share.

A space to connect knowledge, one line of code a day.
Discover tutorials, ideas, and notes from a learning journey.

1967 notes & counting ↙
FOR YOUR CURIOSITY

Latest notes.

APACHE COMMONS / NOTES</>↗
Apache Commons08 Nov 2007

How do I determine bean’s property type?

Using the PropertyUtils.getPropertyType() we can determine the bean property type. This method return a Class object of bean’s property type. package org.kodejava.commons.beanutils; import org.apache.commons.beanutils.PropertyUtils; import org.kodejava.commons.beanutils.support.Record; public class PropertyType { public static void main(String[] args) { Record record = new Record(); record.setTitle("Magical Mystery Tour"); try { /* * Using PropertyUtils.getPropertyType() to d...

Wayan · 2 min read
APACHE COMMONS / NOTES</>↗
Apache Commons03 Nov 2007

How do I read mapped bean’s property value?

In this example you’ll see how to read mapped property value of a bean. We use PropertyUtils.getMappedProperty() method the read the mapped property of the Record object that consist of Track objects. package org.kodejava.commons.beanutils; import org.apache.commons.beanutils.PropertyUtils; import org.kodejava.commons.beanutils.support.Track; import org.kodejava.commons.beanutils.support.Record; import java.util.HashMap; import java.util.Map; public class ReadMapProperty { pu...

Wayan · 2 min read
APACHE COMMONS / NOTES</>↗
Apache Commons31 Oct 2007

How do I read indexed bean’s property value?

In this example you’ll see how to read an indexed property of an object such as List or array. Using the PropertyUtils.getIndexedProperty() method we can do it easily. This method take the bean and the name of indexed property including the element to be read. Let’s see the example below for more details. package org.kodejava.commons.beanutils; […]

Wayan · 2 min read
APACHE COMMONS / NOTES</>↗
Apache Commons27 Oct 2007

How do I read bean’s nested property value?

In this example you’ll see how to read bean’s nested property, we’ll use PropertyUtils.getNestedProperty() method. To test we will create three classes, Track and Artist for our beans and ReadNestedProperty as a main program to run. The Track class will contain a property of an Artist object. Using the PropertyUtils.getNestedProperty() method we want to get […]

Wayan · 2 min read
APACHE COMMONS / NOTES</>↗
Apache Commons27 Oct 2007

How do I read bean’s property value?

In this example we will learn how to use PropertyUtils.getSimpleProperty() method to read bean’s property value. To test this method we will create a simple class called Track for our bean. The Track class have some properties such as id, title and duration. The PropertyUtils.getSimpleProperty() reads our bean property by accessing the bean’s getter method. […]

Wayan · 2 min read
APACHE COMMONS / NOTES</>↗
Apache Commons24 Oct 2007

How do I find text between two strings?

In this example we’ll use the StringUtils.substringBetween() method. Here we’ll extract the title and body of our HTML document. Let’s see the code. package org.kodejava.commons.lang; import java.util.Date; import org.apache.commons.lang3.StringUtils; public class NestedString { public static void main(String[] args) { String helloHtml = "<html>" + "<head>" + " <title>Hello World from Java</title>" + "<body>" + "Hello, […]

Wayan · 1 min read
✳

Knowledge grows when shared.

Stay curious. There is always something new to learn.

Explore notes ↗
Putu Adi Guna Permana
ABOUT THE AUTHOR

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Writer and founder of Diary Coding — sharing notes, tutorials, and experiences about programming for anyone who wants to keep learning.