= BeanSort _(enum)_
:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Top level object classification.

== API

[source,java]
.BeanSort.java
----
enum BeanSort {
  VIEW_MODEL     // <.>
  ENTITY     // <.>
  MANAGED_BEAN_CONTRIBUTING     // <.>
  MANAGED_BEAN_NOT_CONTRIBUTING     // <.>
  MIXIN     // <.>
  VALUE     // <.>
  COLLECTION     // <.>
  ABSTRACT     // <.>
  PROGRAMMATIC     // <.>
  VETOED     // <.>
  UNKNOWN
  BeanPolicy policy()
  boolean isManagedBeanContributing()
  boolean isManagedBeanNotContributing()
  boolean isMixin()
  boolean isViewModel()
  boolean isValue()
  boolean isCollection()
  boolean isEntity()
  boolean isAbstract()
  boolean isProgrammatic()
  boolean isVetoed()
  boolean isUnknown()
  boolean isManagedBeanAny()
}
----

<.> xref:#VIEW_MODEL[VIEW_MODEL]
+
--
Stateful object, with a state that can be marshaled and unmarshaled.
--
<.> xref:#ENTITY[ENTITY]
+
--
Persistable object, associated with a persistence layer/context.
--
<.> xref:#MANAGED_BEAN_CONTRIBUTING[MANAGED_BEAN_CONTRIBUTING]
+
--
Injectable object, associated with a lifecycle context (application-scoped, request-scoped, ...).
--
<.> xref:#MANAGED_BEAN_NOT_CONTRIBUTING[MANAGED_BEAN_NOT_CONTRIBUTING]
+
--
Injectable object, associated with a lifecycle context (application-scoped, request-scoped, ...).
--
<.> xref:#MIXIN[MIXIN]
+
--
Object associated with an _entity_ , _viewmodel_ or _domain-service_ to act as contributer of a single _domain-action_ or _domain-property_ or _domain-collection_ .
--
<.> xref:#VALUE[VALUE]
+
--
Immutable, serializable object. Values (including enums) my have object support methods, hence needs introspection.
--
<.> xref:#COLLECTION[COLLECTION]
+
--
Container of objects.
--
<.> xref:#ABSTRACT[ABSTRACT]
+
--
A non concrete type, that is a placeholder for a concrete implementer.
--
<.> xref:#PROGRAMMATIC[PROGRAMMATIC]
+
--
Type must NOT be added to the meta-model, eg. by means of _org.apache.causeway.applib.annotation.Domain.Exclude_ or xref:refguide:applib:index/annotation/Programmatic.adoc[Programmatic] . Consequently the specification-loader should skip introspection of those types.
--
<.> xref:#VETOED[VETOED]
+
--
Type must not be added to the meta-model, eg. by means of _javax.enterprise.inject.Vetoed_ or _Profile_ . Consequently the specification-loader should skip introspection of those types. If discovered by Spring during class-path scanning, we remove the corresponding _BeanDefinition_ .
--

== Members

[#VIEW_MODEL]
=== VIEW_MODEL

Stateful object, with a state that can be marshaled and unmarshaled.

Includes classes annotated with _@DomainObject_ , when *not* associated with a persistence layer.

see also _#ENTITY_

[#ENTITY]
=== ENTITY

Persistable object, associated with a persistence layer/context.

Includes classes annotated with _@DomainObject_ , when associated with a persistence layer.

see also _#VIEW_MODEL_

[#MANAGED_BEAN_CONTRIBUTING]
=== MANAGED_BEAN_CONTRIBUTING

Injectable object, associated with a lifecycle context (application-scoped, request-scoped, ...).

In other words: Indicates that the class is a Spring managed bean, which IS also contributing to the UI or WEB API. Hence needs introspection.

The _ServiceRegistry_ must be aware.

to be introspected: YES

[#MANAGED_BEAN_NOT_CONTRIBUTING]
=== MANAGED_BEAN_NOT_CONTRIBUTING

Injectable object, associated with a lifecycle context (application-scoped, request-scoped, ...).

In other words: Indicates that the class is a Spring managed bean, which is NOT contributing to the UI or WEB API. Hence not introspected.

The _ServiceRegistry_ must be aware regardless.

This is also the fallback xref:refguide:applib:index/services/metamodel/BeanSort.adoc[BeanSort] for beans originating from _Bean_ annotated factory methods, when the bean class itself declares no annotations.

to be introspected: NO

[#MIXIN]
=== MIXIN

Object associated with an _entity_ , _viewmodel_ or _domain-service_ to act as contributer of a single _domain-action_ or _domain-property_ or _domain-collection_ .

[#VALUE]
=== VALUE

Immutable, serializable object. Values (including enums) my have object support methods, hence needs introspection.

[#COLLECTION]
=== COLLECTION

Container of objects.

[#ABSTRACT]
=== ABSTRACT

A non concrete type, that is a placeholder for a concrete implementer.

E.g. action return types or collection element types could be interfaces or abstract types (as discovered by reflection during introspection)

[#PROGRAMMATIC]
=== PROGRAMMATIC

Type must NOT be added to the meta-model, eg. by means of _org.apache.causeway.applib.annotation.Domain.Exclude_ or xref:refguide:applib:index/annotation/Programmatic.adoc[Programmatic] . Consequently the specification-loader should skip introspection of those types.

In other words: Indicates that the class is some bean, which is NOT contributing to the UI or WEB API, and also NOT managed by Spring.

_ServiceRegistry_ will NOT be aware.

_FactoryService#create(Class)_ will nevertheless support those programmatic beans. They may have injection points that need resolving.

[#VETOED]
=== VETOED

Type must not be added to the meta-model, eg. by means of _javax.enterprise.inject.Vetoed_ or _Profile_ . Consequently the specification-loader should skip introspection of those types. If discovered by Spring during class-path scanning, we remove the corresponding _BeanDefinition_ .

_ServiceRegistry_ must not be aware of those types.

_FactoryService#getOrCreate(Class)_ must fail for those types.
