public class FacetProcessor extends Object implements RuntimeContextAware
| Constructor and Description |
|---|
FacetProcessor(IsisConfiguration configuration,
CollectionTypeRegistry collectionTypeRegistry,
ProgrammingModel programmingModel) |
| Modifier and Type | Method and Description |
|---|---|
void |
findAndRemoveCollectionAccessors(MethodRemover methodRemover,
List<Method> methodListToAppendTo)
Use the provided
MethodRemover to have all known
PropertyOrCollectionIdentifyingFacetFactorys to remove all
property accessors, and append them to the supplied methodList. |
void |
findAndRemovePropertyAccessors(MethodRemover methodRemover,
List<Method> methodListToAppendTo)
Use the provided
MethodRemover to have all known
PropertyOrCollectionIdentifyingFacetFactorys to remove all
property accessors, and append them to the supplied methodList. |
Set<Method> |
findAssociationCandidateAccessors(List<Method> methods,
Set<Method> candidates)
|
FacetFactory |
getFactoryByFactoryType(Class<? extends FacetFactory> factoryType) |
void |
init() |
void |
injectDependenciesInto(FacetFactory factory)
This is public so that can be used for @Facets
processing.
|
void |
process(Class<?> cls,
Method method,
MethodRemover methodRemover,
FacetedMethod facetedMethod,
FeatureType featureType,
Properties metadataProperties)
Attaches all facets applicable to the provided
type of
feature to the supplied FacetHolder. |
void |
process(Class<?> cls,
Properties metadataProperties,
MethodRemover methodRemover,
FacetHolder facetHolder)
Attaches all facets applicable to the provided
object) to the supplied FacetHolder. |
void |
processMemberOrder(Properties metadataProperties,
ObjectMember facetHolder) |
void |
processParams(Method method,
int paramNum,
FacetedMethodParameter facetedMethodParameter)
Attaches all facets applicable to the provided
parameter), to the supplied
FacetHolder. |
void |
processPost(Class<?> cls,
Properties metadataProperties,
MethodRemover methodRemover,
FacetHolder facetHolder) |
boolean |
recognizes(Method method)
Whether this
method is recognized by any of the
FacetFactorys. |
void |
registerFactory(FacetFactory factory) |
void |
setRuntimeContext(RuntimeContext runtimeContext)
|
void |
shutdown() |
public FacetProcessor(IsisConfiguration configuration, CollectionTypeRegistry collectionTypeRegistry, ProgrammingModel programmingModel)
public void init()
public void shutdown()
public void registerFactory(FacetFactory factory)
public void injectDependenciesInto(FacetFactory factory)
public FacetFactory getFactoryByFactoryType(Class<? extends FacetFactory> factoryType)
public Set<Method> findAssociationCandidateAccessors(List<Method> methods, Set<Method> candidates)
Set all of the Methods that may
represent a property or collection.
Delegates to all known
PropertyOrCollectionIdentifyingFacetFactorys.
public void findAndRemovePropertyAccessors(MethodRemover methodRemover, List<Method> methodListToAppendTo)
MethodRemover to have all known
PropertyOrCollectionIdentifyingFacetFactorys to remove all
property accessors, and append them to the supplied methodList.
Intended to be called after
#findAndRemoveValuePropertyAccessors(MethodRemover, List) once
only reference properties remain.
PropertyOrCollectionIdentifyingFacetFactory#findAndRemoveValuePropertyAccessors(MethodRemover,
List)public void findAndRemoveCollectionAccessors(MethodRemover methodRemover, List<Method> methodListToAppendTo)
MethodRemover to have all known
PropertyOrCollectionIdentifyingFacetFactorys to remove all
property accessors, and append them to the supplied methodList.public boolean recognizes(Method method)
method is recognized by any of the
FacetFactorys.
Typically this is when method has a specific prefix, such as validate or hide. Specifically, it checks:
MethodPrefixBasedFacetFactoryMethodFilteringFacetFactory
The design of MethodPrefixBasedFacetFactory (whereby this facet
factory set does the work) is a slight performance optimization for when
there are multiple facet factories that search for the same prefix.
public void process(Class<?> cls, Properties metadataProperties, MethodRemover methodRemover, FacetHolder facetHolder)
object) to the supplied FacetHolder.
Delegates to FacetFactory#process(Class, FacetHolder) for each
appropriate factory.
cls - - class to processfacetHolder - - holder to attach facets to.FacetFactory.process(ProcessClassContext)public void processPost(Class<?> cls, Properties metadataProperties, MethodRemover methodRemover, FacetHolder facetHolder)
public void process(Class<?> cls, Method method, MethodRemover methodRemover, FacetedMethod facetedMethod, FeatureType featureType, Properties metadataProperties)
type of
feature to the supplied FacetHolder.
Delegates to FacetFactory#process(Method, FacetHolder) for each
appropriate factory.
cls - - class in which introspect; allowing the helper methods to be
found is subclasses of that which the method was originally
found.method - - method to processfacetedMethod - - holder to attach facets to.featureType - - what type of feature the method represents (property,
action, collection etc)metadataProperties - - additional properties to parse and useFacetFactory#process(Method, FacetHolder)public void processMemberOrder(Properties metadataProperties, ObjectMember facetHolder)
public void processParams(Method method, int paramNum, FacetedMethodParameter facetedMethodParameter)
parameter), to the supplied
FacetHolder.
Delegates to FacetFactory.processParams(ProcessParameterContext)
for each appropriate factory.
method - - action method to processparamNum - - 0-basedfacetedMethodParameter - - holder to attach facets to.FacetFactory.processParams(ProcessParameterContext)public void setRuntimeContext(RuntimeContext runtimeContext)
setRuntimeContext in interface RuntimeContextAwareCopyright © 2010–2014 The Apache Software Foundation. All rights reserved.