MetaModelService

This service provides a formal API into the framework’s metamodel.

API

MetaModelService.java
interface MetaModelService {
  Optional<LogicalType> lookupLogicalTypeByName(String logicalTypeName)     (1)
  Can<LogicalType> logicalTypeAndAliasesFor(LogicalType logicalType)     (2)
  Can<LogicalType> logicalTypeAndAliasesFor(String logicalTypeName)     (3)
  Optional<LogicalType> lookupLogicalTypeByClass(Class<?> domainType)     (4)
  void rebuild(Class<?> domainType)     (5)
  DomainModel getDomainModel()     (6)
  BeanSort sortOf(Class<?> domainType, Mode mode)     (7)
  BeanSort sortOf(Bookmark bookmark, Mode mode)     (8)
  CommandDtoProcessor commandDtoProcessorFor(String logicalMemberIdentifier)     (9)
  MetamodelDto exportMetaModel(Config config)     (10)
  ObjectGraph exportObjectGraph(BiPredicate<BeanSort, LogicalType> filter)     (11)
  Stream<Identifier> streamActions(Class<?> domainType)     (12)
  Stream<Identifier> streamProperties(Class<?> domainType)     (13)
  Stream<Identifier> streamCollections(Class<?> domainType)     (14)
  Stream<Identifier> streamTypeHierarchy(Class<?> domainType)     (15)
  Stream<Identifier> parentedAssociationsForColumnRendering(Object parentDomainObject, Identifier collectionId, AssociationsLookup lookup)     (16)
  Stream<Identifier> standaloneAssociationsForColumnRendering(LogicalType logicalType, AssociationsLookup lookup)     (17)
  void patchColumnOrder(Identifier identifier, Can<String> columnsInOrder)     (18)
}
1 lookupLogicalTypeByName(String)

Provides a lookup by logicalTypeName of a domain class' object type, corresponding to Named#value() or DomainService#aliased() or DomainObject#aliased() . Will return an empty result if there is no such non-abstract class registered. (interfaces and abstract types are never added to the lookup table).

2 logicalTypeAndAliasesFor(LogicalType)

Assuming that the LogicalType passed in actually represents a domain type, then returns it along with any aliases defined as per DomainService#aliased() or DomainObject#aliased() .

3 logicalTypeAndAliasesFor(String)

Returns the LogicalType of a domain class' object type, corresponding to Named#value() , along with any aliases defined as per DomainService#aliased() or DomainObject#aliased() .

4 lookupLogicalTypeByClass(Class)

Provides a lookup by class of a domain class' object type,corresponding to Named#value() or DomainService#aliased() or DomainObject#aliased() .

5 rebuild(Class)

Invalidates and rebuilds the internal metadata for the specified domain type.

6 getDomainModel()

Returns a list of representations of each of member of each domain class.

7 sortOf(Class, Mode)

What sort of object the domain type represents.

8 sortOf(Bookmark, Mode)

Override of #sortOf(Class, Mode) , extracting the domain type from the provided Bookmark of a domain object instance.

9 commandDtoProcessorFor(String)

Obtains the implementation of CommandDtoProcessor (if any) as per Action#commandDtoProcessor() or Property#commandDtoProcessor() .

10 exportMetaModel(Config)

Exports the entire metamodel as a DTO, serializable into XML using JAXB.

11 exportObjectGraph(BiPredicate)

Can be used to create object relation diagrams (e.g. Plantuml).

12 streamActions(Class)

Stream of Identifier representing the Actions of given domainType, including mixed-in ones, but excluding Actions , that are only available for PROTOTYPING.

13 streamProperties(Class)

Stream of Identifier representing the Properties of given domainType, including mixed-in ones.

14 streamCollections(Class)

Stream of Identifier representing the Collections of given domainType, including mixed-in ones.

15 streamTypeHierarchy(Class)

Stream of Identifier representing the type hierarchy of given domainType, starting at given domainType, going 'up' in the hierarchy, but excluding Object .

