ManagedObject

Represents an instance of some element of the meta-model recognized by the framework, that is Spring managed beans, persistence-stack provided entities, view-models, mixins or instances of value types.

API

ManagedObject.java
interface ManagedObject {
  Specialization specialization()     (1)
  Specialization.BookmarkPolicy getBookmarkPolicy()
  ObjectSpecification objSpec()     (2)
  Object getPojo()     (3)
  EntityState getEntityState()
  String getTitle()     (4)
  ObjectIcon getIcon(IconSize iconSize)     (5)
  Either<ManagedObject, ManagedObject> asEitherWithOrWithoutMemoizedBookmark()
  ManagedObject unspecified()     (6)
  ManagedObject empty(ObjectSpecification spec)     (7)
  ManagedObject value(ObjectSpecification spec, Object pojo)     (8)
  ManagedObject service(ObjectSpecification spec, Object pojo)     (9)
  ManagedObject viewmodel(ObjectSpecification spec, Object pojo, Optional<Bookmark> bookmarkIfKnown)     (10)
  ManagedObject entity(ObjectSpecification spec, Object pojo, Optional<Bookmark> bookmarkIfKnown)     (11)
  ManagedObject entityBookmarked(ObjectSpecification spec, Object pojo, Bookmark bookmark)
  ManagedObject entityTransient(ObjectSpecification spec, Object pojo)
  ManagedObject mixin(ObjectSpecification spec, Object pojo)     (12)
  ManagedObject other(ObjectSpecification spec, Object pojo)     (13)
  PackedManagedObject packed(ObjectSpecification elementSpec, Can<ManagedObject> nonScalar)     (14)
  ManagedObject adaptSingular(SpecificationLoader specLoader, Object pojo)     (15)
  ManagedObject adaptSingular(ObjectSpecification guess, Object pojo)
  ManagedObject adaptProperty(OneToOneAssociation oneToOneAssociation, Object pojo)
  ManagedObject adaptParameter(ObjectActionParameter param, Object paramValue)
  Can<ManagedObject> adaptParameters(Can<ObjectActionParameter> objectActionParameters, List<Object> args)
  ManagedObject bookmarked(ObjectSpecification spec, Object pojo, Bookmark bookmark)     (16)
  ManagedObject adaptSingularInternal(ObjectSpecification guess, Object pojo, Optional<Bookmark> bookmarkIfAny)     (17)
}
1 specialization()

Returns the specific Specialization this ManagedObject implements, which governs this object’s behavior.

2 objSpec()

Returns the specification that details the structure (meta-model) of this object.

3 getPojo()

Returns the adapted domain object, the 'plain old java' object this managed object represents with the framework.

4 getTitle()

The (untranslated) title of the wrapped pojo.

5 getIcon(IconSize)

Domain Objects may either have an icon corresponding to an icon resource, or they use a font awesome icon.

6 unspecified()

Factory for Specialization#UNSPECIFIED.

7 empty(ObjectSpecification)

EMPTY

8 value(ObjectSpecification, Object)

VALUE

9 service(ObjectSpecification, Object)

SERVICE

10 viewmodel(ObjectSpecification, Object, Optional)

VIEWMODEL

11 entity(ObjectSpecification, Object, Optional)

ENTITY

12 mixin(ObjectSpecification, Object)

MIXIN

13 other(ObjectSpecification, Object)

OTHER

14 packed(ObjectSpecification, Can)

PACKED

15 adaptSingular(SpecificationLoader, Object)

For cases, when the pojo’s specification is not available and needs to be looked up.

16 bookmarked(ObjectSpecification, Object, Bookmark)

Optimized for cases, when the pojo’s specification and bookmark are already available.

17 adaptSingularInternal(ObjectSpecification, Object, Optional)

spec and pojo don’t need to be strictly in sync, we adapt if required

Members

specialization()

Returns the specific Specialization this ManagedObject implements, which governs this object’s behavior.

objSpec()

Returns the specification that details the structure (meta-model) of this object.

getPojo()

Returns the adapted domain object, the 'plain old java' object this managed object represents with the framework.

getTitle()

The (untranslated) title of the wrapped pojo.

getIcon(IconSize)

Domain Objects may either have an icon corresponding to an icon resource, or they use a font awesome icon.

unspecified()

Factory for Specialization#UNSPECIFIED.

empty(ObjectSpecification)

EMPTY

value(ObjectSpecification, Object)

VALUE

service(ObjectSpecification, Object)

SERVICE

viewmodel(ObjectSpecification, Object, Optional)

VIEWMODEL

entity(ObjectSpecification, Object, Optional)

ENTITY

mixin(ObjectSpecification, Object)

MIXIN

other(ObjectSpecification, Object)

OTHER

packed(ObjectSpecification, Can)

PACKED

adaptSingular(SpecificationLoader, Object)

For cases, when the pojo’s specification is not available and needs to be looked up.

Fails if the pojo is not a singular (eg. collection).

bookmarked(ObjectSpecification, Object, Bookmark)

Optimized for cases, when the pojo’s specification and bookmark are already available.

adaptSingularInternal(ObjectSpecification, Object, Optional)

spec and pojo don’t need to be strictly in sync, we adapt if required