MetaModelService

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

API

MetaModelService.java
interface MetaModelService {
  Optional<LogicalType> lookupLogicalTypeByName(String logicalTypeName)     (1)
  Optional<LogicalType> lookupLogicalTypeByClass(Class<?> domainType)     (2)
  void rebuild(Class<?> domainType)     (3)
  DomainModel getDomainModel()     (4)
  BeanSort sortOf(Class<?> domainType, Mode mode)     (5)
  BeanSort sortOf(Bookmark bookmark, Mode mode)     (6)
  CommandDtoProcessor commandDtoProcessorFor(String logicalMemberIdentifier)     (7)
  MetamodelDto exportMetaModel(Config config)     (8)
}
1 lookupLogicalTypeByName(String)

Provides a lookup by logicalTypeName of a domain class' object type, as defined by DomainObject#logicalTypeName() (or any other mechanism that corresponds to Causeway' ObjectTypeFacet ). 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 lookupLogicalTypeByClass(Class)

Provides a lookup by class of a domain class' object type, as defined by DomainObject#logicalTypeName() (or any other mechanism that corresponds to Causeway' ObjectTypeFacet ).

3 rebuild(Class)

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

4 getDomainModel()

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

5 sortOf(Class, Mode)

What sort of object the domain type represents.

6 sortOf(Bookmark, Mode)

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

7 commandDtoProcessorFor(String)

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

8 exportMetaModel(Config)

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

Members

lookupLogicalTypeByName(String)

Provides a lookup by logicalTypeName of a domain class' object type, as defined by DomainObject#logicalTypeName() (or any other mechanism that corresponds to Causeway' ObjectTypeFacet ). 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).

lookupLogicalTypeByClass(Class)

Provides a lookup by class of a domain class' object type, as defined by DomainObject#logicalTypeName() (or any other mechanism that corresponds to Causeway' ObjectTypeFacet ).

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 .

Implementation

The framework provides a default implementation of this service, o.a.i.core.metamodel.services.metamodel.MetaModelServiceDefault.

See also