A data object is a representation of some structured data. It is the fundamental component in the SDO (Service Data Objects) package. Data objects support reflection, path-based accesss, convenience creation and deletion methods, and the ability to be part of a {@link DataGraph data graph}.
Each data object holds its data as a series of {@link Property Properties}. Properties can be accessed by name, property index, or using the property meta object itself. A data object can also contain references to other data objects, through reference-type Properties.
A data object has a series of convenience accessors for its Properties. These methods either use a path (String), a property index, or the {@link Property property's meta object} itself, to identify the property.Some examples of the path-based accessors are as follows:
DataObject company = ...; company.get("name"); is the same as company.get(company.getType().getProperty("name")) company.set("name", "acme"); company.get("department.0/name") is the same as ((DataObject)((List)company.get("department")).get(0)).get("name") .n indexes from 0 ... implies the name property of the first department company.get("department[1]/name") [] indexes from 1 ... implies the name property of the first department company.get("department[number=123]") returns the first department where number=123 company.get("..") returns the containing data object company.get("/") returns the root containing data object
There are general accessors for Properties, i.e., {@link #get(Property) get} and {@link #set(Property,Object) set}, as well as specific accessors for the primitive types and commonly used data types like String, Date, List, BigInteger, and BigDecimal.