Recognised Types

Naked Objects creates an adapter for every domain object. There are three categories of objects that are recognised: value, reference and collection. Value and collection objects are dealt with on a class by class basis, while all reference objects are dealt with in the same way where the properties are seen as fields, and public methods as actions. Listed below are all the recognised types.

Value objects

The following are built-in types. In addition to these any type either annotated using @Value, or registered as a value type using nakedobjects.properties, will also be treated as a value type.

Primitive types

  • boolean
  • byte
  • char
  • double
  • float
  • int
  • long
  • short

Number classes

  • java.lang.Boolean
  • java.math.BigInteger
  • java.math.BigDecimal
  • java.lang.Byte
  • java.lang.Character
  • java.lang.Double
  • java.lang.Float
  • java.lang.Integer
  • java.lang.Long
  • java.lang.Short

Java Classes

  • java.lang.String
  • java.util.Date (date and time)
  • java.sql.Date (date only)
  • java.sql.Time (time only)
  • java.sql.Timestamp
  • java.awt.Image

Application Library

  • org.nakedobjects.applib.value.Color
  • org.nakedobjects.applib.value.Date
  • org.nakedobjects.applib.value.DateTime
  • org.nakedobjects.applib.value.Image
  • org.nakedobjects.applib.value.Money
  • org.nakedobjects.applib.value.Password
  • org.nakedobjects.applib.value.Percentage
  • org.nakedobjects.applib.value.Time
  • org.nakedobjects.applib.value.TimeStamp

Collection objects

  • java.util.Collection (usually java.util.ArrayList, java.util.LinkedList, java.util.LinkedHashSet or java.util.TreeSet)
  • arrays

Note that java.util.Map is not supported as a collection type.

Reference objects

  • all other domain classes (not annotated with @Value / registered as a value using nakedobjects.properties).