16 parentedAssociationsForColumnRendering(Object, Identifier, AssociationsLookup)

Stream of Identifier representing the Columns for specified PARENTED collection.

17 standaloneAssociationsForColumnRendering(LogicalType, AssociationsLookup)

Stream of Identifier representing the Columns for specified STANDALONE collection.

18 patchColumnOrder(Identifier, Can)

Members

lookupLogicalTypeByName(String)

Provides a lookup by logicalTypeName of a domain class' object type, corresponding to Named#value() or DomainService#aliased() or DomainObject#aliased() . Will return an empty result if there is no such non-abstract class registered. (interfaces and abstract types are never added to the lookup table).

logicalTypeAndAliasesFor(LogicalType)

Assuming that the LogicalType passed in actually represents a domain type, then returns it along with any aliases defined as per DomainService#aliased() or DomainObject#aliased() .

If there is no such domain type, then an empty Can will be returned.

logicalTypeAndAliasesFor(String)

Returns the LogicalType of a domain class' object type, corresponding to Named#value() , along with any aliases defined as per DomainService#aliased() or DomainObject#aliased() .

If there is no such domain type, then an empty Can will be returned.

lookupLogicalTypeByClass(Class)

Provides a lookup by class of a domain class' object type,corresponding to Named#value() or DomainService#aliased() or DomainObject#aliased() .

rebuild(Class)

Invalidates and rebuilds the internal metadata for the specified domain type.

getDomainModel()

Returns a list of representations of each of member of each domain class.

Used by MetaModelServiceMenu to return a downloadable CSV.

Note that MetaModelService#exportMetaModel(Config) provides a superset of the functionality provided by this method.

sortOf(Class, Mode)

What sort of object the domain type represents.

sortOf(Bookmark, Mode)

Override of #sortOf(Class, Mode) , extracting the domain type from the provided Bookmark of a domain object instance.

commandDtoProcessorFor(String)

Obtains the implementation of CommandDtoProcessor (if any) as per Action#commandDtoProcessor() or Property#commandDtoProcessor() .

This is used by framework-provided implementations of org.apache.causeway.applib.services.conmap.ContentMappingService .

exportMetaModel(Config)

Exports the entire metamodel as a DTO, serializable into XML using JAXB.

The Config parameter can be used to restrict/filter the export to some subset of the metamodel; in particular to specific Config#getNamespacePrefixes() namespace prefixes .

exportObjectGraph(BiPredicate)

Can be used to create object relation diagrams (e.g. Plantuml).

streamActions(Class)

Stream of Identifier representing the Actions of given domainType, including mixed-in ones, but excluding Actions , that are only available for PROTOTYPING.

streamProperties(Class)

Stream of Identifier representing the Properties of given domainType, including mixed-in ones.

streamCollections(Class)

Stream of Identifier representing the Collections of given domainType, including mixed-in ones.

streamTypeHierarchy(Class)

Stream of Identifier representing the type hierarchy of given domainType, starting at given domainType, going 'up' in the hierarchy, but excluding Object .

Included are all types in the hierarchy, that are recognized by the Metamodel, recognized Interfaces last.

parentedAssociationsForColumnRendering(Object, Identifier, AssociationsLookup)

Stream of Identifier representing the Columns for specified PARENTED collection.

Columns returned are those that are either in principle AVAILABLE or currently ENABLED, based on given AssociationsLookup .

The availability lookup returns Identifier (s) in no particular order, whereas the enablement lookup returns them in same order as rendered.

If parentDomainObject is null returns an empty Stream .

standaloneAssociationsForColumnRendering(LogicalType, AssociationsLookup)

Stream of Identifier representing the Columns for specified STANDALONE collection.

Columns returned are those that are either in principle AVAILABLE or currently ENABLED, based on given AssociationsLookup .

The availability lookup returns Identifier (s) in no particular order, whereas the enablement lookup returns them in same order as rendered.

patchColumnOrder(Identifier, Can)

Implementation

The Core Metamodel module provides a default implementation of this service, MetaModelServiceDefault (record).

See also