Top Description Constructors Methods
org.osgi.dto

public abstract Class DTO

extends Object
Class Inheritance
Known Direct Subclasses
org.osgi.framework.dto.BundleDTO, org.osgi.framework.dto.FrameworkDTO, org.osgi.framework.dto.ServiceReferenceDTO, org.osgi.framework.startlevel.dto.BundleStartLevelDTO, org.osgi.framework.startlevel.dto.FrameworkStartLevelDTO, org.osgi.framework.wiring.dto.BundleWiringDTO, org.osgi.resource.dto.CapabilityDTO, org.osgi.resource.dto.CapabilityRefDTO, org.osgi.resource.dto.RequirementDTO, org.osgi.resource.dto.RequirementRefDTO, org.osgi.resource.dto.ResourceDTO, org.osgi.resource.dto.WireDTO, org.osgi.resource.dto.WiringDTO
Imports
java.lang.reflect.Array, .Field, .Modifier, java.util.IdentityHashMap, .List, .Map, .Set

Super type for Data Transfer Objects.

A Data Transfer Object (DTO) is easily serializable having only public fields of primitive types and their wrapper classes, Strings, and DTOs. List, Set, Map and array aggregates may also be used. The aggregates must only hold objects of the listed types or aggregates.

The object graph from a Data Transfer Object must be a tree to simplify serialization and deserialization.

Author
$Id: adaf574b3fb54fee6daf068749c2a2ba818e16a5 $

Constructor Summary

AccessConstructor and Description
public
DTO()

Method Summary

Modifier and TypeMethod and Description
private static StringBuilder

Returns:

The specified StringBuilder.
appendArray
(final StringBuilder
StringBuilder to which the string representation is appended.
result
,
final Map<Object, String>
References to "seen" objects.
objectRefs
,
final String
The reference path of the specified array.
refpath
,
final Object
The array whose string representation is to be appended.
array
)

Append the specified array's string representation to the specified StringBuilder.

private static StringBuilder

Returns:

The specified StringBuilder.
appendDTO
(final StringBuilder
StringBuilder to which the string representation is appended.
result
,
final Map<Object, String>
References to "seen" objects.
objectRefs
,
final String
The reference path of the specified DTO.
refpath
,
final DTO
The DTO whose string representation is to be appended.
dto
)

Append the specified DTO's string representation to the specified StringBuilder.

private static StringBuilder

Returns:

The specified StringBuilder.
appendIterable
(final StringBuilder
StringBuilder to which the string representation is appended.
result
,
final Map<Object, String>
References to "seen" objects.
objectRefs
,
final String
The reference path of the specified list.
refpath
,
final Iterable<?>
The iterable whose string representation is to be appended.
iterable
)

Append the specified iterable's string representation to the specified StringBuilder.

private static StringBuilder

Returns:

The specified StringBuilder.
appendMap
(final StringBuilder
StringBuilder to which the string representation is appended.
result
,
final Map<Object, String>
References to "seen" objects.
objectRefs
,
final String
The reference path of the specified map.
refpath
,
final Map<?, ?>
The map whose string representation is to be appended.
map
)

Append the specified map's string representation to the specified StringBuilder.

private static StringBuilder

Returns:

The specified StringBuilder.
appendString
(final StringBuilder
StringBuilder to which the string is appended.
result
,
final CharSequence
The string to be appended.
string
)

Append the specified string to the specified StringBuilder.

private static StringBuilder

Returns:

The specified StringBuilder.
appendValue
(final StringBuilder
StringBuilder to which the string representation is appended.
result
,
final Map<Object, String>
References to "seen" objects.
objectRefs
,
final String
The reference path of the specified value.
refpath
,
final Object
The object whose string representation is to be appended.
value
)

Append the specified value's string representation to the specified StringBuilder.

private static CharSequence

Returns:

The string compressed, if necessary.
compress
(final CharSequence
The string to potentially compress.
in
)

Compress, in length, the specified string.

public String

Returns:

A string representation of this DTO suitable for use when debugging.
toString
()

Overrides java.lang.Object.toString.

Return a string representation of this DTO suitable for use when debugging.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Constructor Detail

DTOback to summary
public DTO()

Method Detail

appendArrayback to summary
private static StringBuilder appendArray(final StringBuilder result, final Map<Object, String> objectRefs, final String refpath, final Object array)

Append the specified array's string representation to the specified StringBuilder.

Parameters
result:StringBuilder

StringBuilder to which the string representation is appended.

objectRefs:Map<Object, String>

References to "seen" objects.

refpath:String

The reference path of the specified array.

array:Object

The array whose string representation is to be appended.

Returns:StringBuilder

The specified StringBuilder.

appendDTOback to summary
private static StringBuilder appendDTO(final StringBuilder result, final Map<Object, String> objectRefs, final String refpath, final DTO dto)

Append the specified DTO's string representation to the specified StringBuilder.

Parameters
result:StringBuilder

StringBuilder to which the string representation is appended.

objectRefs:Map<Object, String>

References to "seen" objects.

refpath:String

The reference path of the specified DTO.

dto:DTO

The DTO whose string representation is to be appended.

Returns:StringBuilder

The specified StringBuilder.

appendIterableback to summary
private static StringBuilder appendIterable(final StringBuilder result, final Map<Object, String> objectRefs, final String refpath, final Iterable<?> iterable)

Append the specified iterable's string representation to the specified StringBuilder.

Parameters
result:StringBuilder

StringBuilder to which the string representation is appended.

objectRefs:Map<Object, String>

References to "seen" objects.

refpath:String

The reference path of the specified list.

iterable:Iterable<?>

The iterable whose string representation is to be appended.

Returns:StringBuilder

The specified StringBuilder.

appendMapback to summary
private static StringBuilder appendMap(final StringBuilder result, final Map<Object, String> objectRefs, final String refpath, final Map<?, ?> map)

Append the specified map's string representation to the specified StringBuilder.

Parameters
result:StringBuilder

StringBuilder to which the string representation is appended.

objectRefs:Map<Object, String>

References to "seen" objects.

refpath:String

The reference path of the specified map.

map:Map<?, ?>

The map whose string representation is to be appended.

Returns:StringBuilder

The specified StringBuilder.

appendStringback to summary
private static StringBuilder appendString(final StringBuilder result, final CharSequence string)

Append the specified string to the specified StringBuilder.

Parameters
result:StringBuilder

StringBuilder to which the string is appended.

string:CharSequence

The string to be appended.

Returns:StringBuilder

The specified StringBuilder.

appendValueback to summary
private static StringBuilder appendValue(final StringBuilder result, final Map<Object, String> objectRefs, final String refpath, final Object value)

Append the specified value's string representation to the specified StringBuilder.

This method handles cycles in the object graph, using path-based references, even though the specification requires the object graph from a DTO to be a tree.

Parameters
result:StringBuilder

StringBuilder to which the string representation is appended.

objectRefs:Map<Object, String>

References to "seen" objects.

refpath:String

The reference path of the specified value.

value:Object

The object whose string representation is to be appended.

Returns:StringBuilder

The specified StringBuilder.

compressback to summary
private static CharSequence compress(final CharSequence in)

Compress, in length, the specified string.

Parameters
in:CharSequence

The string to potentially compress.

Returns:CharSequence

The string compressed, if necessary.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Return a string representation of this DTO suitable for use when debugging.

The format of the string representation is not specified and subject to change.

Returns:String

A string representation of this DTO suitable for use when debugging.

Annotations
@Override