In this package are all main/core classes for the SOJO framework.
The possible property types, that are supported by a JavaBean (and SOJO) can be broken into three groups:
- Simple (Constants.TYPE_SIMPLE): Simple properties are such as int, long, double (primitive data types) or a simple object
(such as a java.lang.String, java.lang.Long, java.uilt.Date and so on). The net.sf.sojo.core.reflect.ReflectionHelper
is to be responsible for define classes, which are simple (can get with method isSimpleType).
With the method addSimpleType can add more types at runtime.
- Iterateable (Constants.TYPE_ITERATEABLE): An Iterateable property stores a collection of objects that can be accessed
by an integer-valued (index, non-negative) or by an iterator.
Interfaces for this category are java.util.List, java.util.Set or the super interface java.util.Collection.
An Iterateable property can be also an array.
- Map (Constants.TYPE_MAP):A Map property is a property with a implementation from the java interface java.util.Map.
The elements are composite key-value pairs. You can set and retrieve individual values via a key.
The outcome of this categories of JavaBeans-properties are kinds of conversion. The main classes for conversions are
the Java interface net.sf.sojo.core.Conversion respectively the abstract implementation net.sf.sojo.core.AbstractConversion.
The first extensions are net.sf.sojo.core.SimpleConversion and net.sf.sojo.core.ConversionIterator.
The net.sf.sojo.core.ConversionIterator is splitting in net.sf.sojo.core.ComplexConversion and
net.sf.sojo.core.IterateableConversion.
For different kind of properties (category) exist different kind of strategies for conversions:
- SimpleConversion: Convert a simple to a simple type. A example is the transformation from String to Long.
For this problem you can use the:net.sf.sojo.core.conversion.Simple2SimpleConversion
- ConversionIterator: is splitting in sub classes:
- IterateableConversion: This category is equivalent to JavaBean category iterateable. Conversions implementations are:
net.sf.sojo.core.conversion.Iterateable2IterateableConversion or net.sf.sojo.core.conversion.IterateableMap2MapConversion
or net.sf.sojo.core.conversion.IterateableMap2BeanConversion
- ComplexConversion: This category is equivalent to JavaBean category map. Conversions implementations are:
net.sf.sojo.core.conversion.ComplexBean2MapConversion