@Service public class MemberDetailsScannerImpl extends Object implements MemberDetailsScanner
MemberDetailsScanner.
Automatically detects all MemberDetailsDecorator instances in the
OSGi container and will delegate to them during execution of the
getMemberDetails(String, ClassOrInterfaceTypeDetails) method.
While internally this implementation will visit MetadataProviders and
MemberDetailsDecorators in the order of their type name, it is
essential an add-on developer does not rely on this behaviour. Correct use of
the metadata infrastructure does not require special type naming approaches
to be employed. The ordering behaviour exists solely to simplify debugging
for add-on developers and log comparison between invocations.
| Modifier and Type | Field and Description |
|---|---|
protected static Logger |
LOGGER |
protected org.springframework.roo.metadata.MetadataService |
metadataService |
| Constructor and Description |
|---|
MemberDetailsScannerImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
activate(org.osgi.service.component.ComponentContext context) |
protected void |
bindDecorators() |
protected void |
bindProviders() |
protected void |
deactivate(org.osgi.service.component.ComponentContext componentContext) |
MemberDetails |
getMemberDetails(String requestingClass,
ClassOrInterfaceTypeDetails cid)
Builds
MemberDetails instance for the given
ClassOrInterfaceTypeDetails. |
org.springframework.roo.metadata.MetadataService |
getMetadataService() |
protected static final Logger LOGGER
protected org.springframework.roo.metadata.MetadataService metadataService
protected void activate(org.osgi.service.component.ComponentContext context)
protected void bindDecorators()
protected void bindProviders()
protected void deactivate(org.osgi.service.component.ComponentContext componentContext)
public final MemberDetails getMemberDetails(String requestingClass, ClassOrInterfaceTypeDetails cid)
MemberDetailsScannerMemberDetails instance for the given
ClassOrInterfaceTypeDetails. In particular, this includes all ITD
members that can be acquired at this time. It also includes all members
in the standard Java source class hierarchy (as per
ClassOrInterfaceTypeDetails.getSuperclass()).
No attempt is made at visibility resolution due to inheritance or aspect overriding, although we may add this in the future (it is difficult to add definitively given the detected members may be incomplete due to infinite loop avoidance).
An implementation will pass the resulting MemberDetails through
any detected MemberDetailsDecorator instances so they can
potentially replace the result with a new instance that is ultimately
returned. It is required that implementations invoke decorators in the
alphabetic order of each decorator's fully qualified class name. Only
when every MemberDetailsDecorator returns the same
MemberDetails as it was passed will processing be regarded as
complete. This manages any issues with respect to the order in which
MemberDetailsDecorators are invoked.
The requesting class is presented as a String as per normal OSGi
conventions. This avoids issues that may occur if a Class was
used and the bundle owning that class was being deactivated. A
JavaType was not used because of its comparatively heavier weight
and is primarily used to represent user project-specific types (not
internal types).
getMemberDetails in interface MemberDetailsScannerrequestingClass - the fully-qualified class name requesting the
member details (required; may be used for result
customization)cid - the class or interface for which to build member information
(can be null)null if
null ClassOrInterfaceTypeDetails were givenpublic org.springframework.roo.metadata.MetadataService getMetadataService()
Copyright © 2009–2018 Pivotal Software, Inc.. All rights reserved.