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 getSpecialization()     (1)
  BookmarkPolicy getBookmarkPolicy()
  ObjectSpecification getSpecification()     (2)
  Object getPojo()     (3)
  EntityState getEntityState()
  Supplier<ManagedObject> asSupplier()
  T assertCompliance(T pojo)     (4)
  String getTitle()     (5)
  String getIconName()     (6)
  ObjectIcon getIcon()
  Either<ObjectIcon, FontAwesomeLayers> eitherIconOrFaLayers()     (7)
  Either<ManagedObject, ManagedObject> asEitherWithOrWithoutMemoizedBookmark()
  ManagedObject unspecified()     (8)
  ManagedObject empty(ObjectSpecification spec)     (9)
  ManagedObject value(ObjectSpecification spec, Object pojo)     (10)
  ManagedObject service(ObjectSpecification spec, Object pojo)     (11)
  ManagedObject viewmodel(ObjectSpecification spec, Object pojo, Optional<Bookmark> bookmarkIfKnown)     (12)
  ManagedObject entity(ObjectSpecification spec, Object pojo, Optional<Bookmark> bookmarkIfKnown)     (13)
  ManagedObject entityHypridBookmarked(ObjectSpecification spec, Object pojo, Optional<Bookmark> bookmarkIfKnown)
  ManagedObject entityHybirdTransient(ObjectSpecification spec, Object pojo)
  ManagedObject mixin(ObjectSpecification spec, Object pojo)     (14)
  ManagedObject other(ObjectSpecification spec, Object pojo)     (15)
  PackedManagedObject packed(ObjectSpecification elementSpec, Can<ManagedObject> nonScalar)     (16)
  ManagedObject adaptSingular(SpecificationLoader specLoader, Object pojo)     (17)
  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)     (18)
  ManagedObject adaptSingularInternal(ObjectSpecification guess, Object pojo, Optional<Bookmark> bookmarkIfAny)     (19)
}
1 getSpecialization()

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

2 getSpecification()

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 assertCompliance(T)

Unary operator asserting that pojo and #getSpecification() are compliant with the policies from #getSpecialization() .

5 getTitle()

The (untranslated) title of the wrapped pojo.

6 getIconName()

Returns the name of an icon to use for this object.

7 eitherIconOrFaLayers()

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

8 unspecified()

Factory for Specialization#UNSPECIFIED.

9 empty(ObjectSpecification)

EMPTY

10 value(ObjectSpecification, Object)

VALUE

11 service(ObjectSpecification, Object)

SERVICE

12 viewmodel(ObjectSpecification, Object, Optional)

VIEWMODEL

13 entity(ObjectSpecification, Object, Optional)

ENTITY

14 mixin(ObjectSpecification, Object)

MIXIN

15 other(ObjectSpecification, Object)

OTHER

16 packed(ObjectSpecification, Can)

PACKED

17 adaptSingular(SpecificationLoader, Object)

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

18 bookmarked(ObjectSpecification, Object, Bookmark)

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

19 adaptSingularInternal(ObjectSpecification, Object, Optional)

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

Members

getSpecialization()

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

getSpecification()

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.

assertCompliance(T)

Unary operator asserting that pojo and #getSpecification() are compliant with the policies from #getSpecialization() .

getTitle()

The (untranslated) title of the wrapped pojo.

getIconName()

Returns the name of an icon to use for this object.

May return null if no icon is specified.

eitherIconOrFaLayers()

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